(
run_dir: Path,
status: str,
validation: dict[str, Any],
resource_plan: dict[str, Any] | None = None,
)
| 821 | |
| 822 | |
| 823 | def write_visuals( |
| 824 | run_dir: Path, |
| 825 | status: str, |
| 826 | validation: dict[str, Any], |
| 827 | resource_plan: dict[str, Any] | None = None, |
| 828 | ) -> dict[str, str]: |
| 829 | first_variant_summary = next( |
| 830 | iter(sorted((run_dir / "qc").glob("*.variant_summary.json"))), None |
| 831 | ) |
| 832 | entries = [ |
| 833 | artifact_entry( |
| 834 | artifact_id="sample_table", |
| 835 | title="Resolved Sample Table", |
| 836 | path="validation/samples.normalized.tsv", |
| 837 | kind="table", |
| 838 | status="created", |
| 839 | description="Resolved sample table with absolute BAM/CRAM alignment paths.", |
| 840 | ), |
| 841 | artifact_entry( |
| 842 | artifact_id="variant_summary", |
| 843 | title="Variant Summary", |
| 844 | path=str(first_variant_summary.relative_to(run_dir)) if first_variant_summary else None, |
| 845 | kind="json", |
| 846 | status="created" if first_variant_summary else "not_available", |
| 847 | description="Per-sample variant counts parsed from bcftools stats.", |
| 848 | ), |
| 849 | ] |
| 850 | review_outputs = add_vcf_review_notebook_entry( |
| 851 | run_dir, |
| 852 | entries, |
| 853 | title="DNA Variant VCF Review", |
| 854 | table_items=[("Resolved Sample Table", "validation/samples.normalized.tsv")], |
| 855 | object_items=[("Run Summary", "summary.md"), ("Artifact Index", "artifact_index.json")], |
| 856 | ) |
| 857 | entries.extend(ngs_resource_gate.resource_visual_entries(resource_plan)) |
| 858 | index = write_visualization_index( |
| 859 | run_dir, |
| 860 | title="DNA Variant Review Bundle", |
| 861 | description="Review surface for the local DNA variant lane, including VCF/gVCF notebook previews when variant artifacts are present.", |
| 862 | entries=entries, |
| 863 | notes=[ |
| 864 | *validation.get("warnings", []), |
| 865 | *ngs_resource_gate.resource_messages(resource_plan), |
| 866 | ], |
| 867 | analysis_intent="real_analysis" if status != "blocked" else "blocked_preflight", |
| 868 | provenance_summary={ |
| 869 | "status": status, |
| 870 | "sample_count": validation.get("sample_count", 0), |
| 871 | "resource_plan_ok": validation.get("resource_plan_ok"), |
| 872 | }, |
| 873 | ) |
| 874 | return { |
| 875 | "visualization_index": str(index.relative_to(run_dir)), |
| 876 | "visualization_manifest": "visualizations/visualization_manifest.json", |
| 877 | **review_outputs, |
| 878 | } |
| 879 | |
| 880 |
no test coverage detected