Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import urllib2
import json
headers = {'Accept' : 'application/json'}
req = urllib2.Request('http://marid.bioc.cam.ac.uk/credo/chemcomps/001', headers=headers)
resp = urllib2.urlopen(req)
jsondata = json.load(resp)
# output
{u'data': [7464,
u'001',
u'001',
None,
None,
u'[(1S)-1-(3-phenylpropyl)-4-(3-pyridyl)butyl] (2R)-1-[2,2-difluoro-2-(3,4,5-trimethoxyphenyl)acetyl]piperidine-2-carboxylate',
u'2001-11-06',
u'2011-06-04',
u'COc1cc(cc(c1OC)OC)C(C(=O)N2CCCC[C@H]2C(=O)O[C@@H](CCCc3ccccc3)CCCc4cccnc4)(F)F',
u'InChI=1S/C35H42F2N2O6/c1-42-30-22-27(23-31(43-2)32(30)44-3)35(36,37)34(41)39-21-8-7-19-29(39)33(40)45-28(17-9-14-25-12-5-4-6-13-25)18-10-15-26-16-11-20-38-24-26/h4-6,11-13,16,20,22-24,28-29H,7-10,14-15,17-19,21H2,1-3H3/t28-,29-/m0/s1',
u'NBYCDVVSYOMFMS-VMPREFPWSA-N',
624.715,
45,
35,
52,
2,
1.48571,
0,
0,
0,
90,
17,
4,
3,
8,
0,
87.19,
7.258,
0.457143,
1,
0.142935,
True,
True,
False,
False,
False,
False,
False,
False,
False,
False,
False,
True,
False],
u'metadata': [[u'chem_comp_id', u'INTEGER'],
[u'het_id', u'VARCHAR(3)'],
[u'three_letter_code', u'VARCHAR(3)'],
[u'replaced_by_het_id', u'VARCHAR(8)'],
[u'nstd_parent_het_id', u'TEXT'],
[u'iupac_name', u'TEXT'],
[u'initial_date', u'DATE'],
[u'modified_date', u'DATE'],
[u'ism', u'TEXT'],
[u'inchi', u'TEXT'],
[u'inchikey', u'TEXT'],
[u'mw', u'REAL'],
[u'num_hvy_atoms', u'INTEGER'],
[u'num_carbons', u'INTEGER'],
[u'num_heteroatoms', u'INTEGER'],
[u'num_halides', u'INTEGER'],
[u'het_carb_ratio', u'REAL'],
[u'formal_charge_count', u'INTEGER'],
[u'formal_charge_sum', u'INTEGER'],
[u'num_chiral_centers', u'INTEGER'],
[u'num_bonds', u'INTEGER'],
[u'num_rotors', u'INTEGER'],
[u'num_ring_systems', u'INTEGER'],
[u'num_aro_ring_systems', u'INTEGER'],
[u'num_lipinski_hbond_acceptors', u'INTEGER'],
[u'num_lipinski_hbond_donors', u'INTEGER'],
[u'tpsa', u'REAL'],
[u'xlogp', u'REAL'],
[u'fraction_csp3', u'REAL'],
[u'alerts', u'INTEGER'],
[u'qed', u'REAL'],
[u'has_std_atoms', u'BOOLEAN'],
[u'has_butyl', u'BOOLEAN'],
[u'is_solvent', u'BOOLEAN'],
[u'is_nat_product', u'BOOLEAN'],
[u'is_amino_acid', u'BOOLEAN'],
[u'is_nucleotide', u'BOOLEAN'],
[u'is_saccharide', u'BOOLEAN'],
[u'is_block_buster', u'BOOLEAN'],
[u'is_fragment', u'BOOLEAN'],
[u'is_drug_like', u'BOOLEAN'],
[u'is_lead', u'BOOLEAN'],
[u'is_drug', u'BOOLEAN'],
[u'is_approved_drug', u'BOOLEAN']]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.