Skip to content

Instantly share code, notes, and snippets.

@mnowotka
Last active August 29, 2015 14:15
Show Gist options
  • Save mnowotka/a1bb14ef0f71be76a051 to your computer and use it in GitHub Desktop.
Save mnowotka/a1bb14ef0f71be76a051 to your computer and use it in GitHub Desktop.
from chembl_webresource_client.new_client import new_client
# Get Molecules with ATC 'A10' classification
molecules = new_client.molecule.filter(atc_classifications__level5__startswith='A10')
molecule_ids = list(set(map(lambda d: d['molecule_chembl_id'], molecules)))
print molecule_ids
# Get Targets for Molecules
activities = new_client.activity.filter(molecule_chembl_id__in=molecule_ids).filter(pchembl_value__gte=6)
target_ids = list(set(map(lambda d: d['target_chembl_id'], activities)))
print target_ids
assert(len(target_ids)==59)
# Get TargetComponents for Targets
# Get UniProt accessions for TargetComponents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment