KEGG几乎是最常用的基因功能通路分析网站。掌握其API使用方法,提高工作效率。
初识KEGG API
KEGG API Document
KEGG API is a REST-stype Application Programming Interface to the KEGG database resource.
KEGG API Operations
- INFO
- LIST
- FIND
- GET
- CONV
- LINK
- DDI
Python code
import pandas as pd
hsaPathway = 'http://rest.kegg.jp/list/pathway/hsa'
res=pd.read_csv(hsaPathway, sep='\t')
res.to_csv('hsaPathway.csv',sep=',',index=None)
# /list/pathway/hsa returns the list of human pathways
species = ['hsa', 'mmu','rno']
for i in range(len(species)):
allPathway = 'http://rest.kegg.jp/list/pathway/{}'.format(species[i])
res=pd.read_csv(allPathway, sep='\t')
res.to_csv('Pathways{}.csv'.format(species[i]),sep=',',index=None)