Pan-cancer biomarker discovery from the command line
Project description
oncofind ๐ฌ
Pan-cancer biomarker discovery from the command line.
Integrates TCGA RNA-seq, clinical data, survival endpoints, and external validation into a reproducible, publication-ready pipeline.
What it does
oncofind downloads real TCGA RNA-seq data from the NIH Genomic Data Commons, runs differential expression, Kaplan-Meier survival analysis, and cross-cancer consistency scoring โ then validates ranked biomarker candidates against the COSMIC Cancer Gene Census.
In one command chain:
oncofind download --cancer BRCA --n-samples 100
oncofind deg --cancer BRCA --groupby stage
oncofind survival --cancer BRCA --gene TP53
oncofind score --cancers BRCA --top-n 200
oncofind validate --cccs-csv oncofind_results/pancancer_cccs_rankings.csv \
--cosmic-csv cosmic_census.csv --gene-col Gene --score-col CCCS
Architecture
GDC API (TCGA)
โ
โผ
GDCClient โโโบ ExpressionStore (Parquet)
โ โ
โผ โผ
ClinicalStore โโโบ DEGAnalyzer โโโบ volcano.html / heatmap.html
(survival_days, โ
sample_type, โผ
ER/PR/HER2) SurvivalAnalyzer โโโบ KM plot .html
โ
โผ
CrossCancerConsistencyScorer (CCCS)
โ
โผ
CosmicBenchmark (Precision@K vs CGC Tier 1)
โ
โผ
ReportGenerator โโโบ report_BRCA.html
Key modules
| Module | Purpose |
|---|---|
oncofind/core/data/gdc_client.py |
Async GDC API client (queries + parallel downloads) |
oncofind/core/data/expression_store.py |
Parquet expression matrix storage + DuckDB queries |
oncofind/core/data/clinical_store.py |
Clinical metadata: survival, subtype, sample_type |
oncofind/core/data/dgidb_client.py |
DGIdb drug-gene interaction API (700+ targets, cached) |
oncofind/core/analysis/deg.py |
DEG: PyDESeq2 + t-test fallback, tumor-vs-normal mode |
oncofind/core/analysis/survival.py |
Kaplan-Meier + log-rank (lifelines) |
oncofind/core/analysis/cccs.py |
Cross-Cancer Consistency Score |
oncofind/core/analysis/batch.py |
ComBat batch correction for multi-cohort analysis |
oncofind/core/validation/cosmic_benchmark.py |
Precision@K vs COSMIC Cancer Gene Census |
oncofind/cli/utils/manifest.py |
JSON run manifests for reproducibility |
scripts/weight_sensitivity.py |
CCCS rank stability (Kendall-ฯ) |
Installation
git clone https://github.com/sanjeevi0078/oncofind
cd oncofind
pip install -e .
Requirements: Python 3.10+, ~2GB disk space per cancer type.
Quickstart
1. Download real TCGA data
# 97โ100 BRCA RNA-seq + clinical samples (~400MB, ~6 min)
oncofind download --cancer BRCA --n-samples 100
# Multiple cancers for pan-cancer analysis
oncofind download --cancer LUAD --n-samples 50
oncofind download --cancer COAD --n-samples 50
2. Differential expression
# Clinical subgroup comparison
oncofind deg --cancer BRCA --groupby stage --method ttest
# Tumor vs Normal (uses GDC sample_type field)
oncofind deg --cancer BRCA --mode tumor_vs_normal --method deseq2
Outputs: volcano_BRCA.html, heatmap_BRCA.html, BRCA_deg_results.csv
3. Survival analysis
oncofind survival --cancer BRCA --gene TP53
oncofind survival --cancer BRCA --gene ESR1
oncofind survival --cancer BRCA --gene ERBB2
Outputs: BRCA_TP53_survival.html (Kaplan-Meier), BRCA_TP53_survival_groups.csv
4. Pan-cancer scoring (CCCS)
# Single cancer
oncofind score --cancers BRCA --top-n 200
# Multi-cancer with ComBat batch correction
oncofind pancancer --gene TP53 --cancers BRCA LUAD COAD --batch-correct
5. COSMIC validation
# Download COSMIC CGC CSV from cancer.sanger.ac.uk/census (free registration)
oncofind validate \
--cccs-csv oncofind_results/pancancer_cccs_rankings.csv \
--cosmic-csv cosmic_census.csv \
--gene-col Gene --score-col CCCS \
--ks 10,20,50,100
6. Rank stability analysis
python scripts/weight_sensitivity.py \
--cccs-csv oncofind_results/pancancer_cccs_rankings.csv
Reports Kendall-ฯ rank correlation across 5 CCCS weight configurations.
7. Full report
oncofind report --cancer BRCA --output-dir oncofind_results/
TCGA Data Access (GDC API)
All data is fetched from the NIH Genomic Data Commons public API โ no account required for open-access data.
# Under the hood: GDCClient queries the GDC Files endpoint
# and downloads STAR-Counts RNA-seq files (augmented_star_gene_counts format)
GET https://api.gdc.cancer.gov/files?...
GET https://api.gdc.cancer.gov/data/{file_id}
GET https://api.gdc.cancer.gov/cases?... # clinical
Is the GDC API free and reliable?
Yes, for open-access TCGA data (most RNA-seq). Rate limited to ~10 concurrent connections. The client uses an asyncio semaphore (max 5 concurrent) and aiter_bytes streaming to handle large files (4โ8 MB each). Failed downloads are logged and retried on next run (cached by file path).
The CCCS Metric
The Cross-Cancer Consistency Score (0โ1) rewards genes that are:
- Consistent in direction across multiple cancer types (all up or all down)
- High in fold change magnitude (|log2FC|)
- Associated with survival when split by expression
- Highly statistically significant (small adjusted p-value)
CCCS = w1ยทS_dir + w2ยทS_mag + w3ยทS_surv + w4ยทS_sig
Default weights: {"direction": 0.25, "magnitude": 0.25, "survival": 0.35, "significance": 0.15}
External validation
Ranked gene lists are benchmarked against COSMIC Cancer Gene Census Tier 1 (572 manually curated cancer driver genes):
Precision@K = |top_K โฉ COSMIC_Tier1| / K
A P@50 > 50% means the majority of your top-50 candidates are confirmed cancer drivers.
Reproducibility
Every CLI command writes a {command}_manifest.json alongside results:
{
"oncofind_version": "0.1.0",
"command": "deg",
"timestamp_utc": "2026-05-29T16:52:00Z",
"parameters": {
"cancer": "BRCA", "mode": "subtype_comparison",
"groupby": "stage", "method": "ttest",
"fdr": 0.05, "log2fc": 1.0
},
"input_data_hashes": {
"expression_matrix.parquet": "a3f7c2..."
},
"result_summary": {
"n_genes_tested": 60241,
"n_significant": 1847,
"n_up": 923, "n_down": 924,
"top_gene": "TP53"
}
}
CLI Reference
oncofind --help
Commands:
download Download TCGA RNA-seq + clinical data from GDC
deg Differential expression (PyDESeq2 or t-test, tumor vs normal)
survival Kaplan-Meier + log-rank survival analysis
pancancer Cross-cancer gene consistency with ComBat batch correction
score Rank all genes by CCCS
validate Benchmark against COSMIC Cancer Gene Census (Precision@K)
report Full HTML report for a cancer type
oncofind download --cancer BRCA --n-samples 100
oncofind deg --cancer BRCA --mode tumor_vs_normal --method deseq2
oncofind survival --cancer BRCA --gene TP53 --split tercile
oncofind pancancer --gene TP53 --cancers BRCA LUAD COAD --batch-correct
oncofind score --cancers BRCA LUAD COAD --top-n 200 --druggable-only
oncofind validate --cccs-csv rankings.csv --cosmic-csv census.csv --gene-col Gene --score-col CCCS
oncofind report --cancer BRCA --output-dir results/
Project Structure
oncofind/
โโโ oncofind/
โ โโโ cli/
โ โ โโโ commands/ # CLI commands (deg, survival, score, ...)
โ โ โโโ utils/
โ โ โโโ manifest.py # Run manifest / audit trail
โ โ โโโ validators.py # Input validation
โ โโโ config/
โ โ โโโ druggability.py # DGIdb facade
โ โ โโโ settings.py
โ โโโ core/
โ โโโ analysis/
โ โ โโโ batch.py # ComBat batch correction
โ โ โโโ cccs.py # Cross-cancer consistency score
โ โ โโโ deg.py # Differential expression
โ โ โโโ survival.py # Kaplan-Meier
โ โโโ data/
โ โ โโโ clinical_store.py
โ โ โโโ dgidb_client.py
โ โ โโโ expression_store.py
โ โ โโโ gdc_client.py
โ โโโ validation/
โ โ โโโ cosmic_benchmark.py
โ โโโ visualization/
โ โโโ heatmap.py
โ โโโ pancancer_plot.py
โ โโโ survival_plot.py
โ โโโ volcano.py
โโโ scripts/
โ โโโ run_full_pipeline.py # End-to-end pipeline runner
โ โโโ weight_sensitivity.py # CCCS rank stability (Kendall-ฯ)
โโโ tests/ # 21 unit tests
โโโ cosmic_census.csv # COSMIC CGC Tier 1 gene list
Methods, Limitations, and Validation Discussion
The CCCS Scoring System
The Cross-Cancer Consistency Score (CCCS) is a unified heuristic designed to identify robust transcriptomic biomarkers. It integrates four orthogonal signals:
- Directional Consistency (25%): Rewards genes whose expression changes concordantly (either universally upregulated or universally downregulated) across multiple cohorts.
- Magnitude (25%): Rewards genes with large absolute log2 fold-changes.
- Clinical Association (35%): Rewards genes where expression splits (e.g., median or quartile) are significantly associated with overall survival via log-rank tests.
- Statistical Significance (15%): Rewards genes with small adjusted p-values.
Covariate Control and Batch Standardization
To prevent false discoveries arising from clinical confounding and technical batch effects:
- Location-Scale Batch Standardization: Multi-cohort data is standardized within each cohort by centering and scaling (centering by the mean and dividing by the standard deviation of each batch). This mitigates technical batch differences without the risk of over-fitting associated with small-sample empirical Bayes models.
- Covariate-Adjusted OLS Regression: The differential expression fallback method employs ordinary least squares (OLS) regression (
gene ~ group + age + sex) rather than simple t-tests to control for age and gender covariates, ensuring observed differences are driven by disease state rather than demographic confounding.
COSMIC CGC Validation and Biological Limitations
Benchmarking oncofind rankings against the COSMIC Cancer Gene Census (CGC) Tier 1 yields a low precision (e.g., ~1% for top-100 candidates). This is a known biological limitation of expression-based biomarker pipelines:
- Expression vs. Mutation: COSMIC CGC is curated primarily from genes carrying somatic driver mutations (e.g.,
TP53,PIK3CA,PTEN,AKT1). The activity of these mutated proteins is often regulated post-translationally (e.g., phosphorylation, conformational changes) rather than by massive changes in mRNA expression. - Downstream Effectors: Differential expression between tumor and normal tissue primarily identifies cell-cycle, proliferation, and microenvironment-remodeling markers (e.g.,
MMP11,NEK2,KIF20A,ZWINT,UHRF1). While these genes are highly dynamic and strong prognostic factors (thus receiving high CCCS scores), they are downstream effectors rather than primary mutation-based drivers, and are therefore excluded from the COSMIC CGC census. - Methodological Recommendation: For general cancer driver identification, integrate transcriptomic profiling with somatic mutation (SNV/Indel) and copy number variation (CNV) data.
License
MIT License โ see LICENSE.
Citation
If you use oncofind in research, please cite:
Sanjeevi Utchav. oncofind: Pan-cancer biomarker discovery pipeline. 2026.
GitHub: https://github.com/sanjeevi0078/oncofind
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oncofind-0.1.0.tar.gz.
File metadata
- Download URL: oncofind-0.1.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e14c57795a5a61d1c2e58039ef7a669cf4185901a4a8e2d47d44edd7c1343edc
|
|
| MD5 |
727d36ce504971fe75e853cc9dc37ed1
|
|
| BLAKE2b-256 |
4d46ef3bc6dac0415ac879243f54d73b5202d9c33483a83341e2739d615c3010
|
Provenance
The following attestation bundles were made for oncofind-0.1.0.tar.gz:
Publisher:
publish.yml on sanjeevi0078/oncofind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oncofind-0.1.0.tar.gz -
Subject digest:
e14c57795a5a61d1c2e58039ef7a669cf4185901a4a8e2d47d44edd7c1343edc - Sigstore transparency entry: 1702678584
- Sigstore integration time:
-
Permalink:
sanjeevi0078/oncofind@530d0b6241494da752e2657a008aa4a9a1521e92 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sanjeevi0078
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@530d0b6241494da752e2657a008aa4a9a1521e92 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oncofind-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oncofind-0.1.0-py3-none-any.whl
- Upload date:
- Size: 84.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7159f58c9e1cba4bddefebe9e0e12e276effcf4dcecfa93119e66f3a09750d26
|
|
| MD5 |
8d481dbc6176175e04c0e3ce86bc470d
|
|
| BLAKE2b-256 |
69dbb606fdc8bc195cc2e9127f83230665255c3278084d5a4a4f36146281647b
|
Provenance
The following attestation bundles were made for oncofind-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on sanjeevi0078/oncofind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oncofind-0.1.0-py3-none-any.whl -
Subject digest:
7159f58c9e1cba4bddefebe9e0e12e276effcf4dcecfa93119e66f3a09750d26 - Sigstore transparency entry: 1702678630
- Sigstore integration time:
-
Permalink:
sanjeevi0078/oncofind@530d0b6241494da752e2657a008aa4a9a1521e92 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sanjeevi0078
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@530d0b6241494da752e2657a008aa4a9a1521e92 -
Trigger Event:
push
-
Statement type: