File size: 2,608 Bytes
1ca8459 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | """Validate core files for the PD discovery benchmark repository.
The checks are intentionally lightweight so they can run in GitHub Actions
without external biomedical API access.
"""
from __future__ import annotations
from pathlib import Path
import pandas as pd
ROOT = Path(__file__).resolve().parents[1]
REQUIRED_FILES = [
"README.md",
"DATASET_CARD.md",
"CITATION.cff",
"LICENSE",
"dataset-metadata.json",
"dashboard/app.py",
"data/pd_discovery_target_benchmark.csv",
"data/compound_selectivity_safety_matrix.csv",
"data/validated_repurposing_candidates.csv",
"data/do_not_prioritise_or_comparator_compounds.csv",
"data/experimental_validation_matrix.csv",
"data/pd_discovery_benchmark_knowledge_graph.graphml",
"data/omics_recurrence/pd_multi_dataset_pathway_recurrence.csv",
"figures/benchmark_target_ranking.png",
"figures/benchmark_evidence_matrix.png",
"figures/compound_selectivity_safety_triage.png",
"reports/resource_manuscript_target_to_intervention_benchmark.md",
"reproducibility/finalization_claim_audit.csv",
]
def require(condition: bool, message: str) -> None:
if not condition:
raise SystemExit(message)
def main() -> None:
missing = [path for path in REQUIRED_FILES if not (ROOT / path).exists()]
require(not missing, f"Missing required files: {missing}")
targets = pd.read_csv(ROOT / "data/pd_discovery_target_benchmark.csv")
require({"symbol", "benchmark_consensus_score_0_100", "benchmark_label"}.issubset(targets.columns), "Target benchmark columns are incomplete")
require(len(targets) >= 5, "Target benchmark has too few rows")
require(targets["benchmark_consensus_score_0_100"].between(0, 100).all(), "Target scores must be 0-100")
validated = pd.read_csv(ROOT / "data/validated_repurposing_candidates.csv")
require(len(validated) >= 3, "Validated candidate table has too few rows")
require("curation_class" in validated.columns, "Validated candidate table lacks curation_class")
exclusions = pd.read_csv(ROOT / "data/do_not_prioritise_or_comparator_compounds.csv")
require(len(exclusions) >= 10, "Comparator/exclusion table has too few rows")
audit = pd.read_csv(ROOT / "reproducibility/finalization_claim_audit.csv")
require("clinical guardrail" in set(audit["domain"]), "Claim audit must include clinical guardrail")
require(audit["status"].astype(str).str.lower().eq("pass").all(), "One or more claim-audit checks failed")
print("PD discovery benchmark validation passed.")
if __name__ == "__main__":
main()
|