Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

path2path-paper

Analysis code archive for the manuscript "path2path: directional pathway--pathway interaction maps from genome-scale Perturb-seq" (Jun Li, University of Notre Dame).

This archive contains the code that actually produced every number, figure, and table in the manuscript and its supplementary material: the frozen research library (R/), the analysis and reproduction scripts (scripts/), the data-export scripts (scripts/ingest/), and the figure-generation scripts (figures/).

Relation to the path2path R package. The Bioconductor package (https://github.com/jli-stat/path2path) is the maintained distribution of the method. The manuscript's analyses were run with the frozen library archived here, which parallelizes with parallel::mclapply under RNGkind("L'Ecuyer-CMRG") and fixed seeds; the package uses BiocParallel, whose worker random streams differ, so borderline map entries can differ from the archived runs at Monte-Carlo noise level (strong entries and all conclusions are unaffected). Exact reproduction of the manuscript requires this archive.

Layout

R/, source_all.R      frozen research library (sourced, not installed)
scripts/              analysis + reproduction scripts (see map below)
scripts/ingest/       raw public data -> input z-score matrices
figures/              main and supplementary figure generation (Python)
environment/          R/Python/platform version snapshots

Setup

  1. R >= 4.4 with fgsea, msigdbr, data.table, BiocParallel, jsonlite (versions used: environment/R_package_versions.tsv); Python >= 3.12 with numpy, pandas, scipy, matplotlib, anndata, h5py (environment/python_versions.tsv).
  2. Create a data root directory and set the environment variable P2P_BASE to it. All scripts read and write under $P2P_BASE/{Marson2025,Replogle2022,Feng2026}.

Data acquisition (all public)

Create $P2P_BASE/Marson2025, $P2P_BASE/Replogle2022, $P2P_BASE/Feng2026 and download into them:

  • Marson2025 (primary CD4 T cells; Zhu et al., Cell 2026, doi:10.1016/j.cell.2026.08.002): GWCD4i.DE_stats.h5ad from the CZI Virtual Cells Platform release. Then run python scripts/ingest/export_conditions.py to produce zscore_{rest,stim8hr,stim48hr}.csv.gz and perturbation_metadata.csv.
  • Replogle2022 (K562 GWPS/essential, RPE1; Replogle et al., Cell 2022): the gemgroup z-normalized pseudobulk releases from the study's Figshare. Then python scripts/ingest/export_zscore.py <dataset> for k562_gwps, k562_essential, rpe1.
  • Feng2026 (iPSC village; Feng et al., Cell Genomics 2026): the mean-LFC long-format release and the targeted per-line table (TargetedScreen_LFC_byGene-perLine.tsv.gz) from the study's Figshare. Then python scripts/ingest/export_zscore_feng.py.

Each ingest script's docstring states its exact input filename(s) and the filters applied (which match the manuscript's Methods).

Reproducing the analyses

Everything is seeded; reruns are exactly reproducible on the archived software versions (see the seed registry below).

  1. Maps + within-dataset analyses + figures (the canonical driver; supports --resume):

    Rscript scripts/reproduce_all.R
    
  2. Route B calibration pools, all count-bearing maps (B = 20; resumable; ~10 h on an Apple M1 Max):

    zsh scripts/calibrate_all_B20.sh
    

    The primary CD4 48-hour Hallmark calibration (B = 50) is run by reproduce_all.R step "calibration CD4-48h hallmark".

  3. Post-processing behind the calibration figures/tables:

    python scripts/realized_fdr_diagnostics.py   # Fig 3d,e; Table S4
    Rscript scripts/deep_tail_bootstrap.R        # bootstrap CI in Results
    
  4. Figure-input CSV export (per-entry subsampling matrices for the supplementary subsampling figure):

    Rscript scripts/export_subsampling_csv.R
    
  5. Regression tests over the reported numbers:

    Rscript scripts/verify_numbers.R
    
  6. Figures (also invoked by the driver):

    cd figures && python make_figures.py && python make_supp_figures.py
    

Figure/table -> script map

Item Producing script(s)
Maps (M/pval/padj matrices, 7 datasets) run_path2path.R via reproduce_all.R
Fig 1 (schematic) figures/make_figures.py::fig1
Fig 2 (maps), Figs 5-6 (biology) figures/make_figures.py (computed from matrices at draw time)
Fig 3 (calibration) run_calibration.R, negative_control_test.R, realized_fdr_diagnostics.py, deep_tail_bootstrap.R
Fig 4 (replication + direction) matrices + baseline_comparison.py
Fig S7 inputs (subs_sign/subs_ratio CSVs) subsampling_sensitivity.R -> export_subsampling_csv.R
Rewiring quotes (Results) calibrate_all_B20.sh Reactome pools; condition_contrast_reactome.py
Table 1 dataset matrices (dimensions)
Table S1 / Fig S8 (transposed order) legacy_transposed_pipeline.R
Table S2 negative_control_test.R, k562_extra_validation.R, subsampling_sensitivity.R
Table S3 48-h Reactome padj matrix
Table S4 / Fig 3d,e realized_fdr_diagnostics.py
Fig S2 (tautology) with/without-target maps + tautology_stats.R
Figs S3-S7 figures/make_supp_figures.py

Provenance note (supplementary subsampling figure). The per-entry CSVs in the original research tree were exported 2026-08-28 from subsampling runs predating a library bug-fix pass; every published summary number comes from the 2026-08-30 reruns whose .rds files export_subsampling_csv.R reads (201 CD4 / 363 K562 strong entries). Regenerating the figure from this archive changes the histograms imperceptibly and no reported number.

Not included, and why

  • Raw downloads and all pipeline outputs (large; regenerable from the scripts above).
  • The path2path R package (distributed separately via Bioconductor and https://github.com/jli-stat/path2path).
  • Internal reviewer-readiness scripts whose results are not reported in the manuscript (parameter-sensitivity checks, threshold curves, runtime benchmark, the overnight batch driver, and legacy per-dataset drivers superseded by reproduce_all.R). Their outputs informed robustness statements only qualitatively; everything quoted in the paper is reproduced by the scripts archived here.

Seed registry

RNGkind("L'Ecuyer-CMRG") throughout; set.seed values are hard-coded in each script or passed by the drivers:

Seeds Use
20260821-20260833 reproduction-era scripts (per-script, see headers)
20260831 (+ per-permutation seed_base + b) run_calibration.R runs
20260901-20260911 B = 20 calibration sweep (calibrate_all_B20.sh)
20260932-20260933 deep-tail bootstrap

License

MIT (see LICENSE).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages