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)
}
Run the code above in your browser using DataLab