getCollapsedBetas: Extract a beta matrix from a CpGannotated object.

getCollapsedBetasR Documentation

Extract a beta matrix from a CpGannotated object.

Description

Retrieves the matrix of per-CpG beta values matching the annotated loci. For EPICv2 data, these betas have been (optionally) remapped to more likely target, and collapsed to one value per CpG. See cpg.annotate for details on EPICv2 replicate filtering.

Usage

getCollapsedBetas(annot, ranges=NULL)

Arguments

annot

A CpGannotated-class object, created by cpg.annotate.

ranges

A GRanges object, over which the desired beta values are subsetted.

Details

Only applicable to CpGannotated objects that have been created by cpg.annotate; for those created by sequencing.annotate please use bsseq::getMeth.

Value

A matrix of beta values, with individual CpG coordinates as rownames.

Author(s)

Tim Peters <t.peters@garvan.org.au>

Examples

library(AnnotationHub)
ah <- AnnotationHub()
EPICv2manifest <- ah[["AH116484"]]
object <- minfi::logit2(matrix(rbeta(10000, 3, 1), 1000, 10))
rownames(object) <- sample(rownames(EPICv2manifest), 1000)
type <- rep(c("Ctrl", "Treat"), each=5)
design <- model.matrix(~type)
myannotation <- cpg.annotate("array", object, what = "M", arraytype = "EPICv2",
                             analysis.type="differential", design=design, coef=2)
getCollapsedBetas(myannotation)

timpeters82/DMRcate-devel documentation built on Oct. 2, 2024, 10:33 a.m.