1
2
3
4
5
6
7
8
9 """ constructs the list of available descriptors
10
11 """
12 import types
13 from rdkit.Chem import GraphDescriptors,MolSurf,Lipinski,Fragments,Crippen,Descriptors
14 from rdkit.Chem.EState import EState_VSA
15 mods = [GraphDescriptors,MolSurf,EState_VSA,Lipinski,Descriptors,Crippen,Fragments]
16
17 import numpy.oldnumeric as Numeric
18 from rdkit import Chem
19 otherMods = [Numeric,Chem]
20
21 others = []
22 for mod in otherMods:
23 tmp = dir(mod)
24 for name in tmp:
25 if name[0] != '_':
26 thing = getattr(mod,name)
27 if hasattr(thing,'__call__'):
28 others.append(name)
29
30 descList = []
31 descDict = {}
32 for mod in mods:
33 tmp = dir(mod)
34
35 for name in tmp:
36 if name[0] != '_' and name[-1] != '_' and name not in others:
37
38 if name[:2]=='py' and name[2:] in tmp:
39 continue
40 thing = getattr(mod,name)
41 if hasattr(thing,'__call__'):
42 descList.append((name,thing))
43 descDict[name] = thing
44
54
55
56 if __name__ == '__main__':
57 from rdkit import Chem
58
59 m = Chem.MolFromSmiles('CCOC')
60 for name,fn in descs:
61 print name,fn(m)
62