Skip to main content
IIT Mandi

Chara Survival

Thermodynamic Graph Laplacian Survival Inference for Transcriptomic Oncology

PyPI version Hugging Face Python Web App License: MIT IIT Mandi

A frozen 4,337-gene thermodynamic intersection signature that transfers across sequencing platforms — zero retraining required.

⚡ Highlights & Key Capabilities

  • Zero-Shot Platform Invariance: Direct transfer from RNA-Seq (TCGA) to Microarray (GEO) with 0.7311 C-index and 0.8195 5-Year AUC without fine-tuning.
  • Biophysically Grounded: Powered by 6.0 $\mu\text{s}$ of MARTINI 3 coarse-grained molecular dynamics trajectories across 4 hallmark oncogenic targets (KRAS G12D, c-MYC/MAX, PTPN11/SHP2, and Mutant TP53) & heat kernel Laplacians $H_t = \exp(-tL)$.
  • 1-Click Clinical Reporting: Structured DataFrames with patient risk scores, relative hazard ratios, and estimated median survival timelines.
  • Publication-Ready Visualization: Built-in APIs to render risk-stratified Kaplan-Meier survival curves and biomarker weight charts.
  • 🤗 Hugging Face Hub Integrated: Auto-downloads frozen 4,337-gene consensus model weights directly on first import.

🌟 The Problem

Standard survival models — Cox proportional hazards, Random Survival Forests, DeepSurv — are trained on RNA-seq cohorts (typically TCGA) and collapse catastrophically when applied to microarray data (GEO). The cause is structural: uncorrected platform variance and feature distribution shift corrupt the learned risk landscape. The concordance index, already noisy at 0.50–0.55 on in-distribution data, degrades to random or sub-random when the platform changes.

This failure is not a modelling artefact. It is a physical problem — raw transcript counts do not encode the molecular interaction topology that determines biological function. Chara corrects this at the feature level, before training even begins.

💡 The Solution

Chara grounds gene expression features in thermodynamic graph Laplacians derived from MARTINI 3 coarse-grained molecular dynamics (MD) simulations. Specifically:

  1. MARTINI 3 MD trajectories are run for key oncogenic protein systems (KRAS, CMYC/MAX, PTPN11, MUT-TP53) across biological replicates.
  2. Exponential heat kernels are computed from the symmetrised graph Laplacian of the STRING protein–protein interaction network, weighted by MD-derived edge variances via the Chara exponential operator: $$W_{\text{Chara}}(i, j) = W_{\text{STRING}}(i, j) \cdot \exp\left(\tau \cdot Z(\sigma^2_{ij})\right)$$
  3. The resulting thermodynamic Laplacian representation produces a platform-invariant feature space via spectral heat diffusion $H_t = \exp(-tL)$ — the spectral geometry of molecular interaction rather than raw transcript abundance.
  4. A frozen CoxNet trained on TCGA-LUAD using these 4,337 thermodynamically-stabilised features (58 active regularized biomarkers) is applied directly to unseen cohorts without fine-tuning.

The result is a model that generalises across the RNA-seq ↔ microarray boundary as a matter of physical principle, not statistical luck.


🔬 Benchmark Performance

Evaluated zero-shot on GSE31210 (Affymetrix Human Genome U133 Plus 2.0, n = 226, completely held-out lung adenocarcinoma microarray cohort — never seen during training):

Model OOD C-Index 1-Year AUC 3-Year AUC 5-Year AUC
Clinical Cox-PH (Age, Gender, Stage) 0.5000 0.5000 0.5000 0.5000
Random Survival Forest (RSF) 0.4041 0.4175 0.3657 0.4842
Elastic Net Coxnet (Raw 5,200 genes) 0.5248 0.4664 0.4081 0.2428
DeepSurv (Deep Neural Network) 0.5537 0.5465 0.3937 0.3122
Chara (Thermodynamic Laplacian) 0.7311 0.7463 0.7826 0.8195

Chara achieves a +0.267 absolute improvement in OOD C-index over the next-best deep learning baseline, with monotonically improving time-horizon AUC — an unusual and clinically meaningful signature of robust calibration rather than threshold overfitting.


🚀 Quickstart: Python Package

Installation

pip install --upgrade chara-survival

1-Line Python Inference & Complete API

import chara
import pandas as pd

# 1. Load the frozen pretrained model (auto-fetches from Hugging Face Hub)
model = chara.load_model()

# 2. Ingest your patient cohort CSV (or load synthetic test cohort)
cohort_df = chara.load_sample_cohort(n_patients=12)

