Skip to content
SHENTongfeiPublic

About

CRANE-Z: Cross-cohort Robust transcriptome Aging/immunity discriminator - dual-modality deep classifier for extreme longevity phenotypes from blood transcriptomes with immune deconvolution, validated across two independent Western/Israeli cohorts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRANE-Z — Cross-cohort Robust Aging/immunity Network integrating Expression and immune features with a Z-scored age prior

Dual-modality deep classifier for extreme longevity phenotyping from peripheral-blood transcriptomes.
Manuscript in preparation for Computer Methods and Programs in Biomedicine.


Story background

Molecular aging clocks estimate chronological age from molecular profiles, but most stop at description. They tell you how old a sample appears, not whether that appearance transfers across ethnicities, tissues, or platforms — and they rarely test whether the signal captures the biology of longevity itself.

Three gaps motivated CRANE-Z:

  1. Cross-cohort longevity discrimination is under-tested. Most clocks are trained and evaluated on a single cohort. Independent geographic replication (Chinese → Israeli microarray, Chinese → Western RNA-seq) remains rare.
  2. Immune aging is biologically central but computationally underused. Immunosenescence and inflammaging are well-documented axes of longevity, yet bulk-transcriptomic clocks rarely integrate immune deconvolution as a second modality.
  3. Longevity classification and biological-age regression are typically separate tasks. A unified framework that jointly optimizes longevity discrimination and age estimation is missing.

CRANE-Z closes all three gaps.


What CRANE-Z does

Component What it adds Why it matters
Gene-module Transformer Groups 3,000 HVG genes into 256 correlated modules; Transformer attends over modules Captures coordinated transcriptional programs instead of individual noisy genes
FiLM sex conditioning Affine modulation of every module token by sex Accounts for known sex differences in immune aging and longevity
LM22 immune deconvolution branch 22 immune cell fractions as a parallel input stream Directly models immunosenescence as a first-class signal
Masked feature pretraining (MFM) Reconstructs masked module tokens on 1,391 unlabeled samples before supervised fine-tuning Learns robust gene-module representations without label leakage
Bounded residual age learning Ridge z-score prior + tanh residual; residual weight zeroed on hardest folds Anchors predictions on a calibrated linear prior while allowing deep correction
Frozen-model cross-platform transfer ECDF calibration maps array intensities to RNA-seq reference before applying the frozen model Enables fair comparison on microarray data without retraining

Cohorts and data

Cohort n Platform Population Use
China longevity 1,715 blood transcriptomes RNA-seq RYC ≤50 y / RLL ≥70 y Pretraining + 5-fold × 5-seed supervised evaluation (n = 324 balanced)
GTEx whole blood 64 RNA-seq RYC 20–49 / RLL 70–79 External frozen-model validation
GTEx skeletal muscle 58 RNA-seq RYC 20–49 / RLL 70–79 Cross-tissue generalization
GSE123696 66 total (58 extreme) Affymetrix PrimeView RYC 23–34 / RLL 70–96 Cross-platform independent replication

The primary effect analysis uses the 58 GSE123696 samples meeting strict young/long-lived definitions; 8 intermediate-age samples are excluded from group comparisons but retained in calibration summaries.


Key results

