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 LEPR reference 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 reference 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.20672051) 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.1.tar.gz (21.3 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.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: isoform_dominance-2.1.1.tar.gz
  • Upload date:
  • Size: 21.3 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.1.tar.gz
Algorithm Hash digest
SHA256 eef425efd644b831f1f2ec9512070fc79d9194d85a9edecca06b01630fac63f0
MD5 04a830d8c90ce0ba51f090fd6ecda9e6
BLAKE2b-256 b1325df67ff0e6da6418728cbaa926015e592b991b2d5b52101fa963c65a8ed0

See more details on using hashes here.

Provenance

The following attestation bundles were made for isoform_dominance-2.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for isoform_dominance-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8bcf5cb8e0fdd341569fe673513d2ee540cb9055289c84f18ed5e9a4e97a2468
MD5 cf602ff7aed4bb7a07f8156cf5c1f294
BLAKE2b-256 078fa502d0e626945028334fb83c3263882e179d19aa4ff3ea8bd10996e2b38c

See more details on using hashes here.

Provenance

The following attestation bundles were made for isoform_dominance-2.1.1-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