METHPLOTLIB
This script generates a browser view on a window using data from
i) nanopolish, either as methylation calls or methylation frequencies (as processed by calculate_methylation_frequency.py). The methylation calls can additionally be phased using scripts/annotate_calls_by_phase.py and scripts/split_calls_by_phase.py
ii) nanocompore
iii) in ont-cram format with MM/ML tags according to the SAM specifications
iv) in bedgraph format, with 4 columns (chromosome, start, end, value) or the 5 columns written by modkit pileup --bedgraph
v) in bedMethyl format, as written by modkit pileup (18 columns, with or without --only-tabs) or by modbam2bed --extended (14 columns). Files containing multiple modifications (e.g. 5mC and 5hmC) do not have to be split up: each modification gets its own track, and --mods can be used to restrict to some of them
INSTALLATION
Creating a new conda environment:
conda create -n methplotlib methplotlib
Or using pip:
pip install methplotlib
USAGE
methplotlib [-h] [-v] -m METHYLATION [METHYLATION ...] -n NAMES
[NAMES ...] -w WINDOW [-g GTF] [-b BED] [-f FASTA]
[--simplify] [--split] [--static STATIC] [--smooth SMOOTH]
[--dotsize DOTSIZE] [--example] [-o OUTFILE] [-q QCFILE]
plotting nanopolish methylation calls or frequency
optional arguments:
-h, --help show this help message and exit
-v, --version Print version and exit.
-m, --methylation METHYLATION [METHYLATION ...]
data in nanopolish, nanocompore, ont-cram or bedgraph
format
-n, --names NAMES [NAMES ...]
names of datasets in --methylation
-w, --window WINDOW window (region) to which the visualisation has to be restricted
-g, --gtf GTF add annotation based on a gtf file
-b, --bed BED add annotation based on a bed file
-f, --fasta FASTA required when --window is an entire chromosome, contig or transcript
--simplify simplify annotation track to show genes rather than transcripts
--split split, rather than overlay the methylation tracks
--static Make a static image of the browser window (filename)
--binary Make the nanopolish plot ignorning log likelihood nuances
--smooth Rolling window size for averaging frequency values (int)
--dotsize Control the size of dots in the per read plots (int)
--example Show example command and exit.
-o, --outfile OUTFILE File to write results to. Default:
methylation_browser_{chr}_{start}_{end}.html. Use
{region} as a shorthand for {chr}_{start}_{end} in the
filename. Missing paths will be created.
-q, --qcfile QCFILE File to write the qc report to. Default: The path in
outfile prefixed with qc_, default is qc_report_methyl
ation_browser_{chr}_{start}_{end}.html. Use {region}
as a shorthand for {chr}_{start}_{end} in the
filename. Missing paths will be created.
Snakemake workflow
For streamlining nanopolish a Snakefile is included (using snakemake). The workflow uses a config file, of which an example is in this repository.
Example data
The examples folder contains calls and frequencies for the human ACTB gene from PromethION sequencing of NA19240. An example command is available.
Companion scripts
The scripts folder contains scripts for phasing modification calls in haplotypes based on WhatsHap phasing, allele specific modification testing for phased data and differential modification testing across subjects.
TO DO - CONTRIBUTIONS WELCOME
- Outlier detection (in windows) across samples
Metadata
Release files for methplotlib 0.23.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| methplotlib-0.23.1.tar.gz | 27.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| methplotlib-0.23.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.1 kB
Release files / methplotlib-0.23.1.tar.gz
| Download URL | methplotlib-0.23.1.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df9d7e611aa72ebe11674b74d7fe0a02330735ffa60ae3104324c47ee9474b5e
|
|
BLAKE2b-256 checksum How to use checksums |
273acdaa9e76ab56a0d82b2aac25963c8344d6ee381655aa2c29e348d27b5ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency logRelease files / methplotlib-0.23.1-py3-none-any.whl
| Download URL | methplotlib-0.23.1-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8379e19e5cc92ca285ffb8b2e205f80270eda493ed1cb051d6c0f6c4d8911b46
|
|
BLAKE2b-256 checksum How to use checksums |
a510b29c2ae05fbb2bee246732eb508f5c071aac8fe3b0613aa526de15785de9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency log