Description Usage Arguments Details Value See Also Examples
gene.plot
returns a plot of β-values for a particular genomic region
and optionally according to a grouping variable for the samples
1 2 |
fSub |
A data.frame of CpG site 450K annotation. |
betas |
A matrix of beta-values containing all CpG sites contained in fSub. |
pheno |
A data.frame of phenotypes with rows in same order as columns of betas. |
groupVar |
(optional) Character value corresponding to a column of pheno, indicating grouping variable with which to color points in the plot. |
gene.fld, cpg.fld, pos.fld, chr.fld |
Character values for names of fSub denoting, respectively: gene symbol/gene name, CpG identifier, genomic position (b.p.) and chromosome. |
To add: gene names and genomic locations (e.g. 5'UTR, Body, etc.)
This function should be called by gg.DMR.plot()
A ggplot
object for the plot of interest
1 2 3 4 5 6 7 8 9 10 11 12 13 | f <- data.frame(GeneSymbol = c(rep('', 2), rep('BLAH', 3), rep('', 1)),
cpgSite = paste0('cg0000', 1:6),
pos = 17500000 + c(1, 147, 1458, 1500, 2157, 2699),
chr = 'chr19')
p <- data.frame(ID = paste0('S', 1:10), Group = rep(LETTERS[1:2], each = 5))
set.seed(123)
means <- c(2.5, 2, 3, 3, 0, -1, 0, -1.2, 0.2, -1, 0.5, -0.5)
SD <- c(0.5, 0.5, 0.7, 0.8, 1, 0.5)
mvals <- matrix(rnorm(60, rep(means, each = 5), rep(SD, each = 10)), ncol = 6,
dimnames = list(p$ID, f$cpgSite))
b <- t(2^mvals/(1+2^mvals))
gene.plot(fSub = f, betas = b, pheno = p, groupVar = 'Group')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.