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)
rawData <- readCharm(files=pd$filename, sampleKey=pd)
# Correct spatial artifacts
dat <- spatialAdjust(rawData)
# Remove background signal
dat <- bgAdjust(dat)
# Find non-CpG control probes
ctrlIdx <- getControlIndex(rawData, subject=Hsapiens)
# Within-sample normalization
dat <- normalizeWithinSamples(dat, controlIndex=ctrlIdx)
# Within-sample normalization
dat <- normalizeBetweenSamples(dat)
}
Run the code above in your browser using DataLab