当前位置:文档之家› 利用KEGG数据库进行ID转换

利用KEGG数据库进行ID转换

利用KEGG数据库进行ID转换clusterProfiler can convert biological IDs using OrgDb object via the bitr function. Now I implemented another function, bitr_kegg for converting IDs through KEGG API.library(clusterProfiler)data(gcSample)hghead(hg)## [1] '4597' '7111' '5266' '2175' '755''23046'eg2np ## Warning in bitr_kegg(hg, fromType = 'kegg', toType = 'ncbi-proteinid',## organism = 'hsa'): 3.7% of input gene IDs are fail to map...head(eg2np)## kegg ncbi-proteinid## 1 8326 NP_003499## 2 58487 NP_001034707## 3 139081 NP_619647## 4 59272 NP_068576## 5 993 NP_001780## 6 2676 NP_001487np2uphead(np2up)## ncbi-proteinid uniprot## 1 NP_005457 O75586## 2 NP_005792 P41567## 3 NP_005792 Q6IAV3## 4 NP_037536 Q13421## 5 NP_006054 O60662## 6 NP_001092002 O95398The ID type (both fromType & toType) should be one of'kegg', 'ncbi-geneid', 'ncbi-proteinid' or 'uniprot'. The 'kegg' is the primary ID used in KEGG database. The data source of KEGG was from NCBI. A rule of thumb for the 'kegg' ID is entrezgene ID for eukaryote species and Locus ID for prokaryotes.Many prokaryote species don't have entrezgene ID available. For example we can check the gene information of ece:Z5100 inhttp://www.genome.jp/dbget-bin/www_bget?ece:Z5100, which have NCBI-ProteinID and UnitProt links in the Other DBs Entry, but not NCBI-GeneID.If we try to convert Z5100 to ncbi-geneid, bitr_kegg will throw error of ncbi-geneid is not supported.bitr_kegg('Z5100', fromType='kegg',toType='ncbi-geneid', organism='ece')## Error in KEGG_convert(fromType, toType, organism) :## ncbi-geneid is not supported for ece ...We can of course convert it to ncbi-proteinid and uniprot:bitr_kegg('Z5100', fromType='kegg',toType='ncbi-proteinid', organism='ece')## kegg ncbi-proteinid## 1 Z5100 AAG58814bitr_kegg('Z5100', fromType='kegg', toType='uniprot', organism='ece')## kegg uniprot## 1 Z5100 Q7DB85search_kegg_organismclusterProfiler supports more than 4k species listed inhttp://www.genome.jp/kegg/catalog/org_list.html for hypergeometric test (enrichKEGG & enrichMKEGG) and GSEA (gseKEGG & gseMKEGG). We can use bitr_kegg to convert ID for all these 4k species. To facilitate searching scientific name abbreviate used in the organism parameter of these functions, I implemented thesearch_kegg_organism function. We can search bykegg_code, scientific_name or common_name (which is not available for prokaryotes).search_kegg_organism('ece', by='kegg_code')## kegg_codescientific_name common_name## 334 ece Escherichia coli O157:H7 EDL933 (EHEC)ecolidim(ecoli)## [1] 64 3head(ecoli)## kegg_codescientific_name common_name## 329 eco Escherichia coli K-12MG1655## 330 ecj Escherichia coli K-12W3110## 331 ecd Escherichia coli K-12DH10B## 332 ebw Escherichia coliBW2952## 333 ecok Escherichia coli K-12 MDS42## 334 ece Escherichia coli O157:H7 EDL933 (EHEC)keyType parameterWith the ID conversion utilities built in clusterProfiler, I add a parameter keyType in enrichKEGG, enrichMKEGG, gseKEGG and gseMKEGG. Now we canuse ID type that is not the primary ID in KEGG database.x head(summary(x))## IDDescription GeneRatio## hsa04072 hsa04072 Phospholipase D signaling pathway 11/133## hsa04060 hsa04060 Cytokine-cytokine receptor interaction 14/133## hsa04390 hsa04390 Hippo signaling pathway 10/133## hsa04975 hsa04975 Fat digestion and absorption 5/133## hsa05221 hsa05221 Acute myeloid leukemia 6/133## BgRatio pvalue p.adjustqvalue## hsa04072 216/9275 0.0002654190 0.039016590.03240905## hsa04060 354/9275 0.0005349245 0.039316950.03265855## hsa04390 213/9275 0.0009536247 0.041994040.03488227## hsa04975 58/9275 0.0014014886 0.041994040.03488227## hsa05221 86/9275 0.0014283687 0.041994040.03488227##geneID## hsa04072O95398/Q99777/P49619/Q6FGP0/Q8WVM9/O14807/P41 594/A8K5P7/P10145/A0A024RDA5/P16234## hsa04060A0N0N3/O00574/P19876/P01589/P10145/A0A024RDA5/ B4DGA4/Q99665/P16234/P78556/Q6I9S7/P42830/P2793 0/Q9UBN6## hsa04390Q8WW10/A8K141/Q9UI47/P35240/A0A024R1J8/Q659G9 /Q9UJU2/P22003/M9VUD0/O00144## hsa04975Q9UNK4/A0A087WZT4/A0A0C4DFX6/Q9UHC9/P04054 ## hsa05221Q659G9/Q9UJU2/Q03181/A0A024RCW6/Q06455/B2R6I 9## Count## hsa04072 11## hsa04060 14## hsa04390 10## hsa04975 5## hsa05221 6setReadableFor GO analysis, we have a readable parameter to control whether traslating the IDs to human readable gene name. This parameter is not available for KEGG analysis. But we still have the ability to translate input gene IDs to gene name using setReadable function if and only if corresponding OrgDb object is available.y head(summary(y))## IDDescription GeneRatio## hsa04072 hsa04072 Phospholipase D signaling pathway 11/133## hsa04060 hsa04060 Cytokine-cytokine receptor interaction 14/133## hsa04390 hsa04390 Hippo signaling pathway 10/133## hsa04975 hsa04975 Fat digestion and absorption 5/133## hsa05221 hsa05221 Acute myeloid leukemia 6/133## BgRatio pvalue p.adjustqvalue## hsa04072 216/9275 0.0002654190 0.039016590.03240905## hsa04060 354/9275 0.0005349245 0.039316950.03265855## hsa04390 213/9275 0.0009536247 0.041994040.03488227## hsa04975 58/9275 0.0014014886 0.041994040.03488227## hsa05221 86/9275 0.0014283687 0.041994040.03488227##geneID## hsa04072RAPGEF3/RAPGEF3/DGKG/MRAS/MRAS/MRAS/GRM5/ GRM5/CXCL8/CXCL8/PDGFRA## hsa04060CXCR6/CXCR6/CXCL3/IL2RA/CXCL8/CXCL8/IL12RB2/IL 12RB2/PDGFRA/CCL20/CXCL5/CXCL5/IL1R2/TNFRSF1 0D## hsa04390CTNNA3/CTNNA3/CTNNA3/NF2/NF2/LEF1/LEF1/BMP5/ BMP5/FZD9## hsa04975PLA2G2D/PLA2G2D/NPC1L1/NPC1L1/PLA2G1B## hsa05221LEF1/LEF1/PPARD/PPARD/RUNX1T1/RUNX1T1## Count## hsa04072 11## hsa04060 14## hsa04390 10## hsa04975 5## hsa05221 6经常有人问我用enricher或GSEA分析的话,没有readable参数,要知道这两函数是通用的富集分析工具,对于你要做什么(包括知识库,物种,ID类型)是没有任何假设的,请问我该如何来为你自动转ID,答案是不可能,但你自己做什么,心里应该有点B数,那么我为你提供了setReadable函数,可以帮忙解决部分的ID转换问题,当然肯定不是全部。

相关主题