当前位置:   article > 正文

使用R包topGO绘制GO有向无环图_r语言topgo包绘制有向无环图

r语言topgo包绘制有向无环图

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()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35

绘制结果

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/258258
推荐阅读
相关标签
  

闽ICP备14008679号