title: clusterProfiler:构建WikiPathways数据库 tags: [] id: '2130' categories:
WikiPathways是一个开放协作平台,旨在促进生物学界对通路信息的贡献和维护。它提供了一种新的模型,可以增强和补充KEGG、Reactome和Pathway Commons等正在进行的工作。
require(rWikiPathways)
wp <- downloadPathwayArchive(organism='Homo sapiens', format='gmt')
text <- readLines(wp, encoding = "UTF-8")
text <- strsplit(text, "\t")
WP <- list(TERM2GENE=data.frame(), TERM2NAME=data.frame())
for (i in 1:length(text)){
line <- text[[i]]
gsid <- line[1]
WP$TERM2NAME <- rbind(WP$TERM2NAME, c(i,gsid))
for(k in 3:length(line)){
WP$TERM2GENE <- rbind(WP$TERM2GENE, c(i,line[k]))
}
}
colnames(WP$TERM2NAME) <- c('gsid', 'name')
colnames(WP$TERM2GENE) <- c('gsid', 'gene')
tmp <- AnnotationDbi::select(org.Hs.eg.db::org.Hs.eg.db,keys=WP$TERM2GENE$gene,columns='SYMBOL', keytype='ENTREZID')