Parse a modkit pileup BED file into a tidy per-site data frame
Source:R/parse_modkit.R
dot-parseModkit.RdReads a single-sample modkit pileup output file and returns a tidy
data frame of per-site methylation values. This is an internal function
called by commaData.
Arguments
- file
Character string. Path to the modkit pileup BED file.
- sample_name
Character string. Name for this sample (used in messages only; not added to the returned data frame).
- mod_type
Character vector or
NULL. If provided, only sites with a matching modification type (e.g.,"6mA","5mC","4mC") are returned.NULLretains all modification types.- min_coverage
Integer. Minimum read depth required to retain a site. Sites with
coverage < min_coverageare dropped. Default5.
Value
A data.frame with columns:
chromChromosome name (character).
position1-based genomic position (integer).
strandStrand,
"+"or"-"(character).mod_typeModification type:
"6mA","5mC", or"4mC"(character).betaProportion of reads called methylated, range 0–1 (numeric).
coverageTotal read depth at this site (integer).