Last active
May 29, 2023 11:26
-
-
Save zakandrewking/f01e8d3ee2a50c8a9c50ef25ab2172b5 to your computer and use it in GitHub Desktop.
Get BiGG compounds for KEGG IDs from BiGG Models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
response = requests.post( | |
'http://bigg.ucsd.edu/advanced_search_external_id_results', | |
data={'database_source': 'kegg.compound', 'query': 'C00234'} | |
) | |
try: | |
print re.search(r'/models/universal/metabolites/([^"]+)', response.text).group(1) | |
except AttributeError: | |
print 'no result' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment