Skip to main content

Anaconda-Server Badge Anaconda-Server Badge

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.3

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

Source distribution (sdist)

Source distribution for methplotlib 0.23.3
File Size Uploaded Provenance Actions
methplotlib-0.23.3.tar.gz 28.5 kB With provenance Details for methplotlib-0.23.3.tar.gz

Built distribution (wheel)

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

Total release size: 57.6 kB

Release files / methplotlib-0.23.3.tar.gz

Download URL methplotlib-0.23.3.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a8cf33aa582f1d04fa52099d3074397ff123e8a1c296221c870686d6b4952157
BLAKE2b-256 checksum
How to use checksums
1ebdae22fd5a1c3893e9fc284bfafb3c7c7dcb354af119f719d7cd91936609d5
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 Oct 19, 2026.

Transparency log

Release files / methplotlib-0.23.3-py3-none-any.whl

Download URL methplotlib-0.23.3-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a41ba3dd4de272e1de5cba26b6e62593c9593860bfe91abf226f39003d50fca6
BLAKE2b-256 checksum
How to use checksums
a0e2c494365499ae9dc9a284bd18a57376e77eb49a9ca332dd7c8f815ad2750f
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 Oct 19, 2026.

Transparency log

Security for methplotlib 0.23.3

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for methplotlib-0.23.3.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 Oct 19, 2026.

Transparency log

A 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.

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