Since the clusterProfiler is a very useful tools for GO and Kegg annotation.At present I want to use it to enrich for kegg result while only have the KO number ,So I want to convert the KO number to the pathway function,Is there have any function or methods in the software can convert it?any help will be appreciated

这个问题问说他想转KO到通路,首先这是一个常见的错误,很多人分不清Kko,所以在我告诉他可以把K number转成ko pathway的时候,我先指出他的错误。

ko is actually pathway map. I think you are talking about K number mapping to ko pathway.

> bitr_kegg("K00844", "kegg", "Path", "ko")
     kegg    Path
1  K00844 ko00010
2  K00844 ko00051
3  K00844 ko00052
4  K00844 ko00500
5  K00844 ko00520
6  K00844 ko00521
7  K00844 ko00524
8  K00844 ko01100
9  K00844 ko01110
10 K00844 ko01120
11 K00844 ko01130
12 K00844 ko01200
13 K00844 ko04066
14 K00844 ko04910
15 K00844 ko04930
16 K00844 ko04973
17 K00844 ko05230

Yeah,sorry,It’s really the K number,Since I want to obtain the pathway according the K number,such like this ,did have any methods to achieve it ? 1 K00799 Drug metabolism - cytochrome P450

然后对方继续问,说想要通路的名字而不是ko号。于是我随手写了个ko2name的函数:

just write a ko2name function for this purpose.

> bitr_kegg("K00799", "kegg", "Path", "ko") -> x
> ko2name(x$Path) -> y
> merge(x, y, by.x='Path', by.y='ko')
     Path   kegg                                         name
1 ko00480 K00799                       Glutathione metabolism
2 ko00980 K00799 Metabolism of xenobiotics by cytochrome P450
3 ko00982 K00799            Drug metabolism - cytochrome P450
4 ko01524 K00799                     Platinum drug resistance
5 ko05204 K00799                      Chemical carcinogenesis
6 ko05418 K00799       Fluid shear stress and atherosclerosis