# 3. Generate 1-Click Structured Clinical Summary DataFrame
summary_df = model.predict_dataframe(cohort_df)
print(summary_df)
# Output columns: [Risk_Score, Hazard_Ratio, Risk_Stratification, Median_Survival, 1_Year_Survival_Prob, 3_Year_Survival_Prob, 5_Year_Survival_Prob]

# 4. Cohort Diagnostic Breakdown
cohort_stats = model.summarize_cohort(cohort_df)
print(cohort_stats)
# Output: {'Cohort_Size': 12, 'Mean_Risk_Score': 0.02, 'Mean_Hazard_Ratio': 1.14, 'High_Risk_Fraction': '25.0%', ...}

# 5. Single-Patient Clinical Prognosis
patient_prognosis = model.predict_patient(cohort_df.iloc[0])
print(patient_prognosis)

# 6. Export predictions as a JSON string (great for APIs)
json_results = model.predict_json(cohort_df)
print(json_results)

# 7. Complete Cohort Benchmark (C-Index & 1/3/5-Year Brier Scores)
benchmark_metrics = model.evaluate_benchmark(
    cohort_df,
    times=[12, 24, 36, 48, 60, ...],
    events=[1, 0, 1, 0, 1, ...]
)
print(benchmark_metrics)
# Output: {'C_Index': 0.7311, 'Brier_Score_1Year': 0.112, 'Brier_Score_3Year': 0.148, 'Brier_Score_5Year': 0.165, ...}

# 8. Plot Publication-Grade Kaplan-Meier Curves & Biomarkers
model.plot_survival(cohort_df, save_path="km_survival.png")
model.plot_biomarkers(top_n=10, save_path="biomarkers.png")

Direct Hugging Face Hub Loading

from huggingface_hub import hf_hub_download
import joblib

model_path = hf_hub_download(repo_id="SharonMelhi/chara-survival", filename="chara_model_4337.pkl")
bundle = joblib.load(model_path)
print(f"Loaded Chara bundle with {len(bundle['genes'])} features and {len(bundle['non_zero_genes'])} biomarkers.")

🌐 Interactive Web Portal & Comparison Sandbox

Try the live, zero-install interactive inference suite and multi-model benchmark sandbox:

👉 https://chara-frontend.vercel.app


🧬 Key Biomarkers & Hazard Drivers

The regularized signature isolates 58 key prognostic genes:

  • Top Oncogenic Hazard Drivers ($\beta > 0$): CCL20 (+0.0642), DKK1 (+0.0610), IGF2BP1 (+0.0351), BARX1 (+0.0328), SPRR1B (+0.0324).
  • Top Favorable / Protective Biomarkers ($\beta < 0$): MS4A1 (-0.0708, CD20 B-cell marker), FAIM2 (-0.0524), FAM133A (-0.0470), SLC5A5 (-0.0290).

📜 Citation

@software{Melhi_Chara_Survival_2026,
  author = {Melhi, Sharon and Hungyo, Kharerin},
  title = {Chara: Thermodynamic Graph Laplacian Survival Inference for Transcriptomic Oncology},
  url = {https://github.com/Sharon-codes/Chara},
  year = {2026},
  publisher = {Computational and Physical Genomics Laboratory, Indian Institute of Technology Mandi}
}

👥 Authors & Lab

Dr. Kharerin Hungyo
Dr. Kharerin Hungyo
Principal Investigator
Computational & Physical Genomics Lab
Indian Institute of Technology Mandi

kharerin@iitmandi.ac.in
Sharon Melhi
Sharon Melhi
Computational Biologist
Creator, Chara Survival

LinkedIn · Email

Special thanks to Khushi Mhamane for her constant encouragement, thoughtful discussions, and belief in this research from its earliest stages. — Sharon Melhi


📄 License

Released under the MIT License. © 2026 Sharon Melhi.

Metadata

Release files for chara-survival 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chara-survival 0.2.8
File Size Uploaded
chara_survival-0.2.8.tar.gz 19.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chara-survival 0.2.8
File Interpreter ABI Platform
chara_survival-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 kB

Release files / chara_survival-0.2.8.tar.gz

Download URL chara_survival-0.2.8.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e8b17efad44f7a93c6fd9bb6f86b36676b2de0fd4bba6fccc51c465362395c22
BLAKE2b-256 checksum
How to use checksums
424033794bc8ec802f40260292b99d5aedbf3b143ca4814b8f783cc7c66c7816
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / chara_survival-0.2.8-py3-none-any.whl

Download URL chara_survival-0.2.8-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee601293365cd23dc0e24b29ba5ce2981aee1276a31c22c130bcc0266bed9271
BLAKE2b-256 checksum
How to use checksums
8bca0d9b98c9476922fb982ce55fbbb527e2645f23f595963c5899b885f0deff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page