plotCpg | R Documentation |
Plot single-position (single CpG) methylation values as a function of a categorical or continuous phenotype
plotCpg(dat, cpg, pheno, type = c("categorical", "continuous"),
measure = c("beta", "M"), ylim = NULL, ylab = NULL, xlab = "",
fitLine = TRUE, mainPrefix = NULL, mainSuffix = NULL)
dat |
An |
cpg |
A character vector of the CpG position identifiers to be plotted. |
pheno |
A vector of phenotype values. |
type |
Is the phenotype categorical or continuous? |
measure |
Should Beta values or log-ratios (M) be plotted? |
ylim |
y-axis limits. |
ylab |
y-axis label. |
xlab |
x-axis label. |
fitLine |
Fit a least-squares best fit line when using a continuous phenotype. |
mainPrefix |
Text to prepend to the CpG name in the plot main title. |
mainSuffix |
Text to append to the CpG name in the plot main title. |
This function plots methylation values (Betas or log-ratios) at individual CpG loci as a function of a phenotype.
No return value. Plots are produced as a side-effect.
Martin Aryee aryee@jhu.edu.
if (require(minfiData)) {
grp <- pData(MsetEx)$Sample_Group
cpgs <- c("cg00050873", "cg00212031", "cg26684946", "cg00128718")
par(mfrow=c(2,2))
plotCpg(MsetEx, cpg=cpgs, pheno=grp, type="categorical")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.