赞
踩
topGO 官方说明链接:http://www.bioconductor.org/packages/release/bioc/html/topGO.html
##R脚本 biocLite("topGO") biocLite("ALL") biocLite('hgu95av2.db') biocLite('Rgraphviz') library(topGO) library(ALL) data(ALL) data(geneList) affyLib <- paste(annotation(ALL), "db", sep = ".") library(package = affyLib, character.only = TRUE) sum(topDiffGenes(geneList)) ##ontology参数可以选择BP,CC,MF sampleGOdata <- new("topGOdata", description = "Simple session", ontology = "BP", allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10, annot = annFUN.db, affyLib = affyLib) resultFisher <- runTest(sampleGOdata, algorithm = "classic", statistic = "fisher") resultKS <- runTest(sampleGOdata, algorithm = "classic", statistic = "ks") resultKS.elim <- runTest(sampleGOdata, algorithm = "elim", statistic = "ks") allRes <- GenTable(sampleGOdata, classicFisher = resultFisher, classicKS = resultKS, elimKS = resultKS.elim, orderBy = "elimKS", ranksOf = "classicFisher", topNodes = 10) pValue.classic <- score(resultKS) pValue.elim <- score(resultKS.elim)[names(pValue.classic)] #保存图片 pdf('result.pdf',width = 10,height = 10) showSigOfNodes(sampleGOdata, score(resultKS.elim), firstSigNodes = 5, useInfo ='all') dev.off()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。