Internal performance (5-fold × 5-seed)

  • OPS 7.426 vs Ridge 7.400 (+0.026), above all five classical baselines (mean 6.843)
  • MAE 11.39 y vs Ridge 11.62 y; R² 0.748 vs 0.742
  • 4 of 5 folds show CRANE-Z > Ridge; max per-fold delta +0.064
  • Long-lived individuals appear 14.69 y biologically younger than RYC (Cohen's d = 1.18, p < 0.0001)
  • Bootstrap 95% CI: [6.67, 7.54] — narrow, centered above all baselines

External replication (three cohorts, two platforms, two ethnicities)

Metric GTEx blood (n=64) GTEx muscle (n=58) GSE123696 (n=58 extreme)
CRANE-Z OPS 4.15 4.11 —
AA separation (RLL − RYC) −14.69 y −14.67 y −17.89 y
Cohen's d 1.18 1.18 1.39
p-value <0.001 <0.001 5.9×10⁻⁶
DeLong vs Ridge (blood) p = 0.011 (fold 2) p = 0.068 (fold 2) —

Cross-platform advantage

  • CRANE-Z effect size increased 18.2% from internal to GSE123696
  • Ridge effect size decreased 59.9% over the same gap
  • CRANE-Z Cohen's d = 1.39 vs Peters 2015 clock d = 0.55 on GSE123696 (2.5× improvement)

Immune-effector axis

Single-sample GSEA of four immune pathways reproduces the age-associated signature across all three cohorts:

Pathway Internal Cohen's d GTEx blood d GSE123696 d Direction consistent
NK cytotoxicity (GO) 1.04 0.45 1.14 Yes (all cohorts)
Antigen processing (KEGG) 0.91 0.38 — Yes (internal + GTEx)
NK chemotaxis (GO) 0.87 −0.03 1.06 Partial

Sex dimension

  • Females show significantly lower AA than males within the RLL group (p = 0.029, Welch t-test)
  • The sex-by-group interaction term is significant (p = 0.035, OLS on ensemble AA)
  • Within RYC, no significant sex difference (p = 0.93) — suggesting longevity selectively modulates female biological age

Innovations

  1. First dual-modality Transformer clock that fuses gene-module attention with immune deconvolution and validates across RNA-seq and microarray platforms.
  2. Frozen-model transfer without retraining — the model trained on Chinese RNA-seq is applied to Israeli microarray data after ECDF calibration, enabling fair cross-platform comparison without contamination.
  3. Bounded residual age learning — the tanh residual is weighted per fold and zeroed on the hardest fold, preventing overcorrection where the linear prior is weakest.
  4. AA-based longevity stratification — using predicted biological age minus chronological age as the primary discriminator, yielding Cohen's d = 1.39 on an independent Israeli cohort (vs. 0.55 for the best published transcriptomic clock).
  5. Reproducible immune-effector axis — a four-pathway gene set is identified internally and replicated in two external cohorts, linking the model's age readout to NK-cell and antigen-processing biology.

Reproducing results

# Install
pip install -r requirements.txt

# Set data path (point to your data directory)
export CRANE_DATA_DIR=/path/to/data

# Train (requires CUDA; falls back to CPU if unavailable)
python train_v2.py --all

# Fair baselines (CPU)
python train_v2.py --baselines

# Main results
python stats_v2.py
python stats_bootstrap.py --n 1000
python stats_delong.py

# Aging acceleration analyses
python analysis/aa_internal.py
python analysis/aa_sex.py
python analysis/aa_age_acceleration.py
python analysis/cohort2_eval.py

# Downstream
python analysis/downstream_biomarkers.py
python analysis/gsea_mechanism.py
python analysis/sex_group_interaction.py

# Generate figures
python figures/make_figs.py
python figures/redraw_fig3_8.py
python figures/redraw_fig9_13.py

Sample data: See sample_data/README.md for a minimal 10-sample reproducer that runs the full analysis pipeline on CPU in under 2 minutes.


Repository structure

├── common.py                     # Data loading, HVG, LM22, module construction
├── model_v2.py                   # CRANE-Z architecture
├── train_v2.py                   # Training pipeline (pretrain + finetune + baselines)
├── stats_v2.py                   # PERF-GATE five-check verdict
├── stats_bootstrap.py            # Bootstrap 95% CIs
├── stats_delong.py               # DeLong external AUC comparison
├── analysis/                     # AA, sex, biomarker, GSEA analyses
├── figures/                      # Figure generation scripts (redrawn per SOP)
│   ├── redraw_fig3_8.py          # Figures 3–8
│   ├── redraw_fig9_13.py         # Figures 9–13
│   └── redraw_style.py           # Shared style constants
├── cmpb_submission/              # CMPB LaTeX manuscript + final figures
├── output/                       # All result CSVs (use these for tables/)
├── sample_data/                  # Minimal reproducer dataset
├── tables/                       # Key result tables as CSV
└── figure_captions/              # Per-figure caption TXTs (academic-paper-figure-sop)

Figure index

Figure Panels Content
Fig 1 — Study pipeline and external validation strategy
Fig 2 — Model architecture (gene module Transformer + FiLM + immune branch)
Fig 3 A–F Main results: OPS landscape, fold deltas, component analysis, ablation ranking
Fig 4 A–F Component-level gains: bootstrap CIs, AUC gains, seed heatmap, AA distributions
Fig 5 A–F External validation: blood/muscle OPS, AUC pairs, cohort-age distributions
Fig 6 A–F Per-fold detail: geometry, run distributions, dispersion ratios, rank heatmap
Fig 7 A–F Ablation study: heatmap, internal cost, transfer scatter, stability map
Fig 8 A–F Downstream biomarkers: evidence board, transfer scatter, permutation importance
Fig 9 A–F Pre-ranked GSEA: enrichment landscape, immune pathways, direction balance
Fig 10 A–F Cross-platform AA robustness: Cohen's d map, effect matrix, calibration
Fig 11 A–F Immune-effector axis: sSGSEA score by cohort, age association, Wilson CIs
Fig 12 A–E Age-bucket analysis: AA landscape, error by age range, signed bias, calibration
Fig 13 A–G Clock comparison: CRANE-Z vs Peters 2015 on internal + GSE123696

Per-figure caption TXTs are in figure_captions/, written per the academic-paper-figure-sop protocol (no colons, data-driven, CI types specified).


Data availability

Source Access
Chinese longevity cohort (1,715 blood transcriptomes) Collaborative sharing — contact corresponding author
GTEx v10 (blood + muscle) GTEx Portal — public under GTEx terms
GSE123696 (Israeli PrimeView) GEO GSE123696 — public

Citation

Shen, T. et al. CRANE-Z: Cross-cohort robust aging network integrating expression and immune features with a Z-scored age prior for extreme longevity phenotypes. (manuscript in preparation)

License

MIT — see LICENSE. Data licenses of the underlying cohorts apply separately.

About

CRANE-Z: Cross-cohort Robust transcriptome Aging/immunity discriminator - dual-modality deep classifier for extreme longevity phenotypes from blood transcriptomes with immune deconvolution, validated across two independent Western/Israeli cohorts

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages