1
2
3
4
5
6
7
8
9
10
11
12
13 """ DEPRECATED
14 constructs the list of available descriptors
15
16 """
17 from rdkit.RDLogger import logger
18 logger().warning("The AvailDescriptors module is deprecated. Please switch to using the Descriptors module.")
19
20 from rdkit.Chem import GraphDescriptors,MolSurf,Lipinski,Fragments,Crippen,Descriptors
21 from rdkit.Chem.EState import EState_VSA
22 mods = [GraphDescriptors,MolSurf,EState_VSA,Lipinski,Descriptors,Crippen,Fragments]
23
24 from rdkit import Chem
25 otherMods = [Chem]
26
27 others = []
28 for mod in otherMods:
29 tmp = dir(mod)
30 for name in tmp:
31 if name[0] != '_':
32 thing = getattr(mod,name)
33 if hasattr(thing,'__call__'):
34 others.append(name)
35
36 descList = []
37 descDict = {}
38 for mod in mods:
39 tmp = dir(mod)
40
41 for name in tmp:
42 if name[0] != '_' and name[-1] != '_' and name not in others:
43
44 if name[:2]=='py' and name[2:] in tmp:
45 continue
46 thing = getattr(mod,name)
47 if hasattr(thing,'__call__'):
48 descList.append((name,thing))
49 descDict[name] = thing
50
52 """ puts in all upper and all lower case versions of each
53 descriptor name
54 """
55 ks = descDict.keys()
56 for k in ks:
57 fn = descDict[k]
58 descDict[k.upper()]=fn
59 descDict[k.lower()]=fn
60
61
62 if __name__ == '__main__':
63 m = Chem.MolFromSmiles('CCOC')
64 for name,fn in descList:
65 print name,fn(m)
66