Skip to content

Fu-Yilei/methylplotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 markecr lines
  • Auto-detects methylation percent column per file by platform, with manual override

Installation

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

About

plot methylation from haplotype phased BED files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages