## ----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(GO.db) library(org.Hs.eg.db) library(clusterProfiler) ## ------------------------------------------------------------------------ x <- c("GPX3", "GLRX", "LBP", "CRYAB", "DEFB1", "HCLS1", "SOD2", "HSPA2", "ORM1", "IGFBP1", "PTHLH", "GPC3", "IGFBP3","TOB1", "MITF", "NDRG1", "NR1H4", "FGFR3", "PVR", "IL6", "PTPRM", "ERBB2", "NID2", "LAMB1", "COMP", "PLS3", "MCAM", "SPP1", "LAMC1", "COL4A2", "COL4A1", "MYOC", "ANXA4", "TFPI2", "CST6", "SLPI", "TIMP2", "CPM", "GGT1", "NNMT", "MAL", "EEF1A2", "HGD", "TCN2", "CDA", "PCCA", "CRYM", "PDXK", "STC1", "WARS", "HMOX1", "FXYD2", "RBP4", "SLC6A12", "KDELR3", "ITM2B") eg = bitr(x, fromType="SYMBOL", toType="ENTREZID", annoDb="org.Hs.eg.db") head(eg) ## ------------------------------------------------------------------------ idType("org.Hs.eg.db") ## ------------------------------------------------------------------------ ids <- bitr(x, fromType="SYMBOL", toType=c("UNIPROT", "ENSEMBL"), annoDb="org.Hs.eg.db") head(ids) ## ------------------------------------------------------------------------ library("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)) ## ------------------------------------------------------------------------ ego <- enrichGO(gene = gene, universe = names(geneList), organism = "human", ont = "CC", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE) head(summary(ego)) ## ----eval=FALSE---------------------------------------------------------- ## ego2 <- gseGO(geneList = geneList, ## organism = "human", ## ont = "CC", ## nPerm = 1000, ## minGSSize = 120, ## pvalueCutoff = 0.01, ## verbose = FALSE) ## ------------------------------------------------------------------------ kk <- enrichKEGG(gene = gene, organism = "human", pvalueCutoff = 0.05, readable = TRUE, use_internal_data = TRUE) head(summary(kk)) ## ------------------------------------------------------------------------ kk2 <- gseKEGG(geneList = geneList, organism = "human", nPerm = 1000, minGSSize = 120, pvalueCutoff = 0.05, verbose = FALSE, use_internal_data = TRUE) head(summary(kk2)) ## ----eval=FALSE---------------------------------------------------------- ## david <- enrichDAVID(gene = gene, ## idType = "ENTREZ_GENE_ID", ## listType = "Gene", ## annotation = "KEGG_PATHWAY", ## david.user = "clusterProfiler@hku.hk") ## ----fig.height=5, fig.width=6------------------------------------------- barplot(ggo, drop=TRUE, showCategory=12) ## ----fig.height=5, fig.width=8------------------------------------------- barplot(ego, showCategory=8) ## ------------------------------------------------------------------------ dotplot(ego) ## ----fig.cap="enrichment map of enrichment result", fig.align="center", fig.height=16, fig.width=16---- enrichMap(ego) ## ----fig.height=14, fig.width=14----------------------------------------- cnetplot(ego, categorySize="pvalue", foldChange=geneList) ## ----fig.height=14, fig.width=14----------------------------------------- cnetplot(kk, categorySize="geneNum", foldChange=geneList) ## ----fig.cap="plotting gsea result", fig.align="center", fig.height=6, fig.width=8---- gseaplot(kk2, geneSetID = "hsa04145") ## ----fig.height=12, fig.width=8------------------------------------------ plotGOgraph(ego) ## ----eval=FALSE---------------------------------------------------------- ## library("pathview") ## hsa04110 <- pathview(gene.data = geneList, ## pathway.id = "hsa04110", ## species = "hsa", ## limit = list(gene=max(abs(geneList)), cpd=1)) ## ------------------------------------------------------------------------ data(gcSample) lapply(gcSample, head) ## ------------------------------------------------------------------------ ck <- compareCluster(geneCluster = gcSample, fun = "enrichKEGG", use_internal_data = TRUE) head(summary(ck)) ## ------------------------------------------------------------------------ ## formula interface mydf <- data.frame(Entrez=c('1', '100', '1000', '100101467', '100127206', '100128071'), group = c('A', 'A', 'A', 'B', 'B', 'B'), othergroup = c('good', 'good', 'bad', 'bad', 'good', 'bad')) xx.formula <- compareCluster(Entrez~group, data=mydf, fun='groupGO') head(summary(xx.formula)) ## formula interface with more than one grouping variable xx.formula.twogroups <- compareCluster(Entrez~group+othergroup, data=mydf, fun='groupGO') head(summary(xx.formula.twogroups)) ## ----fig.height=8, fig.width=8------------------------------------------- plot(ck) ## ----echo=FALSE---------------------------------------------------------- sessionInfo()