Skip to content

CMG-UA/RBedMethyl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RBedMethyl

Lifecycle: stable R-CMD-check codecov

Disk-backed access to nanoporetech modkit bedMethyl files for ONT-scale workflows.

Disclaimer

I am not affiliated with nanoporetech. This package has been tested with modkit pileup v0.6.1 and commit https://github.com/nanoporetech/modkit/tree/481e3c9e7930f3f499eadf1ef441606f33e6881c.

Installation

Bioconductor (when available)

if (!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager")
}
BiocManager::install("RBedMethyl")

From source (local checkout)

install.packages("devtools")
devtools::install(".")

Usage

library(RBedMethyl)

lines <- c(
  paste("chr1", 0, 1, "m", 0, "+", 0, 1, 0, 10, 0.5, 5, 5, 0, 0, 0, 0, 0, sep = "\t"),
  paste("chr1", 10, 11, "m", 0, "+", 10, 11, 0, 20, 0.25, 5, 15, 0, 0, 0, 0, 0, sep = "\t")
)

bed <- tempfile(fileext = ".bed")
writeLines(lines, bed)

# Show available fields
bedMethylFields()

# Read coverage and mod_reads
bm <- readBedMethyl(bed, mod = "m", fields = c("coverage", "mod_reads"))

# Per-site methylation fraction
beta(bm)

# Subset by region and summarize
regions <- GenomicRanges::GRanges(
  seqnames = "chr1",
  ranges = IRanges::IRanges(start = 1, end = 12)
)

bm_region <- subsetByRegion(bm, regions)
summarizeByRegion(bm, regions)

# Bracket subsetting with GRanges
bm[regions]

About

Bioconductor-native infrastructure for handling large nanoporetech modkit bedMethyl pileup files from ONT data using HDF5Array and DelayedArray.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages