(
run_dir: Path,
status: str,
validation: dict[str, Any],
resource_plan: dict[str, Any] | None = None,
)
| 567 | |
| 568 | |
| 569 | def write_summary( |
| 570 | run_dir: Path, |
| 571 | status: str, |
| 572 | validation: dict[str, Any], |
| 573 | resource_plan: dict[str, Any] | None = None, |
| 574 | ) -> None: |
| 575 | lines = [ |
| 576 | "# Somatic DNA Variant Run Summary", |
| 577 | "", |
| 578 | f"Status: `{status}`", |
| 579 | f"Pairs parsed: `{validation.get('pair_count', 0)}`", |
| 580 | f"Designs: `{', '.join(validation.get('designs', [])) or 'none'}`", |
| 581 | "", |
| 582 | "## Key Artifacts", |
| 583 | "", |
| 584 | "- `validation/pairs.normalized.tsv`", |
| 585 | "- `workflow/somatic_command_plan.json`", |
| 586 | "- `qc/somatic_qc_summary.json`", |
| 587 | "- `qc/somatic_pair_review.tsv` and `qc/somatic_pair_review.json`", |
| 588 | "- `qc/somatic_filter_reasons.tsv`", |
| 589 | "- `variants/*.unfiltered.vcf.gz` and `variants/*.filtered.vcf.gz` when executed", |
| 590 | "- `resources/resource_plan.json`, `resource_manifest.tsv`, `resource_env.sh`, `resource_readiness.md`, and resource setup-plan artifacts", |
| 591 | "- `visualizations/index.html` and `visualizations/visualization_manifest.json`", |
| 592 | "- `notebooks/vcf_review.marimo.py` when output VCF/gVCF artifacts are present", |
| 593 | "- `run_manifest.json` and `artifact_index.json`", |
| 594 | "", |
| 595 | "## Guardrails", |
| 596 | "", |
| 597 | "- Tumor-only calls are not confirmed somatic without matched-normal or strong germline-resource filtering.", |
| 598 | "- Panel-of-normals and orientation-bias filtering should match the capture kit, library prep, and reference build.", |
| 599 | "", |
| 600 | ] |
| 601 | if validation.get("warnings"): |
| 602 | lines.extend(["## Warnings", ""]) |
| 603 | lines.extend(f"- {item}" for item in validation["warnings"]) |
| 604 | lines.append("") |
| 605 | lines.extend(ngs_resource_gate.resource_summary_lines(resource_plan)) |
| 606 | if validation.get("errors"): |
| 607 | lines.extend(["## Blockers", ""]) |
| 608 | lines.extend(f"- {item}" for item in validation["errors"]) |
| 609 | write_text(run_dir / "summary.md", "\n".join(lines) + "\n") |
| 610 | |
| 611 | |
| 612 | def write_visuals( |
no test coverage detected