Plot methylation from haplotype-phased BED files.
- 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
python -m pip install .For development with tests:
python -m pip install -e '.[test]'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_plotEquivalent module invocation:
python -m methylplotter --platform ont ...Notes:
--window_sizeis a number of rows/points, not base pairs- By default, methylation percent column is auto-detected per input file (
ontprefers index10,pbprefers index3) - Use
--percent_col <index>to force one column across all input files --verboseprints per-sample row counts, smoothed point counts, and the chosen percent column- If
--outputhas no extension, bothPNGandSVGare written
Synthetic test data is bundled in tests/data/:
ont_sample_a.bedont_sample_b.bedpb_sample_a.bed
These are minimal fixtures for parser/smoother/plot tests, not biological reference datasets.
PYTHONPATH=src pytest