3.8 Electrostatic Similarity

Electrostatic similarity may be calculated using the OEET class. The following example program shows how to obtain the electrostatic Tanimoto between a reference molecule and a trial molecule. The electrostatic Tanimoto is affected by the partitial charges of the molecules as well as the three-dimensional structure, including the tautomer state, spacial orientation, and conformation. In the example program shown below, MMFF charges are assigned to the molecules, but it is assumed that they have already been spatially aligned.

 1 #!/usr/bin/env python
 2 #############################################################################
 3 #  Copyright (C) 2006, 2007, 2008 OpenEye Scientific Software, Inc.
 4 #############################################################################
 5 ### calc_et.py
 6 #############################################################################
 7
 8 import os, sys
 9 from openeye.oechem import *
10 from openeye.oezap import *
11
12 def main(argv = [__name__]):
13     if len(argv) != 3:
14         OEThrow.Usage("calc_et.py <reffile> <fitfile>")
15
16     refmol=OEGraphMol()
17
18     ifs = oemolistream()
19     if not ifs.open(argv[1]):
20         OEThrow.Fatal("Unable to open %s for reading" % argv[1])
21     OEReadMolecule(ifs,refmol)
22     OEAssignBondiVdWRadii(refmol)
23     OEMMFFAtomTypes(refmol)
24     OEMMFF94PartialCharges(refmol)
25
26     et = OEET()
27     et.SetRefMol(refmol)
28
29     OEThrow.Info("dielectric: %.4f" % et.GetDielectric())
30     OEThrow.Info("inner mask: %.4f" % et.GetInnerMask())
31     OEThrow.Info("outer mask: %.4f" % et.GetOuterMask())
32     OEThrow.Info("salt conc : %.4f" % et.GetSaltConcentration())
33     OEThrow.Info("join      : %d" % et.GetJoin())
34
35     if not ifs.open(argv[2]):
36         OEThrow.Fatal("Unable to open %s for reading" % argv[2])
37     fitmol = OEGraphMol()
38     while OEReadMolecule(ifs, fitmol):
39         OEAssignBondiVdWRadii(fitmol)
40         OEMMFFAtomTypes(fitmol)
41         OEMMFF94PartialCharges(fitmol)
42         OEThrow.Info("Title: %s, ET %4.2f" %
43                      (fitmol.GetTitle(), et.Tanimoto(fitmol)))
44     return 0
45
46 if __name__ == "__main__":
47     sys.exit(main(sys.argv))

Listing:3.11 Calculating Electrostatic Tanimoto