Plot medaka trimmed-read length distributions across samples for target loci.
Project description
mTRplotter
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:
samplemedaka_foldersoftware(medakaortrgt)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.bamthrough 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mtrplotter-0.1.1.tar.gz.
File metadata
- Download URL: mtrplotter-0.1.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0a27f59e708ab46357f2e7d19b4e74842ad777d5e0d7848e6458105087443b0
|
|
| MD5 |
1cfd3ec421cc3459c7ef23bf6e61bccd
|
|
| BLAKE2b-256 |
aa527bbdccb46e67094a543445fbb74d2e710e0b1dd50169949cd4abfb008c49
|
Provenance
The following attestation bundles were made for mtrplotter-0.1.1.tar.gz:
Publisher:
publish.yml on Fu-Yilei/mTRplotter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtrplotter-0.1.1.tar.gz -
Subject digest:
e0a27f59e708ab46357f2e7d19b4e74842ad777d5e0d7848e6458105087443b0 - Sigstore transparency entry: 1298131626
- Sigstore integration time:
-
Permalink:
Fu-Yilei/mTRplotter@c1a3b58f945283acd249455466ab27b1090258dd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fu-Yilei
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1a3b58f945283acd249455466ab27b1090258dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file mtrplotter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mtrplotter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47275d2363610a6bf0389da73bda61a342d94d9c6c464e0efc1af4488c18a639
|
|
| MD5 |
c72f2e2a39fa18201fcb2dfbc9b07327
|
|
| BLAKE2b-256 |
293e087872d84c9b6d534fd2dfa79e618c3de62864169ee4ea3314a94710ec6a
|
Provenance
The following attestation bundles were made for mtrplotter-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Fu-Yilei/mTRplotter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtrplotter-0.1.1-py3-none-any.whl -
Subject digest:
47275d2363610a6bf0389da73bda61a342d94d9c6c464e0efc1af4488c18a639 - Sigstore transparency entry: 1298131728
- Sigstore integration time:
-
Permalink:
Fu-Yilei/mTRplotter@c1a3b58f945283acd249455466ab27b1090258dd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fu-Yilei
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1a3b58f945283acd249455466ab27b1090258dd -
Trigger Event:
push
-
Statement type: