## ----style, echo=FALSE, results="asis", message=FALSE-------------------- BiocStyle::markdown() knitr::opts_chunk$set(tidy = FALSE, warning = FALSE, message = FALSE) ## ----echo=FALSE, results='hide', message=FALSE--------------------------- library(DOSE) library(clusterProfiler) ## ----eval=FALSE---------------------------------------------------------- ## library(DOSE) ## help(DOSE) ## ------------------------------------------------------------------------ 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(s, color.low="white", color.high="red", labs=TRUE, digits=2, labs.size=5, font.size=14, xlab="", ylab="") ## ----warning=FALSE------------------------------------------------------- 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 ## ------------------------------------------------------------------------ clusterSim(g1, g2, measure="Wang", combine="BMA") ## ------------------------------------------------------------------------ clusters <- list(a=g1, b=g2, c=sample(names(EG2DO), 6)) mclusterSim(clusters, measure="Wang", combine="BMA") ## ------------------------------------------------------------------------ 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, qvalueCutoff = 0.05, readable = FALSE) head(summary(x)) ## ------------------------------------------------------------------------ x <- setReadable(x, 'org.Hs.eg.db') head(summary(x)) ## ------------------------------------------------------------------------ barplot(x) ## ------------------------------------------------------------------------ dotplot(x) ## ----fig.width=18, fig.height=18----------------------------------------- cnetplot(x, categorySize="pvalue", foldChange=geneList) ## ------------------------------------------------------------------------ require(clusterProfiler) data(gcSample) cdo <- compareCluster(gcSample, fun="enrichDO") plot(cdo) ## ------------------------------------------------------------------------ y <- gseDO(geneList, nPerm = 100, minGSSize = 120, pvalueCutoff = 0.2, pAdjustMethod = "BH", verbose = FALSE) res <- summary(y) head(res) ## ----fig.height=6, fig.width=8------------------------------------------- topID <- res[1,1] topID plot(y, geneSetID = topID) ## ----eval=FALSE---------------------------------------------------------- ## plot(y, geneSetID = 1) ## ----fig.height=10, fig.width=10----------------------------------------- enrichMap(x) ## ----echo=FALSE---------------------------------------------------------- sessionInfo()