(
run_dir: Path,
status: str,
validation: dict[str, Any],
resource_plan: dict[str, Any] | None = None,
)
| 551 | |
| 552 | |
| 553 | def write_summary( |
| 554 | run_dir: Path, |
| 555 | status: str, |
| 556 | validation: dict[str, Any], |
| 557 | resource_plan: dict[str, Any] | None = None, |
| 558 | ) -> None: |
| 559 | lines = [ |
| 560 | "# ChIP/CUT&RUN Peaks QC Run Summary", |
| 561 | "", |
| 562 | f"Status: `{status}`", |
| 563 | f"Assay: `{validation.get('assay')}`", |
| 564 | f"Samples parsed: `{validation.get('sample_count', 0)}`", |
| 565 | "", |
| 566 | "## Key Artifacts", |
| 567 | "", |
| 568 | "- `workflow/chip_cutrun_command_plan.json`", |
| 569 | "- `qc/chip_cutrun_qc_contract.json`", |
| 570 | "- `qc/chip_cutrun_qc_summary.tsv` and `qc/chip_cutrun_qc_summary.json`", |
| 571 | "- `qc/chip_cutrun_qc_dashboard.html`, `qc/chip_cutrun_qc_frip_peak_overview.svg`, and `qc/chip_cutrun_qc_insert_size_distribution.svg`", |
| 572 | "- `peaks/*Peak`, `peaks/consensus_peaks.bed`, and `tracks/*.bw` when executed", |
| 573 | "- `tracks/browser_tracks.tsv`, `tracks/browser_track_preview.html`, `tracks/ucsc_track_lines.txt`, and `tracks/igv_session.xml`", |
| 574 | "- `motifs/motif_enrichment_plan.json`", |
| 575 | "- `motifs/motif_summary.tsv` when motif outputs are generated", |
| 576 | "- `resources/resource_plan.json`, `resource_manifest.tsv`, `resource_env.sh`, `resource_readiness.md`, and resource setup-plan artifacts", |
| 577 | "- `visualizations/index.html`", |
| 578 | "- `run_manifest.json` and `artifact_index.json`", |
| 579 | "", |
| 580 | ] |
| 581 | if validation.get("warnings"): |
| 582 | lines.extend(["## Warnings", ""]) |
| 583 | lines.extend(f"- {item}" for item in validation["warnings"]) |
| 584 | lines.append("") |
| 585 | lines.extend(ngs_resource_gate.resource_summary_lines(resource_plan)) |
| 586 | if validation.get("errors"): |
| 587 | lines.extend(["## Blockers", ""]) |
| 588 | lines.extend(f"- {item}" for item in validation["errors"]) |
| 589 | write_text(run_dir / "summary.md", "\n".join(lines) + "\n") |
| 590 | |
| 591 | |
| 592 | def parse_args() -> argparse.Namespace: |
no test coverage detected