RパケットtopGOを使用してGO有向無ループ図を描画

8963 ワード

GO有向無ループ図
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()

結果の描画
使用R包topGO绘制GO有向无环图_第1张图片