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

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.2
File Size Uploaded
methplotlib-0.23.2.tar.gz 27.2 kB Details

Built distribution (wheel)

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

Total release size: 56.0 kB

Release files / methplotlib-0.23.2.tar.gz

Download URL methplotlib-0.23.2.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d6a108c8b713d7dfcfa59c690315764b683d1205da24c8798113d42622d2d81f
BLAKE2b-256 checksum
How to use checksums
cf1d05a11218b053565e169d123bc9234407e06a0aa1c1c1c465bca8cf2d126a
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 Sep 11, 2026.

Transparency log

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

Download URL methplotlib-0.23.2-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4f9d6e25219a5c7e21bb85f6e4de20a15bd4dd4249113976c67546a20633388
BLAKE2b-256 checksum
How to use checksums
4885e92a8f4f00ccf0b750ec7d3850764f31a8e2b2c683604bb3c806d10246c7
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 Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.23.2 This release

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.21.2

1 release file

0.20.1

1 release file

0.20.0

1 release file

0.19.0

1 release file

0.18.1

1 release file

0.17.0

1 release file

0.14.1

1 release file

0.14.0

1 release file

0.13.1

1 release file

0.13.0

1 release file

0.12.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.4.0

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

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