Skip to contents

DNA methylation from VCF and gVCF, by genomic region.

methylVCF reads 5mC measurements reported by Illumina DRAGEN 5-Base and Rastair. Work with individual measurements as GRanges, or assemble reference methylation across samples in a RangedSummarizedExperiment.

Installation

Requires R 4.6 or later.

Development version

Install from GitHub with pak.

pak::pak("xec-cm/methylVCF")

Bioconductor

This installation will be available once methylVCF is published on Bioconductor.

BiocManager::install("methylVCF")

Quick start

The examples use plyranges for genomic ranges and tidySummarizedExperiment for site-by-sample tables. Install the companions to run the tutorials.

BiocManager::install(c("plyranges", "tidySummarizedExperiment"))

Use inspectMethylVcf() to check sample names, methylation fields and index readability before a regional query.

Build a one-base interval with plyranges and read the reported measurements from a bundled DRAGEN gVCF.

library(methylVCF)

vcf <- system.file("extdata", "dragen-multisample.g.vcf", package = "methylVCF")
site <-
    tibble::tibble(seqnames = "chr21", start = 13204474L, width = 1L) |>
    plyranges::as_granges()

readMethylVcf(vcf, site) |>
    tibble::as_tibble() |>
    dplyr::select(seqnames, start, sample, fraction, informative_depth)
#> # A tibble: 2 × 5
#>   seqnames    start sample   fraction informative_depth
#>   <fct>       <int> <chr>       <dbl>             <int>
#> 1 chr21    13204474 sample_a    0.238                21
#> 2 chr21    13204474 sample_b    0                     0

Use plyranges::join_overlap_inner() to annotate calls with genomic features. For aligned reference measurements, pass the original ranges to asMethylExperiment(). The experiment keeps reported values and coverage-backed fractions in separate assays.

Articles

Community