Skip to main content

mTRplotter

PyPI

mTRplotter turns the read-length plotting logic from the notebook into a small Python CLI.

Each run also writes params.json and log.out alongside the figure and TSV outputs so the command parameters and progress logs stay with the generated results.

Installation

pip install mtrplotter

It expects a tab-delimited sample table with at least:

  • sample
  • medaka_folder
  • software (medaka or trgt)
  • flank_bp
  • any number of extra metadata columns

If --output-dir is omitted, mTRplotter writes all outputs to the current working directory.

For each requested locus, it:

  • validates medaka rows against each sample's ref_chunks.fasta
  • validates TRGT rows against each sample's .trgt.vcf.gz
  • extracts medaka reads from trimmed_reads_to_poa.bam through the BAM index
  • extracts TRGT reads from .trgt.spanning.bam
  • extracts read lengths for the requested locus or BED subset
  • writes per-read and summary tables
  • produces one figure per locus with samples on the x-axis and trimmed read length on the y-axis

Usage

Single locus:

python -m mtrplotter \
  --sample-table examples/samples.tsv \
  --region chr1:99682978-99683197 \
  --label-columns tissue_name tech core technology \
  --jobs 10

BED input:

python -m mtrplotter \
  --sample-table samples.tsv \
  --bed regions.bed \
  --output-dir results \
  --catalog-bed catalog.bed

If --catalog-bed is not provided, loci are still checked against each sample's ref_chunks.fasta, which reflects the regions actually used by the medaka run.

Metadata should already be present in the sample table. There is no separate manifest join step at runtime.

The bundled example table keeps inline columns such as tissue, tissue_name, tech, core, and technology so plotting labels can be chosen directly from the sample table.

For medaka rows, the plotted length is raw_length - 2 * flank_bp, where flank_bp comes from the sample table.

For TRGT rows, the software looks for the FL BAM tag and uses raw_length - left_flank - right_flank. If the FL tag is absent, it falls back to the sample-table flank_bp.

For TRGT rows, use the medaka_folder column as a generic input path. The most reliable form is a per-sample TRGT prefix such as:

sample	medaka_folder	software	flank_bp
SAMPLE001	/path/to/trgt/SAMPLE001	trgt	50

mTRplotter resolves the sibling files:

  • .trgt.vcf.gz
  • .trgt.spanning.bam

Metadata

Release files for mtrplotter 0.1.1

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

Source distribution (sdist)

Source distribution for mtrplotter 0.1.1
File Size Uploaded
mtrplotter-0.1.1.tar.gz 16.7 kB Details

Built distribution (wheel)

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

Total release size: 30.3 kB

Release files / mtrplotter-0.1.1.tar.gz

Download URL mtrplotter-0.1.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e0a27f59e708ab46357f2e7d19b4e74842ad777d5e0d7848e6458105087443b0
BLAKE2b-256 checksum
How to use checksums
aa527bbdccb46e67094a543445fbb74d2e710e0b1dd50169949cd4abfb008c49
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 Apr 14, 2026.

Transparency log

Release files / mtrplotter-0.1.1-py3-none-any.whl

Download URL mtrplotter-0.1.1-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47275d2363610a6bf0389da73bda61a342d94d9c6c464e0efc1af4488c18a639
BLAKE2b-256 checksum
How to use checksums
293e087872d84c9b6d534fd2dfa79e618c3de62864169ee4ea3314a94710ec6a
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 Apr 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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