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

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.0
File Size Uploaded
methplotlib-0.23.0.tar.gz 26.8 kB Details

Built distribution (wheel)

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

Total release size: 55.3 kB

Release files / methplotlib-0.23.0.tar.gz

Download URL methplotlib-0.23.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0798c002146dfce1a71e81460ececba38c1a6c37a2bbf6c3bfbef42d80672941
BLAKE2b-256 checksum
How to use checksums
1dc4b3aa78d37b28081db835082d1c595fd0a69cf3bfe2aa4d172a46b428978e
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

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

Download URL methplotlib-0.23.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64f0188f55ee0b63d57f92b36016e17f6e006c07168debf8e12db60824d3ae67
BLAKE2b-256 checksum
How to use checksums
bf4497ae87884ff6a13ae93158859095348df77e86251fc1285ac9225d537cb3
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

Release history Release notifications | RSS feed

0.23.2

2 release files

0.23.1

2 release files

This release

0.23.0 This release

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