根据K0查对应的通路
#######总的K0基因对应的通路
emapper1 <- read_delim("KEGG_KO_ENZYME_PATHWAY.txt","\t", escape_double = FALSE,col_names = FALSE) %>%
  dplyr::select(K0_id = X1, 
                Pathway = X8,
                level1 = X9,
                level2 = X10,
                level3 = X11
  )
#
emapper1
###假设取前一百个是所需的目的K0基因
test<-emapper1[1:100,]
test
##########转化每个基因对应的pathway
gene2pathway <- dplyr::select(test, K0_id, Pathway) %>%
  separate_rows(Pathway, sep = ';', convert = F) %>%
  filter(str_detect(Pathway, 'ko'))
gene2pathway
#加载通路信息
load(file = paste("kegg_info.RData"))
pathway2name
gene2pathway <- gene2pathway %>%
  left_join(pathway2name, by = "Pathway") %>%
  dplyr::select(K0_id, Pathway, Pathway_Name, Pathway_Class, Pathway_Subclass) %>%
  distinct() %>%
  na.omit()
gene2pathway
################################简洁版
# if (!require("BiocManager", quietly = TRUE))
#   install.packages("BiocManager")
# 
# BiocManager::install("clusterProfiler")
library(clusterProfiler)
k <- c("K00799","K00844")
x <- bitr_kegg(k,"kegg","Path","ko")
x
#加载已知通路信息
load(file = paste("kegg_info.RData"))
pathway2name
gene2pathway <- x %>%
  left_join(pathway2name, by = c("Path"="Pathway")) %>%
  #dplyr::select(K0_id, Pathway, Pathway_Name, Pathway_Class, Pathway_Subclass) %>%
  distinct() %>%
  na.omit()
gene2pathway
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