## ----knitr, echo=FALSE, results="hide"----------------------------------- knitr::opts_chunk$set(tidy = FALSE, out.truncate = 80, out.lines = 6, dev = 'pdf', include = TRUE, fig.width = 6, fig.height = 6, resolution = 100, warning = FALSE, message = FALSE) ## ----style-Sweave, eval=TRUE, echo=FALSE, results="asis"----------------- BiocStyle::latex() ## ----loadPKG, echo=FALSE------------------------------------------------- library(DOSE) library(clusterProfiler) ## ----options,results='hide',echo=FALSE----------------------------------- options(digits=3, width=80, prompt=" ", continue=" ") ## ----loading, eval=FALSE, results='hide'--------------------------------- ## library(DOSE) ## help(DOSE) ## ----doSim--------------------------------------------------------------- data(DO2EG) set.seed(123) a <- sample(names(DO2EG), 10) a b <- sample(names(DO2EG), 5) b doSim(a[1], b[1], measure="Wang") doSim(a[1], b[1], measure="Resnik") doSim(a[1], b[1], measure="Lin") s <- doSim(a, b, measure="Wang") s ## ----simplot, fig.cap="Visualizing similarity matrix.", fig.align="center", fig.height=6, fig.width=6, out.width="0.6\\textwidth"---- simplot(s, color.low="white", color.high="red", labs=TRUE, digits=2, labs.size=5, font.size=14, xlab="", ylab="") ## ----geneSim------------------------------------------------------------- data(EG2DO) g1 <- sample(names(EG2DO), 5) g1 g2 <- sample(names(EG2DO), 4) g2 geneSim(g1[1], g2[1], measure="Wang", combine="BMA") gs <- geneSim(g1, g2, measure="Wang", combine="BMA") gs ## ----enrichment analysis------------------------------------------------- data(geneList) gene <- names(geneList)[abs(geneList) > 1.5] head(gene) x <- enrichDO(gene = gene, ont = "DO", pvalueCutoff = 0.05, pAdjustMethod = "BH", universe = names(geneList), minGSSize = 5, readable = FALSE) head(summary(x)) ## ----setReadable--------------------------------------------------------- x <- setReadable(x) head(summary(x)) ## ----barplot, fig.cap="barplot of DO enrichment result.", fig.align="center", fig.height=5, fig.width=6, out.width="0.6\\textwidth"---- barplot(x) ## ----cnetplot, fig.cap="cnetplot of DO enrichment result.", fig.align="center", fig.height=18, fig.width=18---- cnetplot(x, categorySize="pvalue", foldChange=geneList) ## ----clusterProfiler, fig.cap="DOSE with clusterProfiler.", fig.align="center", fig.height=8, fig.width=8, out.width="0.6\\textwidth"---- require(clusterProfiler) data(gcSample) cdo <- compareCluster(gcSample, fun="enrichDO") plot(cdo) ## ----GSEA analysis------------------------------------------------------- y <- gseAnalyzer(geneList, setType = "DO", nPerm = 100, minGSSize = 120, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = FALSE) res <- summary(y) head(res) ## ----gseaplot, fig.cap="gseaplot example.", fig.align="center", fig.height=6, fig.width=8, out.width="0.6\\textwidth"---- topID <- res[1,1] topID plot(y, geneSetID = topID) ## ----gseaplot2, eval=FALSE----------------------------------------------- ## plot(y, geneSetID = 1) ## ----enrichmap, fig.cap="enrichMap of DO enrichment result.", fig.align="center", fig.height=10, fig.width=10---- enrichMap(x) ## ----sessInfo, results='asis', echo=FALSE-------------------------------- toLatex(sessionInfo())