cpgs_within_region: cpgs_within_region

Description Usage Arguments Value Author(s) Examples

View source: R/cpgs_within_region.R

Description

Produces a dotplot of a specific (region of) CpG(s) given a matrix of beta-values superposed onto the RefSeq genomic location.

Usage

1
cpgs_within_region(chr, annotation.gr, start_region, end_region)

Arguments

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

Value

A region of CpG(s) within the range of interest

Author(s)

Andrew Y.F. Li Yim

Examples

 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)

ND91/ndlib documentation built on Aug. 10, 2020, 11:59 a.m.