Skip to main content

Plot methylation profiles from haplotype-phased BED files

Project description

methylplotter

Plot methylation from haplotype-phased BED files.

Methylation plot

What It Does

  • Parses ONT/PacBio BED-like methylation files
  • Filters records to a genomic region
  • Applies sliding-window smoothing to % modified (point-based window)
  • Draws publication-ready line plots for one or more samples
  • Annotates genes and optional vertical marker lines
  • Auto-detects methylation percent column per file by platform, with manual override

Installation

python -m pip install methylplotter

Install from the local checkout instead:

python -m pip install .

For development with tests:

python -m pip install -e '.[test]'

CLI Usage

methylplotter \
  --platform ont \
  --bed sampleA.bed --bed sampleB.bed \
  --sample sampleA --sample sampleB \
  --gene chr15:80143550-80197576:FAH \
  --region chr15:80150000-80200000 \
  --line breakpoint,80170000 \
  --window_size 20 \
  --min_points_for_smooth 3 \
  --verbose \
  --output methylation_plot

Equivalent module invocation:

python -m methylplotter --platform ont ...

Notes:

  • --window_size is a number of rows/points, not base pairs
  • By default, methylation percent column is auto-detected per input file (ont prefers index 10, pb prefers index 3)
  • Use --percent_col <index> to force one column across all input files
  • --verbose prints per-sample row counts, smoothed point counts, and the chosen percent column
  • If --output has no extension, both PNG and SVG are written

Test Data

Synthetic test data is bundled in tests/data/:

  • ont_sample_a.bed
  • ont_sample_b.bed
  • pb_sample_a.bed

These are minimal fixtures for parser/smoother/plot tests, not biological reference datasets.

Run Tests

PYTHONPATH=src pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

methylplotter-0.3.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

methylplotter-0.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file methylplotter-0.3.0.tar.gz.

File metadata

  • Download URL: methylplotter-0.3.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for methylplotter-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b8c0c5daa3ef298b6005b6f84fb49bbd5df0600ea580b1d78366176ee73d56f6
MD5 0fb0c18c12d3f22590bb48894116e5bb
BLAKE2b-256 c1e5f57a35c392c79a25ca32fce39216adfc2722207ba7f6652fb606fbc296e1

See more details on using hashes here.

File details

Details for the file methylplotter-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: methylplotter-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for methylplotter-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 671fd18b7dea0eaed98dc144f4548ea7fea73100a56634837a77b8971adcef12
MD5 f67ec46162ad3dccd63fccb60362f0a5
BLAKE2b-256 b2e337c917813b585c83c83145e898f0c944213100372be5834fcd20af8b2e92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page