Skip to main content

rnaseq-toolkit

CI Python 3.9+ License: MIT DOI

rnaseq-toolkit is an open-source Python package that provides a unified, switchable interface for RNA-seq differential expression analysis (DEA) and pathway enrichment visualization. It automates the complete pipeline from raw count matrices through normalization, DEA, and pathway analysis to self-contained HTML reports — all with a single command or a few lines of Python.

Key Features

  • Unified normalization interface: switch between DESeq2 median-of-ratios, TMM, CPM, TPM, RPKM, VST, and rlog with one argument (--norm-method)
  • Switchable DEA methods: DESeq2 (via PyDESeq2) and edgeR-like quasi-likelihood (via statsmodels NB GLM) with identical output format
  • Pathway enrichment: pre-ranked GSEA, GO over-representation, and KEGG pathway analysis via gseapy/Enrichr
  • Publication-quality plots: volcano, MA, PCA, clustered heatmap, GSEA dotplot — all at 300 DPI
  • Automated HTML reports: self-contained reports with embedded plots and interactive tables
  • Snakemake workflow: reproducible, scalable pipeline management
  • Docker support: fully containerized for reproducibility
  • Benchmarked: validated on three public GEO datasets (Batten disease, COVID-19, breast cancer)

Installation

pip install rnaseq_toolkit

Or install from source:

git clone https://github.com/rnaseq-toolkit/rnaseq-toolkit.git
cd rnaseq-toolkit
pip install -e ".[dev]"

Quick Start

Command-line interface

# Basic DESeq2 analysis
rnaseq-toolkit \
    --counts data/counts.csv \
    --metadata data/metadata.csv \
    --design "~condition" \
    --contrast condition treated control \
    --output results/

# Switch to edgeR-like with TMM normalization — one argument change
rnaseq-toolkit \
    --counts data/counts.csv \
    --metadata data/metadata.csv \
    --design "~condition" \
    --norm-method tmm \
    --dea-method edger \
    --output results_edger/

Python API

from rnaseq_toolkit import RNAseqPipeline

# Initialize pipeline
pipe = RNAseqPipeline(
    counts_path="data/counts.csv",
    metadata_path="data/metadata.csv",
    design="~condition",
    output_dir="results/",
)

# Run complete pipeline with DESeq2
pipe.run(
    norm_method="deseq2",
    dea_method="deseq2",
    contrast=["condition", "treated", "control"],
    gene_sets=["KEGG_2021_Human", "GO_Biological_Process_2021"],
)

# Switch to edgeR-like with TMM — one line change
pipe.run(norm_method="tmm", dea_method="edger")

Individual modules

from rnaseq_toolkit import normalize_counts, run_deseq2, plot_volcano
import pandas as pd

counts = pd.read_csv("data/counts.csv", index_col=0)
meta   = pd.read_csv("data/metadata.csv", index_col=0)

# Normalize
norm = normalize_counts(counts, method="deseq2", metadata=meta, design="~condition")

# DEA
results = run_deseq2(counts, meta, "~condition",
                     contrast=["condition", "treated", "control"])

# Visualize
plot_volcano(results, output_path="results/volcano.png")

Input Format

Count matrix (counts.csv): genes as rows, samples as columns.

gene_id,Sample_01,Sample_02,Sample_03,Sample_04,Sample_05,Sample_06
ENSG00000000003,1234,1456,1123,2345,2567,2234
ENSG00000000005,456,512,489,234,198,267
...

Metadata (metadata.csv): samples as rows, variables as columns.

sample_id,condition,batch
Sample_01,control,A
Sample_02,control,A
Sample_03,control,B
Sample_04,treated,A
Sample_05,treated,A
Sample_06,treated,B

Normalization Methods

Method Description Use case
deseq2 Median-of-ratios (DESeq2) Default; DEA with PyDESeq2
tmm Trimmed Mean of M-values (edgeR) DEA with edgeR-like
cpm Counts Per Million Quick exploration
tpm Transcripts Per Million (needs gene lengths) Cross-sample comparison
rpkm RPKM (needs gene lengths) Legacy compatibility
vst Variance Stabilizing Transformation PCA, heatmaps, clustering
rlog Regularized log (approximate) Small sample sizes

Snakemake Workflow

# Edit workflow/config.yaml, then run:
snakemake --cores 4 --configfile workflow/config.yaml

Docker

docker build -t rnaseq-toolkit:0.1.0 .

docker run --rm \
    -v $(pwd)/data:/workspace/data \
    -v $(pwd)/results:/workspace/results \
    rnaseq-toolkit:0.1.0 \
    --counts data/counts.csv \
    --metadata data/metadata.csv \
    --design "~condition" \
    --contrast condition treated control \
    --output results/

Benchmark

rnaseq-toolkit was benchmarked against standalone DESeq2 and edgeR-like implementations on three public GEO datasets:

Dataset Disease / Condition GEO Accession Samples
Batten CLN2 (rare disease) GSE210143 12
COVID-19 SARS-CoV-2 infection GSE157103 126
Breast Ca TNBC vs. luminal GSE183947 60

Results demonstrate high concordance (Pearson r > 0.95 for log2FC) between rnaseq-toolkit and standalone tools, with significantly reduced setup time.

Citation

If you use rnaseq-toolkit in your research, please cite:

@software{rnaseq_toolkit_2026,
  title   = {rnaseq-toolkit: Streamlined Differential Expression Analysis
             and Pathway Enrichment Visualization from RNA-seq Data},
  version = {0.1.0},
  year    = {2026},
  url     = {https://github.com/rnaseq-toolkit/rnaseq-toolkit},
  license = {MIT}
}

See also CITATION.cff for full citation metadata.

Dependencies

License

MIT License — see LICENSE.

Metadata

Release files for rnaseq-toolkit 0.1.0

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

Source distribution (sdist)

Source distribution for rnaseq-toolkit 0.1.0
File Size Uploaded Provenance Actions
rnaseq_toolkit-0.1.0.tar.gz 27.3 kB Without provenance Details for rnaseq_toolkit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rnaseq-toolkit 0.1.0
File Interpreter ABI Platform Actions
rnaseq_toolkit-0.1.0-py3-none-any.whl Python 3 none any Details for rnaseq_toolkit-0.1.0-py3-none-any.whl

Total release size: 53.5 kB

Release files / rnaseq_toolkit-0.1.0.tar.gz

Download URL rnaseq_toolkit-0.1.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
14c2542fa818de71268285624bab46542812f6b69e25e2df7fec95a412c1a4b4
BLAKE2b-256 checksum
How to use checksums
748a41475a3b61a3a5da3671d5300201396de839a5fb5fb4f32eaa5abfa7676f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / rnaseq_toolkit-0.1.0-py3-none-any.whl

Download URL rnaseq_toolkit-0.1.0-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
610a0583045c090a908c596ff608b13c60659c68a5591ad9a9ae694e76d84e55
BLAKE2b-256 checksum
How to use checksums
5658b553e048130ecb884cfb08957dd11eaf2824ea1decd544c72564f1678cb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Security for rnaseq-toolkit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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