写超几何分布检验

2018-06-07  本文已影响0人  白云梦_7

library(org.Hs.eg.db)

library(KEGG.db)

tmp=toTable(org.Hs.egPATH)

write.table(tmp,'kegg2gene.list.txt',quote = F,row.names = F)

library("hgu95av2.db")

ls('package:hgu95av2.db')

universeGeneIds <- unique(mappedRkeys(hgu95av2ENTREZID))

write.table(universeGeneIds,'universeGeneIds.txt',quote = F,row.names = F,col.names = F)

set.seed('123456.789')#定义一个种子,下面的随机就不会变了

diff_gene = sample(universeGeneIds,300)

write.table(diff_gene,'diff_gene.txt',quote = F,row.names = F,col.names = F)

library(GOstats)

annotationPKG='org.Hs.eg.db'

hyperG.params = new("KEGGHyperGParams", geneIds=diff_gene, universeGeneIds=universeGeneIds, annotation=annotationPKG, categoryName="KEGG", pvalueCutoff=1, testDirection = "over")

KEGG.hyperG.results = hyperGTest(hyperG.params);

htmlReport(KEGG.hyperG.results, file="kegg.enrichment.html", summary.args=list("htmlLinks"=TRUE))   

library(clusterProfiler)

kk <- enrichKEGG(gene        = diff_gene,

                universe=universeGeneIds,

                organism    = 'hsa',

                pvalueCutoff = 1,qvalueCutoff=1)

y_results=summary(kk)

上一篇 下一篇

猜你喜欢

热点阅读