plotCpg: Plot methylation values at an single genomic position

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot.R

Description

Plot single-position (single CpG) methylation values as a function of a categorical or continuous phenotype

Usage

1
2
3
plotCpg(dat, cpg, pheno, type = c("categorical", "continuous"),
    measure = c("beta", "M"), ylim = NULL, ylab = NULL, xlab = "",
    fitLine = TRUE, mainPrefix = NULL, mainSuffix = NULL)

Arguments

dat

An RGChannelSet, a MethylSet or a matrix. We either use the getBeta (or getM for measure="M") function to get Beta values (or M-values) (for the first two) or we assume the matrix contains Beta values (or M-values).

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.

Details

This function plots methylation values (Betas or log-ratios) at individual CpG loci as a function of a phenotype.

Value

No return value. Plots are produced as a side-effect.

Author(s)

Martin Aryee aryee@jhu.edu.

Examples

1
2
3
4
5
6
7
8
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")

}

minfi documentation built on Nov. 8, 2020, 4:53 p.m.