Description Usage Arguments Value Author(s) Examples
View source: R/cpgs_within_region.R
Produces a dotplot of a specific (region of) CpG(s) given a matrix of beta-values superposed onto the RefSeq genomic location.
1 | cpgs_within_region(chr, annotation.gr, start_region, end_region)
|
chr |
Chromosome (example "chr6") |
annotation.gr |
GenomicRanges object containing the annotation/features of the GMset (obtained through minfi::getAnnotation()) |
start_region |
The start of the region you want to plot |
end_region |
The end of the region you want to plot. If the region is only 1 bp, simply enter the same value as the start_dmr |
A region of CpG(s) within the range of interest
Andrew Y.F. Li Yim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #Load data
require(minfiData)
baseDir <- system.file("extdata", package = "minfiData")
targets <- read.450k.sheet(base = baseDir)
RGset <- read.450k.exp(targets = targets, recursive = T)
Mset <- preprocessIllumina(rgSet = RGset, bg.correct = T, normalize = "controls", reference = 2)
Rset <- ratioConvert(Mset)
GMset <- mapToGenome(Rset)
Beta <- getBeta(GMset)
annotation.gr <- makeGRangesFromDataFrame(getAnnotation(GMset), keep.extra.columns = T, start.field = "pos", end.field = "pos")
#Find DMRs
design <- model.matrix(~pData(Mset)$Sample_Group)
bumps <- bumphunter(object = GMset, design = design, coef = 2, cutoff = 0.2, B = 0, type = "Beta")
dmr <- bumps$table[1,]
#Find DMPs within DMRs
cpg_within_region(chr = "chr6", annotation.gr = annotation.gr, start_dmr = dmr$start, end_dmr = dmr$start)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.