forked from markussitzmann/pychembl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
examples_01.py
29 lines (19 loc) · 926 Bytes
/
examples_01.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from pychembl.settings import *
from pychembl.db.auto_schema import *
molecules = chembldb.query(MoleculeDictionary)
print type(molecules)
print molecules.count()
molecule = molecules.filter(MoleculeDictionary.molregno==675049).all()
molecule = molecules.filter(MoleculeDictionary.molregno==675049).one()
molecule = molecules.filter(MoleculeDictionary.molregno==675049).first()
molecule = molecules.get((675049,))
molecule = chembldb.query(MoleculeDictionary).filter(MoleculeDictionary.molregno==675049).one()
print molecule.molregno
print molecule.pref_name
print molecule.chembl_id
print molecule.first_approval
print molecule.natural_product
molecules = chembldb.query(MoleculeDictionary.chembl_id, MoleculeDictionary.chebi_id)
molecules = chembldb.query(MoleculeDictionary.chembl_id, MoleculeDictionary.chebi_id)
chembl_to_chebi_id_dictionary = dict(molecules.limit(5).all())
print chembl_to_chebi_id_dictionary