Bayesian RNA-seq quantification of annotated transcripts, nascent RNA and genomic DNA in one model
Overview
Rigel quantifies RNA-seq alignments while explicitly modeling three sources of signal in the same library:
- RNA from the annotated transcripts (every reference transcript, single-exon included)
- Nascent RNA: RNA that has not spliced, over the span of a multi-exon gene
- Genomic DNA contamination (gDNA)
A single-pass native BAM scan feeds a calibration stage that separates RNA from gDNA
genome-wide, and a locus-level EM then assigns the RNA to transcripts. Nascent RNA is
represented as one synthetic span per merged span — transcripts whose start and end sites each lie within
--end-tolerance on one strand — shared by every transcript in it, so isoforms that start and
end at about the same coordinates do not multiply nascent states.
Key features
- Joint quantification of annotated transcripts, nascent RNA and gDNA in one locus-level model
- Single-pass C++ BAM scanner using htslib, with memory-bounded buffering and spill-to-disk support
- Automatic strand-model training from annotated spliced fragments; protocol auto-detection (
R1-sense/R1-antisense) - gDNA/RNA calibration that solves each genomic region's unspliced mass into sense RNA, antisense RNA and gDNA, with a gDNA-density prior fitted from the library itself
- Calibrated per-locus gDNA priors feeding the EM
- MAP-EM and Variational Bayes EM (VBEM, default) solver modes with SQUAREM acceleration
- Post-EM assignment:
sample(default: whole counts, each fragment to one transcript or gDNA) orfractional(posterior weights) - Parallel BAM scanning and parallel locus EM controlled through one
--threadssetting - Feather and TSV outputs plus optional annotated BAM output with per-fragment assignment tags
Installation
Bioconda
conda install -c conda-forge -c bioconda rigel
PyPI
pip install rigel-rnaseq
# with the optional HTML QC report ('rigel report'):
pip install 'rigel-rnaseq[report]'
The PyPI package name is rigel-rnaseq because rigel is already taken on
PyPI. The import name and CLI stay rigel.
The [report] extra pulls in vl-convert-python (on conda:
conda install -c conda-forge vl-convert-python); without it rigel report still builds a
report, with every chart omitted.
From source
git clone https://github.com/mkiyer/rigel.git
cd rigel
mamba env create -f mamba_env.yaml
conda activate rigel
pip install --no-build-isolation -e .
Requirements
- Python 3.12+
- Wheels are published for Linux (x86_64 and aarch64, manylinux_2_28) and macOS 15+ on Apple silicon; anywhere
else pip builds from source, which needs a C++17-capable compiler, CMake ≥ 3.15, pkg-config and htslib
(
mamba_env.yamlinstalls all of them) - Runtime dependencies (from
pyproject.toml):pysam>=0.22,numpy>=1.26,pandas>=2.1,pyarrow>=14.0,pyyaml>=6.0,scipy>=1.12
On macOS, install Xcode Command Line Tools first:
xcode-select --install
Quick start
1. Build an index
samtools faidx genome.fa # the FASTA needs a .fai index
rigel index \
--fasta genome.fa \
--gtf annotation.gtf \
--no-mappability \
-o index/
rigel index requires either --alignable-zarr PATH (the store the companion alignable tool
builds for the same genome and aligner, whose unobservable regions Rigel reads; recommended for real
genomes) or --no-mappability to opt out explicitly, when the reference's N runs are its unobservable
regions.
2. Quantify a BAM
rigel quant \
--bam sample.bam \
--index index/ \
-o results/ \
--tsv
Input BAM requirements:
- Paired-end (the scan stops at the first unpaired record)
- Name-sorted or collated
- A read pair's multiplicity is its usable alignments;
NHis read only to find a truncated output - For a stranded library, a splice-junction strand tag:
XS(HISAT2, or STAR with--outSAMstrandField intronMotif) orts(minimap2). Without one no junction trains the strand model and the library is quantified as unstranded;--sj-strand-tag autoreads whichever tag each spliced record carries - With STAR, align with
--sjdbScore 0 --outFilterMultimapScoreRange 2, so an unspliced reading competes with an annotated splice (the manual's input requirements say why)
3. Inspect outputs
Outputs are Feather files; --tsv above also writes .tsv mirrors (or convert afterward with
rigel export results/ --format tsv).
head results/quant.tsv
head results/gene_quant.tsv
head results/nascent_quant.tsv
head results/loci.tsv
cat results/summary.json
4. Build a QC report (optional)
rigel report results/ -o results/report.html
Produces a single self-contained HTML QC file from the files rigel quant already wrote, so
reports can be built later and in bulk. Its charts need the [report] extra (see
Installation).
The five subcommands are index, quant, sim (a small synthetic scenario from a YAML
file), export (Feather to TSV or Parquet) and report. rigel --version prints the version;
rigel -v <subcommand> (--verbose) enables DEBUG-level logging. See
docs/MANUAL.md for every flag.
Output files
| File | Description |
|---|---|
quant.feather / quant.tsv |
Transcript-level abundance table (one row per annotated transcript; nascent RNA is in nascent_quant) with count, count_unambig, count_em, count_spliced, tpm, tpm_total_rna, effective lengths, and per-transcript QC columns |
gene_quant.feather / gene_quant.tsv |
Gene-level aggregates derived from transcript estimates |
nascent_quant.feather / nascent_quant.tsv |
Nascent RNA: one row per synthetic span Rigel adds to model the unspliced RNA of multi-exon transcripts (read overlapping spans per gene) |
loci.feather / loci.tsv |
Per-locus EM summary |
summary.json |
Library protocol, strand specificity, per-category fragment-length summary statistics, the calibration scalars, alignment counts, and global quantification totals |
fragment_lengths.feather |
Raw per-bin fragment-length histograms, tidy (category, length, count) |
calibration_track.feather / .bedgraph |
Per-region gDNA solution; the bedGraph is a genome-browser track (IGV / UCSC) |
config.yaml |
Resolved run configuration (parameters, I/O paths). Rerun with rigel quant --config config.yaml |
report.html |
Optional self-contained QC report, built by rigel report (see step 4) |
locus_stats.feather |
Optional per-locus statistics, emitted only with --emit-locus-stats |
--annotated-bam PATH |
Optional annotated BAM with per-fragment assignment tags (a second BAM pass); the same records as the input, collated |
tpm is normalized over annotated transcripts only; tpm_total_rna normalizes over all RNA
(annotated and nascent) and is comparable to nascent_quant's tpm_total_rna.
How it works
Rigel runs one native BAM pass feeding three stages: scan, calibrate, and quantify.
FASTA + GTF ──▶ rigel index ──▶ regions / boundaries partition + transcript tables
BAM ──▶ 1. scan C++ single pass: resolve fragments, train the strand and fragment-length
models, buffer the ambiguous fragments, tally per-region/boundary mass
──▶ 2. calibrate split each region's unspliced mass into sense RNA / antisense RNA / gDNA
(strand tilt + neighbour messages + a gDNA-density prior fitted from the
library) ──▶ two Dirichlet scalars per locus
──▶ 3. quantify per-locus EM (VBEM or MAP-EM, SQUAREM, OpenMP across loci) with one
component per transcript row plus one gDNA component ──▶ counts, TPM
A spliced fragment is certified RNA, so calibration's problem is the unspliced mass. Its answer enters the EM as a prior that a decisive locus likelihood can override. The design and its rulings are in docs/DESIGN.md; the derivations are in docs/EQUATIONS.md.
Documentation
| Document | Description |
|---|---|
| docs/MANUAL.md | The user manual: CLI reference, defaults, configuration rules, output schema |
| docs/DESIGN.md | What is built, and the rulings behind it |
| docs/EQUATIONS.md | The derivations the implementation depends on |
| docs/SUCCESS.md | How performance is measured: the accumulator, then calibration against an oracle |
| docs/TESTING.md | The benchmark panels, how to build them, and what the test suite can judge |
| docs/ROADMAP.md | The ranked view of what is next for the 0.8.0 release |
| Issues | Open problems, and what was refused (closed as not planned); the 0.8.0 milestone is what the release must fix or state |
| docs/TRAPS.md | Mistakes already made, as named rules |
| docs/PUBLISHING.md | Release workflow for PyPI and Bioconda |
Citing Rigel
If you use Rigel in research, cite the repository for now:
Iyer MK. Rigel: Bayesian RNA-seq quantification with joint mRNA, nascent RNA, and genomic DNA modeling. 2026. https://github.com/mkiyer/rigel
License
Rigel is distributed under the GNU General Public License v3.0.
Development
conda activate rigel
pip install --no-build-isolation -e ".[dev]" # rebuild after any src/rigel/native/ change
python -m pytest tests/ -q
ruff check src/ tests/ scripts/ && ruff format src/ tests/
Metadata
Release files for rigel-rnaseq 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rigel_rnaseq-0.8.2.tar.gz | 1.9 MB | With provenance | Details for rigel_rnaseq-0.8.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details for rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_x86_64.whl |
| rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details for rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_aarch64.whl |
| rigel_rnaseq-0.8.2-cp312-abi3-macosx_15_0_arm64.whl | CPython 3.12 | abi3 | macOS 15.0+ ARM64 | Details for rigel_rnaseq-0.8.2-cp312-abi3-macosx_15_0_arm64.whl |
Total release size: 10.1 MB
Release files / rigel_rnaseq-0.8.2.tar.gz
| Download URL | rigel_rnaseq-0.8.2.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd7ab9d7cdbf6f1f168df1ec12b39120d2578c21b5eb2c55ccc0fb100d66a559
|
|
BLAKE2b-256 checksum How to use checksums |
6dd97caae32d913d061f0ee69b57260b9aec11b0761f0b987bc68fa6e5d4050b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
94bf5735a1fa4f6e66a3b5b5ba2895107972cff934e029a2d0154538b57c353f
|
|
BLAKE2b-256 checksum How to use checksums |
e32ebc34d45d4140adaf70b53463b344d2e7263668c40905cc5be98102ece0df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | rigel_rnaseq-0.8.2-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a618abb00c6d9ed8e3da8b60ecad46005649c91be4137edea89c9539b0f390a9
|
|
BLAKE2b-256 checksum How to use checksums |
c61c0a5dd89a5e811431474e24ed29c5c2585bc726caca20b6c4ade50bfff578
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / rigel_rnaseq-0.8.2-cp312-abi3-macosx_15_0_arm64.whl
| Download URL | rigel_rnaseq-0.8.2-cp312-abi3-macosx_15_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 abi3 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2d5ed9775ad6cd3df211c74ed16c312e7182fc16e2714ceef8471424d5a73bd6
|
|
BLAKE2b-256 checksum How to use checksums |
42a47c1fbefde0ae4d7c974e68dd4144ff456d848cd9fced955fa4ed6e01ddee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for rigel-rnaseq 0.8.2
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for rigel_rnaseq-0.8.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA 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.