Created
April 23, 2014 11:13
-
-
Save mnowotka/11211172 to your computer and use it in GitHub Desktop.
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
# first things first: | |
from chembl_webresource_client import * | |
assays = AssayResource() | |
print assays.status() | |
True | |
# assays are simple, we can get them by chembl ID: | |
a = assays.get('CHEMBL1217643') | |
print a | |
{u'assayType': u'B', u'chemblId': u'CHEMBL1217643', u'journal': u'Bioorg. Med. Chem. Lett.', | |
u'assayStrain': u'Unspecified', u'assayOrganism': u'Homo sapiens', u'numBioactivities': 1, | |
u'assayDescription': u'Inhibition of human hERG'} | |
# xml is supported: | |
a = assays.get('CHEMBL1217643', frmt='xml') | |
print a | |
''' | |
<?xml version='1.0' encoding='utf-8'?>\n<assay><assayType>B</assayType> | |
<chemblId>CHEMBL1217643</chemblId><journal>Bioorg. Med. Chem. Lett.</journal> | |
<assayStrain>Unspecified</assayStrain><assayOrganism>Homo sapiens</assayOrganism> | |
<numBioactivities>1</numBioactivities> | |
<assayDescription>Inhibition of human hERG</assayDescription></assay>''' | |
# as well as bulk retrieval: | |
al = assays.get(['CHEMBL1217643', 'CHEMBL1217644']) | |
print al | |
[ | |
{u'assayType': u'B', u'chemblId': u'CHEMBL1217643', u'journal': u'Bioorg. Med. Chem. Lett.', | |
u'assayStrain': u'Unspecified', u'assayOrganism': u'Homo sapiens', u'numBioactivities': 1, | |
u'assayDescription': u'Inhibition of human hERG'}, | |
{u'assayType': u'B', u'chemblId': u'CHEMBL1217644', u'journal': u'Bioorg. Med. Chem. Lett.', | |
u'assayStrain': u'Unspecified', u'numBioactivities': 1, u'assayDescription': u'Inhibition of MAOA' | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment