Skip to content

Instantly share code, notes, and snippets.

@zakandrewking
Last active May 29, 2023 11:26
Show Gist options
  • Save zakandrewking/f01e8d3ee2a50c8a9c50ef25ab2172b5 to your computer and use it in GitHub Desktop.
Save zakandrewking/f01e8d3ee2a50c8a9c50ef25ab2172b5 to your computer and use it in GitHub Desktop.
Get BiGG compounds for KEGG IDs from BiGG Models
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