Skip to main content
PyPI version Documentation Status Build Status Python Version License

A python command-line utility for the generation of comprehensive reports on the quality of ribosome profiling (Ribo-Seq) datasets

Installation

To install RiboMetric:

$ pip install RiboMetric

For PDF export support (adds ~30 dependencies):

$ pip install RiboMetric[pdf]

Usage

Create annotation files from gff files:

$ RiboMetric prepare -g gff_file.gff

Use the annotation file to run RiboMetric on a bam file:

$ RiboMetric run -b bam_file.bam -a annotation_RiboMetric.tsv

View results interactively in your terminal:

$ RiboMetric view output_RiboMetric_data.json

By default, RiboMetric calculates standard Ribo-Seq QC metrics. To enable optional (theoretical) metrics:

$ RiboMetric run -b bam_file.bam -a annotation_RiboMetric.tsv --enable-optional-metrics

Or enable specific metrics:

$ RiboMetric run -b bam_file.bam -a annotation_RiboMetric.tsv --enable-metric periodicity_fourier

For more information on how to use RiboMetric, see the documentation or use --help

Improved outputs for pipelines and review:

# One-line summary, QC status, comparison, and detailed metrics
$ RiboMetric run -b bam.bam -a annotation.tsv --improved-outputs

Or pick specific ones:

$ RiboMetric run -b bam.bam -a annotation.tsv \
    --summary-tsv --qc-status --comparison-csv --metrics-table

Gate a pipeline on QC thresholds (exits 0/1/2 for PASS/WARN/FAIL):

$ RiboMetric evaluate -i sample_RiboMetric_data.json -e thresholds.yml

The thresholds YAML lists per-metric pass and warn values:

thresholds:
  periodicity_dominance: {pass: 0.7, warn: 0.5}
  prop_reads_CDS:        {pass: 0.7, warn: 0.5}

If -e is omitted, built-in defaults are used. Use -o to save the evaluation as JSON. Accepts either a RiboMetric JSON or a metrics-table CSV.

Most RiboMetric metrics are normalised so that higher is better (e.g. periodicity_dominance, uniformity_entropy, prop_reads_CDS). A few are lower is better — duplicate_rate, multimapper_rate, soft_clip_rate_5prime, disome_proportion, stop_codon_readthrough_ratio and the raw terminal-bias divergences. evaluate knows these directions, so a high duplicate rate fails rather than passes. To force a direction for a custom metric, add direction: lower (or higher) alongside its pass/warn values in the thresholds YAML:

thresholds:
  duplicate_rate: {pass: 0.3, warn: 0.5, direction: lower}

Enable the RUST metric (requires a transcriptome FASTA, gzip supported):

$ RiboMetric run -b sample.bam -a annotation.tsv \
    -f transcriptome.fa.gz \
    --enable-metric rust_mean_kl_divergence

For BAMs with no stored sequences, skip sequence-based metrics to avoid errors:

$ RiboMetric run -b no_seq.bam -a annotation.tsv --skip-sequence-metrics

Control multimapper handling for STAR transcriptome alignments:

# Default: frame calculations use only uniquely-mapped reads (MAPQ=255)
$ RiboMetric run -b star.bam -a annotation.tsv --multimap-filter unique_only
# Pre-1.1 behaviour: use all primary reads
$ RiboMetric run -b star.bam -a annotation.tsv --multimap-filter none

Features

RiboMetric calculates comprehensive quality metrics for Ribo-Seq data:

Default Metrics (Standard Ribo-Seq QC):
  • Read length distribution (IQR, CV, max proportion, bimodality)

  • Terminal nucleotide bias (5′ and 3′ ligation bias detection)

  • 3-nt periodicity (frame dominance and information content)

  • Metagene uniformity (entropy-based)

  • CDS coverage and regional distribution (5′UTR, CDS, 3′UTR)

  • Alignment quality — duplicate rate, multimapper rate, 5′ soft-clip rate

  • Di-some detection — bimodality coefficient + disome proportion (50–70 nt reads)

  • Codon-level translation — stop-codon readthrough ratio, start-codon enrichment ratio

  • Recommended read lengths — which lengths carry clean 3-nt periodicity (and their P-site offsets) for downstream ORF/P-site analysis; tune with --min-periodicity

  • Gene-body coverage ramp — 5′→3′ A-site density across relative CDS position (translation ramp / 3′ drop-off)

  • Library complexity — analytic saturation curve (“was this sequenced deeply enough?”)

  • Library-type classification — elongation / initiation / low-quality call with supporting evidence

  • FLOSS read-length heterogeneity — fraction of transcripts with aberrant footprint-length profiles (library homogeneity QC)

