## @knitr include=FALSE library(DOSE) library(GO.db) library(org.Hs.eg.db) library(pathview) library(clusterProfiler) library(knitr) opts_chunk$set(tidy=TRUE,tidy.opts=list(keep.blank.line=FALSE, width.cutoff=50),out.truncate=80,out.lines=6,cache=TRUE,dev='pdf',include=TRUE,fig.width=6,fig.height=6,resolution=150) ## @knitr options,echo=FALSE options(digits=3, width=80, prompt=" ", continue=" ") ## @knitr groupGO require(DOSE) data(geneList) gene <- names(geneList)[abs(geneList) > 2] head(gene) ggo <- groupGO(gene=gene, organism="human", ont="BP", level=3, readable=TRUE) head(summary(ggo)) ## @knitr enrichGO ego <- enrichGO(gene=gene, universe = names(geneList), organism="human", ont="CC", pvalueCutoff=0.01, readable=TRUE) head(summary(ego)) ## @knitr enrichKEGG kk <- enrichKEGG(gene=gene, organism="human", pvalueCutoff=0.01, readable=TRUE) head(summary(kk)) ## @knitr barplot, fig.height=5, fig.width=6 barplot(ggo, drop=TRUE, showCategory=12) ## @knitr barplot-enrich, fig.height=5, fig.width=8 barplot(ego, showCategory=8) ## @knitr cnetplot, fig.height=14, fig.width=14 cnetplot(ego, categorySize="pvalue", foldChange=geneList) ## @knitr cnetplot-KEGG, fig.height=14, fig.width=14 cnetplot(kk, categorySize="geneNum", foldChange=geneList) ## @knitr viewKEGG require(pathview) hsa04110 <- pathview(gene.data=geneList, pathway.id="hsa04110", species="hsa", limit=list(gene=max(abs(geneList)), cpd=1)) ## @knitr compareCluster, fig.height=8, fig.width=8 data(gcSample) ck <- compareCluster(geneCluster=gcSample, fun="enrichKEGG") plot(ck) ## @knitr sessInfo, results='asis', echo=FALSE toLatex(sessionInfo())