plotCpg {minfi} | R Documentation

## Plot methylation values at an single genomic position

### Description

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

### Usage

    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

    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")

    }

[Package minfi version 1.28.4 Index]