Views
No views yet
src/
data/ loading + preprocessing of perturb-seq data, splits
models/ perturbation encoder, flow map, the PIVOT module
training/ training loop and losses
evaluation/ inference, rewards, metrics, baselines
experiments/ drivers for the result tables, ablations, figures
utils/
scripts/ figure generation, extra ablations, GEARS comparison
experiments/ saved result jsonpip install -r requirements.txt1python -m src.data.preprocess norman
2python -m src.data.preprocess replogle_k562data/processed/<dataset>/.1# train one model
2python -m src.training.train --dataset norman --split perturbation
3
4# forward + nomination tables
5python -m src.experiments.run_tables --dataset norman --tables forward_cell forward_perturbation
6
7# ablations
8python -m src.experiments.run_ablations --dataset norman
9
10# figures
11python scripts/figures.py1bash scripts/setup_gears_env.sh
2conda run -n pivot_gears python scripts/gears_ranking.pymodels/, and scripts/train_all.py
retrains them from scratch with the same configs and seed, so the numbers reproduce.models/norman/{cell,perturbation,combination}/ - Norman 2019 (CRISPRa K562), one per splitmodels/replogle_k562/{cell,perturbation,gene}/ - Replogle 2022 (CRISPRi K562), one per splitmodels/ablations/norman_perturbation/ - the ablation variants (loss components, perturbation
representation, training-data fraction, control-matching strategy), each a separate foldermodel.pt (a plain torch state dict), config.json (the training config),
and train_info.json (history + run info). loading needs the matching preprocessed dataset,
since the perturbation encoder vocabulary comes from the data:1import json, torch
2from src.data.perturb_data import load_dataset
3from src.training.train import TrainConfig, make_model
4
5cfg = TrainConfig(**json.load(open("models/norman/perturbation/config.json")))
6data = load_dataset(cfg.dataset)
7model = make_model(data, cfg, device="cpu")
8model.load_state_dict(torch.load("models/norman/perturbation/model.pt", map_location="cpu"))
9model.eval()python scripts/train_all.pyLICENSE.