Expand description
Closed-form per-CpG population-fraction bedGraph writer derived from a
per-haplotype methylation bitmap; no simulated reads required.
Population-fraction methylation bedGraph in MethylDackel extract format.
Derived closed-form from the per-haplotype methylation bitmap — no
simulated reads. For each reference CpG, aggregates over
(haplotype × strand) presence/absence and emits
rate = round(100 * n_methylated / (n_methylated + n_unmethylated))
as an integer percentage (matching MethylDackel extract).
This is intentionally distinct from simulate’s --cpg-truth-bedgraph,
which is coverage-weighted (depends on simulated read counts).
Functions§
- write_
bedgraph - Write a complete population-fraction bedGraph — header line followed by
per-CpG records for every contig in
per_contig. - write_
bedgraph_ header - Write the
trackheader line for a MethylDackel-format population-fraction bedGraph. - write_
bedgraph_ records - Write per-CpG bedGraph records for a single contig, without the track header line.