Skip to main content

Config-driven isoform-usage quantification and discrimination from bulk RNA-seq

Project description

isoform-dominance

CI PyPI Python License: MIT DOI

Isoform-usage quantification and discrimination from bulk RNA-seq — one config away for any gene.

Most isoform analyses stumble on two things: deciding which transcripts form a functional group, and knowing whether short reads can even tell the groups apart. isoform-dominance handles both, then quantifies and tests the comparison end-to-end:

annotate  gene symbol      → proposed isoform groups        (Ensembl, by 3' terminal exon)
identify  config           → are the groups distinguishable by short reads? (k-mer uniqueness)
extract   Salmon quant.sf  → per-donor isoform-group TPM
stats     per-donor TPM    → paired Wilcoxon, per cohort + combined, + figure
qc        marker TPM       → contamination control (is the signal a cell-type artifact?)

example output

Bundled self-test: short LEPR isoform (LepRa) predominates over the long isoform (LepRb) in control human choroid plexus across two independent cohorts; combined n = 11, P = 1×10⁻³.


Install

pip install -e ".[dev]"        # from a clone
isoform-dominance --version

Verify it works (no downloads, seconds)

isoform-dominance selftest
# or: pytest -q

reproduces the published LEPR result (5/5, 6/6, combined n=11 P=9.8e-4) on a clean machine.

What makes it more than a quantifier

1. Auto isoform grouping (annotate). Give a gene symbol; it pulls the gene's protein-coding transcripts from Ensembl, clusters them by their 3' terminal-exon splice acceptor (the alternative last exon that defines functional isoform classes), and proposes a comparison you review and rename.

isoform-dominance annotate --gene LEPR --out config.json
#   iso_896aa : 7 transcripts   (short / LepRa)
#   iso_1165aa: 2 transcripts   (long / LepRb, canonical)

2. Identifiability guardrail (identify). Short reads can only quantify an isoform group that has unique sequence. This checks per-group unique k-mers and refuses to pretend a group is measurable when it isn't.

isoform-dominance identifiability --config config.json
#   [OK] iso_896aa : 3399 unique k-mers
#   [OK] iso_1165aa: 5369 unique k-mers
#   primary_comparison distinguishable by short reads: True

Full workflow (real data)

# 0) build a decoy-aware index once (Salmon + GENCODE) — see scripts/01_salmon_quant.sbatch
# 1) quantify on an HPC cluster:
sbatch scripts/01_salmon_quant.sbatch                    # -> quant/<donor>/quant.sf
# 2) extract per cohort:
isoform-dominance extract --config config.json --quantdir quant \
    --samplemap example/sample_map_GSE228458.csv --cohort GSE228458 --out perdonor_GSE228458.csv
# 3) stats + figure:
isoform-dominance stats --config config.json --condition control \
    --perdonor GSE228458=perdonor_GSE228458.csv --perdonor GSE137619=perdonor_GSE137619.csv \
    --out results/dominance
# 4) optional contamination control:
isoform-dominance qc --config config.json \
    --markers GSE228458=markers_228.csv --target GSE228458=perdonor_GSE228458.csv --out results/qc

How this relates to existing tools

Differential transcript usage (DTU) is a mature area, and for genome-wide discovery you should use the established tools — this one does not replace them:

  • DEXSeq, DRIMSeq, satuRn — genome-wide DTU testing. They assume you already have a transcript-by-sample count matrix and defined transcript groups.
  • IsoformSwitchAnalyzeR — rich functional annotation of isoform switches (domains, NMD, coding potential) in R/Bioconductor; grouping and import are configured by the analyst.
  • fishpond / swish — rigorously propagates quantification uncertainty using Salmon inferential replicates.

isoform-dominance targets a narrower, common question: for one gene, which functional isoform class predominates? Its specific contributions are (1) going from a gene symbol straight to a reviewed isoform-group proposal, (2) an explicit, machine-checkable identifiability guardrail that refuses to report a comparison short reads cannot resolve, and (3) a scriptable Python CLI with a download-free self-test meant to ship alongside a manuscript. Group proposals are presented for review, not treated as final.

More documentation: a step-by-step NTRK2 walkthrough, a gallery of further example genes (NTRK2/NTRK3 kinase truncations and the FLT1 soluble-decoy receptor, all verified short-read separable), and an API reference.

Statistical notes

  • Donor-level two-sided exact Wilcoxon signed-rank (scipy.stats.wilcoxon), per cohort + combined.
  • Small-n floor: n = 5 cannot reach P < 0.05 in the exact two-sided test (floor 0.0625); report exact P + direction (e.g. 5/5) and combine concordant cohorts for the summary statistic.
  • Effect size = median fold-change, reported alongside significance.

Layout

src/isoform_dominance/   annotate · identifiability · extract · stats · contamination · cli · _selftest
tests/                   pytest (offline; reproduces the published result + unit tests)
scripts/01_salmon_quant.sbatch
example/                 config + sample maps
.github/workflows/ci.yml docs/  pyproject.toml  CITATION.cff  LICENSE

Citation

Cite this repository (see CITATION.cff, DOI 10.5281/zenodo.20692725) and Salmon: Patro, R. et al. Nat. Methods 14, 417–419 (2017). https://doi.org/10.1038/nmeth.4197

License

MIT (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isoform_dominance-2.1.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isoform_dominance-2.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file isoform_dominance-2.1.0.tar.gz.

File metadata

  • Download URL: isoform_dominance-2.1.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for isoform_dominance-2.1.0.tar.gz
Algorithm Hash digest
SHA256 6d4539fc09f41a7f87e8c1a9671bf29101e0833495ad0303b8e9db0531613923
MD5 2dd2163808001a6f8c206e4f2fb23ed8
BLAKE2b-256 8849bd355e7d2b99bc9778d63acd9e3ad2c2fcbd188f09c8408f55cc4bbc524b

See more details on using hashes here.

Provenance

The following attestation bundles were made for isoform_dominance-2.1.0.tar.gz:

Publisher: publish.yml on charliekim97/isoform-dominance-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file isoform_dominance-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for isoform_dominance-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2626d549645ba4bc9831d845945e35ac3063040e41dfd52e8b3cc20a2a61ac60
MD5 0c0ce68d5d8b444b8e63f574a0e59a37
BLAKE2b-256 39c7c150bdc0146b811c39851d7c6d807f08bf16617f77cbc46e83e8962d1573

See more details on using hashes here.

Provenance

The following attestation bundles were made for isoform_dominance-2.1.0-py3-none-any.whl:

Publisher: publish.yml on charliekim97/isoform-dominance-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page