### R code from vignette source '/Users/khansen/Work/tutorial_minfi/BioC2014/minfi_BioC2014.Rnw' ################################################### ### code chunk number 1: minfi_BioC2014.Rnw:72-74 ################################################### require(minfi) require(minfiData) ################################################### ### code chunk number 2: minfi_BioC2014.Rnw:77-81 ################################################### baseDir <- system.file("extdata",package="minfiData") targets <- read.450k.sheet(baseDir) targets RGSet <- read.450k.exp(base = baseDir, targets = targets) ################################################### ### code chunk number 3: minfi_BioC2014.Rnw:86-88 ################################################### phenoData <- pData(RGSet) phenoData[,1:6] ################################################### ### code chunk number 4: minfi_BioC2014.Rnw:93-96 ################################################### manifest <- getManifest(RGSet) manifest head(getProbeInfo(manifest)) ################################################### ### code chunk number 5: minfi_BioC2014.Rnw:115-117 ################################################### MSet <- preprocessRaw(RGSet) MSet ################################################### ### code chunk number 6: minfi_BioC2014.Rnw:122-124 ################################################### head(getMeth(MSet)[,1:3]) head(getUnmeth(MSet)[,1:3]) ################################################### ### code chunk number 7: minfi_BioC2014.Rnw:129-131 ################################################### ratioSet <- ratioConvert(MSet, what = "both", keepCN = TRUE) ratioSet ################################################### ### code chunk number 8: minfi_BioC2014.Rnw:135-136 ################################################### beta <- getBeta(ratioSet) ################################################### ### code chunk number 9: minfi_BioC2014.Rnw:145-147 ################################################### gset <- mapToGenome(ratioSet) gset ################################################### ### code chunk number 10: minfi_BioC2014.Rnw:150-153 ################################################### beta <- getBeta(gset) m <- getM(gset) cn <- getCN(gset) ################################################### ### code chunk number 11: minfi_BioC2014.Rnw:155-158 ################################################### sampleNames <- sampleNames(gset) probeNames <- featureNames(gset) pheno <- pData(gset) ################################################### ### code chunk number 12: minfi_BioC2014.Rnw:161-163 ################################################### gr <- granges(gset) head(gr, n= 3) ################################################### ### code chunk number 13: minfi_BioC2014.Rnw:172-174 ################################################### annotation <- getAnnotation(gset) names(annotation) ################################################### ### code chunk number 14: minfi_BioC2014.Rnw:178-182 ################################################### islands <- getIslandStatus(gset) head(islands) probeType <- getProbeType(gset) head(probeType) ################################################### ### code chunk number 15: minfi_BioC2014.Rnw:195-198 ################################################### qc <- getQC(MSet) head(qc) plotQC(qc) ################################################### ### code chunk number 16: minfi_BioC2014.Rnw:204-205 ################################################### densityPlot(MSet, sampGroups = phenoData$Sample_Group) ################################################### ### code chunk number 17: minfi_BioC2014.Rnw:209-210 ################################################### densityBeanPlot(MSet, sampGroups = phenoData$Sample_Group) ################################################### ### code chunk number 18: minfi_BioC2014.Rnw:218-219 ################################################### controlStripPlot(RGSet, controls="BISULFITE CONVERSION II") ################################################### ### code chunk number 19: minfi_BioC2014.Rnw:222-223 (eval = FALSE) ################################################### ## qcReport(RGSet, pdf= "qcReport.pdf") ################################################### ### code chunk number 20: getSnpInfo ################################################### snps <- getSnpInfo(gset) head(snps,10) ################################################### ### code chunk number 21: addSnpInfo ################################################### gset <- addSnpInfo(gset) head(granges(gset)) ################################################### ### code chunk number 22: dropLociWithSnps (eval = FALSE) ################################################### ## gset <- dropLociWithSnps(gset, snps=c("SBE","CpG"), maf=0) ################################################### ### code chunk number 23: getAnnotationObject (eval = FALSE) ################################################### ## getAnnotationObject(gset) ################################################### ### code chunk number 24: getAnnotationObjectOld ################################################### annoStr <- paste(annotation(MsetEx), collapse = "anno.") annoStr get(annoStr) ################################################### ### code chunk number 25: minfi_BioC2014.Rnw:280-281 (eval = FALSE) ################################################### ## gset <- dropCrossReactiveProbes(gset) ################################################### ### code chunk number 26: minfi_BioC2014.Rnw:299-301 ################################################### MSet.illumina <- preprocessIllumina(RGSet, bg.correct = TRUE, normalize = "controls") ################################################### ### code chunk number 27: minfi_BioC2014.Rnw:308-309 ################################################### MSet.swan <- preprocessSWAN(RGSet) ################################################### ### code chunk number 28: minfi_BioC2014.Rnw:322-326 ################################################### gset.quantile <- preprocessQuantile(RGSet, fixOutliers = TRUE, removeBadSamples = TRUE, badSampleCutoff = 10.5, quantileNormalize = TRUE, stratified = TRUE, mergeManifest = FALSE, sex = NULL) ################################################### ### code chunk number 29: minfi_BioC2014.Rnw:337-338 ################################################### gset.funnorm <- preprocessFunnorm(RGSet) ################################################### ### code chunk number 30: minfi_BioC2014.Rnw:349-353 ################################################### beta <- getBeta(gset.funnorm) age <- pData(gset.funnorm)$age dmp <- dmpFinder(beta, pheno = age , type = "continuous") head(dmp) ################################################### ### code chunk number 31: minfi_BioC2014.Rnw:370-372 (eval = FALSE) ################################################### ## pheno <- pData(gset.funnorm)$status ## designMatrix <- model.matrix(~ pheno) ################################################### ### code chunk number 32: minfi_BioC2014.Rnw:375-377 (eval = FALSE) ################################################### ## dmrs <- bumphunter(gset.funnorm, design = designMatrix, ## cutoff = 0.2, B=0, type="Beta") ################################################### ### code chunk number 33: minfi_BioC2014.Rnw:381-383 (eval = FALSE) ################################################### ## dmrs <- bumphunter(gset.funnorm, design = designMatrix, ## cutoff = 0.2, B=1000, type="Beta") ################################################### ### code chunk number 34: minfi_BioC2014.Rnw:388-390 (eval = FALSE) ################################################### ## library(doParallel) ## registerDoParallel(cores = 3) ################################################### ### code chunk number 35: minfi_BioC2014.Rnw:393-395 (eval = FALSE) ################################################### ## names(dmrs) ## head(dmrs$table, n=3) ################################################### ### code chunk number 36: minfi_BioC2014.Rnw:398-400 ################################################### load("data/dmrs_B1000_c02.rda") head(dmrs$table) ################################################### ### code chunk number 37: minfi_BioC2014.Rnw:409-415 (eval = FALSE) ################################################### ## require(sva) ## mval <- getM(gset) ## pheno <- pData(gset) ## mod <- model.matrix(~as.factor(status), data=pheno) ## mod0 <- model.matrix(~1, data=pheno) ## sva.results <- sva(mval, mod, mod0) ################################################### ### code chunk number 38: minfi_BioC2014.Rnw:423-425 (eval = FALSE) ################################################### ## require(FlowSorted.Blood.450k) ## cellCounts <- estimateCellCounts(RGSet) ################################################### ### code chunk number 39: minfi_BioC2014.Rnw:435-437 ################################################### predictedSex <- getSex(gset, cutoff = -2)$predictedSex head(predictedSex) ################################################### ### code chunk number 40: minfi_BioC2014.Rnw:440-441 ################################################### plotSex(getSex(gset, cutoff = -2)) ################################################### ### code chunk number 41: minfi_BioC2014.Rnw:452-454 (eval = FALSE) ################################################### ## snps <- getSnpBeta(rgset) ## head(snaps) ################################################### ### code chunk number 42: minfi_BioC2014.Rnw:462-463 (eval = FALSE) ################################################### ## oob <- getOOB(rgset)