1
2
3
4 """ Various bits and pieces for calculating descriptors
5
6 """
7 from __future__ import print_function
8 from rdkit import RDConfig
9
11 """ abstract base class for descriptor calculators
12
13 """
14
15
16
17
18
20 """ prints out a list of the descriptors
21
22 """
23 print('#---------')
24 print('Simple:')
25 for desc in self.simpleList:
26 print(desc)
27 if self.compoundList:
28 print('#---------')
29 print('Compound:')
30 for desc in self.compoundList:
31 print(desc)
32
34 """ returns a list of the names of the descriptors this calculator generates
35
36 """
37 pass
38
40 """ Writes this calculator off to a file so that it can be easily loaded later
41
42 **Arguments**
43
44 - fileName: the name of the file to be written
45
46 """
47 from rdkit.six.moves import cPickle
48 try:
49 f = open(fileName,'wb+')
50 except:
51 print('cannot open output file %s for writing'%(fileName))
52 return
53 cPickle.dump(self,f)
54 f.close()
55
58
60 """ Constructor
61
62 """
63 self.simpleList = None
64 self.descriptorNames = None
65 self.compoundList = None
66