methPercent: Estimate percentage DNA methylation from log-ratios

Description Usage Arguments Details Value Author(s) Examples

Description

Estimate percentage DNA methylation from log-ratios

Usage

1
methPercent(m, pmIndex, ngc, commonParams = TRUE)

Arguments

m

a matrix of M-values (methylation log-ratios). One column per sample.

pmIndex

A vector of probe indices to use in the calculation. Usually set to the indices of the pm probes (excluding background and other non-specific controls) by using pmIndex=pmindex(dat)

ngc

a vector with GC-content of probes. Same length as nrow(m)

commonParams

boolean indicating whether a common set of parameters should be used for all samples when converting M-values to percentage methylation.

Details

This function estimates percentage DNA methylation from normalized methylation log-ratios (M-values).

Value

a matrix of percentage methylation estimates. Same dimensions as m

Author(s)

Martin Aryee <aryee@jhu.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
	if (require(charmData) & require(BSgenome.Hsapiens.UCSC.hg18)) {
		phenodataDir <- system.file("extdata", package="charmData")
		pd <- read.delim(file.path(phenodataDir, "phenodata.txt"))
		pd <- subset(pd, sampleID=="441_liver")
		dataDir <- system.file("data", package="charmData")
		setwd(dataDir)
		# Read in raw data
		rawData <- readCharm(files=pd$filename, sampleKey=pd)
		# Find non-CpG control probes
		ctrlIdx <- getControlIndex(rawData, subject=Hsapiens)	
		# Get normalized methylation log-ratios
		m <- methp(rawData, controlIndex=ctrlIdx, returnM=TRUE)
		# Estimate percentage methylation
		ngc <- countGC(rawData)
		p <- methPercent(m, ngc=ngc)
	}

charm documentation built on May 6, 2019, 2:29 a.m.