Cyto.Perturbation (RELAY) β€” Pretrained Frozen Checkpoints

This repository hosts the official compact float32 frozen checkpoints for RELAY (Cyto.Perturbation), a lightweight, LLM-free method that anchors on training gene means, transfers dense signed and magnitude contrasts over a five-source biological knowledge kernel, and maps them to calibrated differential-expression (DE) and direction-of-change (DIR) decisions on CPU.

Included Checkpoints

Two strictly scoped, independently verified checkpoints are provided under separate subdirectories (never mix or substitute between domains):

Subdirectory Domain Cell Lines Size (float32) Manuscript Target Verified Metrics
perturbqa-samecell-v1/ Unseen CRISPRi gene perturbations k562, hepg2, jurkat, rpe1 ~633 MB Table 1 & Table A2 DE: Macro-F1 0.8941, WG-BAcc 0.6574, pgAUROC 0.7732
DIR: Macro-F1 0.8722, WG-BAcc 0.7672, pgAUROC 0.8611
genetak-compounds-v1/ Unseen small-molecule compounds c32, hop62, hepg2_c3a, hs_766t, panc-1 ~39 MB Table 6 & Table A4 DE: Macro-F1 0.9179, WG-BAcc 0.5463, pgAUROC 0.6138
DIR: Macro-F1 0.7828, WG-BAcc 0.5574, pgAUROC 0.6284

Numerical Verification (float32 vs. Archival float64)

Both float32 packages have been verified end-to-end against all sealed test queries with 0 decision mismatches:

  • PerturbQA (perturbqa-samecell-v1): 116,041 pairs across 4 cell lines β€” 0 DE mismatches, 0 ternary mismatches, max absolute score difference 7.81e-6 (DE) and 2.10e-6 (DIR); ~7.3 s total on 8 CPU threads.
  • GeneTAK (genetak-compounds-v1): 166,202 DE + 85,832 DIR holdout pairs across 5 cell lines β€” 0 DE mismatches, 0 DIR mismatches, max absolute score difference 5.36e-7 (DE) and 2.16e-7 (DIR); ~11.5 s total on 8 CPU threads.

Quick Start

1. Download a Checkpoint

from huggingface_hub import snapshot_download

# Download PerturbQA CRISPRi checkpoint (~633 MB)
pq_dir = snapshot_download(
    repo_id="KassdinZheng/Cyto.Perturbation",
    allow_patterns="perturbqa-samecell-v1/*",
)

# Or download GeneTAK compound checkpoint (~39 MB)
gt_dir = snapshot_download(
    repo_id="KassdinZheng/Cyto.Perturbation",
    allow_patterns="genetak-compounds-v1/*",
)

2. Run Inference (CPU-Only)

from pathlib import Path
from relay import RelayEngine

# PerturbQA gene knockdowns
pq_engine = RelayEngine(Path(pq_dir) / "perturbqa-samecell-v1", threads=8)
rows, warnings = pq_engine.predict("k562", [("MYC", "CDKN1A"), ("TP53", "MDM2")])

# GeneTAK small-molecule compounds
gt_engine = RelayEngine(Path(gt_dir) / "genetak-compounds-v1", threads=8)
rows, warnings = gt_engine.predict("c32", [("AFATINIB", "CDKN1A")])

Checkpoint Structure & Integrity

Each checkpoint directory contains a manifest.json recording exact file sizes and SHA-256 digests verified automatically on load by RelayEngine(..., verify_sha256=True):

  • knowledge_symbols.json: Ordered perturbation universe indexed by knowledge_features.npz.
  • <cell>/signed_dual.npy, magnitude_dual.npy (and effect_dual.npy for PerturbQA): Frozen kernel ridge dual coefficients (float32, allow_pickle=False).
  • <cell>/knowledge_features.npz, support_features.npz: Sparse 5-source TF-IDF knowledge features (go, reactome, corum, string, bioplex).
  • <cell>/embedding.npz, statistics.npz: 32-dim PCA projection, MAD error scales, and training gene means.
  • <cell>/head_seed{17,23,31}.pt: 3-seed ensemble of 6,434-parameter DE readout MLPs (weights_only=True).
  • <cell>/metadata.json: Frozen gene axis order, ridge penalty, and development-calibrated thresholds.

Sealed test reference predictions and gold labels are excluded from this repository.

Output Semantics & Scope Boundaries

  • de_score and dir_score are [-1, 1] readout scores, not calibrated probabilities.
  • Use label (non_de, down, up) for joint three-class calls (applies the DE gate before direction).
  • Perturbations without annotated knowledge features fall back to training gene means and emit zero_knowledge_fallback:<PERTURBATION> in warnings.
  • perturbqa-samecell-v1 is strictly a same-cell CRISPRi model (including same-cell RPE1, not zero-shot held-out RPE1 transfer).

License & Upstream Attribution

Model weights are released under CC BY-NC 4.0 (see MODEL_LICENSE.md). Raw third-party datasets and knowledge-graph archives are not redistributed here; upstream sources include PerturbQA (10.5281/zenodo.14915312), Replogle et al. (2022), Nadig et al. (2025, 10.6084/m9.figshare.29498366.v1), Tahoe-100M (Zhang et al., 2025), and GeneTAK / VCWorld (Wei et al., 2026).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support