FASTA-dependent (computed automatically when ``–fasta`` is supplied):
  • A-site codon dwell-times / pause sites — per-codon occupancy and pausing summary (proline, CGA)

Optional Metrics (require explicit ``–enable-metric``):
  • RUST mean KL divergence — codon-specific A-site accumulation (requires --fasta)

  • Alternative periodicity methods (autocorrelation, Fourier transform, Trips-Viz)

  • Alternative uniformity methods (autocorrelation, Theil index, Gini index)

  • Additional read length metrics (normality test)

Use --enable-optional-metrics to calculate all optional metrics, or --enable-metric <name> for specific ones.

Output Formats

RiboMetric provides multiple output formats for different use cases:

For Pipeline Integration:
  • Summary TSV - One-line summary per sample for quick QC decisions

  • QC Status JSON - Machine-readable pass/warn/fail with thresholds

  • Comparison CSV - Wide format for multi-sample comparison

For Sample Review:
  • Interactive TUI - Terminal-based viewer for exploring metrics (RiboMetric view)

  • Interactive HTML - Professional reports with executive summary and searchable metrics

  • PDF - Archivable reports for documentation

  • Metrics Table CSV - Detailed metrics with read-length breakdowns

See REPORTING_GUIDE.md for complete documentation and examples.

Deprecated metric keys

RiboMetric now publishes both consolidated and legacy metric names to ease upgrades:

  • Consolidated: terminal_bias_kl_5prime, terminal_bias_kl_3prime, terminal_bias_maxabs_5prime, terminal_bias_maxabs_3prime, cds_coverage

  • Legacy: terminal_nucleotide_bias_distribution_5_prime_metric, terminal_nucleotide_bias_distribution_3_prime_metric, terminal_nucleotide_bias_max_absolute_metric_5_prime_metric, terminal_nucleotide_bias_max_absolute_metric_3_prime_metric, CDS_coverage_metric

Plots and summary normalization accept both. We recommend migrating dashboards and downstream code to the consolidated names.

Requirements

  • Transcriptomic alignments in coordinate-sorted BAM format

  • GFF3/GTF annotations (Ensembl recommended)

  • samtools >= 1.10 available on PATH (used for idxstats and indexing)

Testing

RiboMetric has a comprehensive test suite. The quickest way to run it is via pixi (all dependencies, including test extras, are resolved automatically):

$ pixi run test

Or with a standard virtual environment:

$ pip install -e ".[dev]"
$ pytest

Credits

This project was worked on by Lukas Wierdsma during his Internship at the UCC for Bioinformatics, Howest in 2023.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Metadata

Release files for ribometric 1.2.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 ribometric 1.2.0
File Size Uploaded
ribometric-1.2.0.tar.gz 34.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ribometric 1.2.0
File Interpreter ABI Platform
ribometric-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 MB

Release files / ribometric-1.2.0.tar.gz

Download URL ribometric-1.2.0.tar.gz
Size 34.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b0e88c9b7a971820272d5144a4644ecf4c13fabbe9d1c9e5dad56c0aa2a5633d
BLAKE2b-256 checksum
How to use checksums
45f9fd376ebeecaed2a82910c8e06e5142f83873230c9f4217c371f0aaba38d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 6, 2026.

Transparency log

Release files / ribometric-1.2.0-py3-none-any.whl

Download URL ribometric-1.2.0-py3-none-any.whl
Size 101.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfe5d0e7b70cfdfe6920ef6285631b041ef6c465000a0d468e32acc4caf071a3
BLAKE2b-256 checksum
How to use checksums
9ae104a348410fbedb5e7822af18f32b1a51adf946e83b1e0090f94e076b0afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 6, 2026.

Transparency log

Release history Release notifications | RSS feed

1.5.1

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.0 This release

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

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