This next example program switches on the Analytic overlap method and also uses a little extra OEChem to attach the overlap scores to each molecule as SD data. This can be used to rescore a set of ROCS hits or to measure the overlap of ROCS alignments against an exlcusion region in the binding site.
1 /**********************************************************************
2 Copyright (C) 2005,2006,2007,2008 OpenEye Scientific Software, Inc.
3 ***********************************************************************/
4 #include "openeye.h"
5
6 #include "oeplatform.h"
7 #include "oesystem.h"
8 #include "oechem.h"
9 #include "oeshape.h"
10
11 using namespace OEPlatform;
12 using namespace OESystem;
13 using namespace OEChem;
14 using namespace OEShape;
15 using namespace std;
16
17 int main(int argc,char *argv[])
18 {
19 if (argc!=4)
20 OEThrow.Usage("rescore <reffile> <rocs_hits_file> <output.sdf>");
21
22 oemolistream reffs(argv[1]);
23 oemolistream fitfs(argv[2]);
24 oemolostream outfs(argv[3]);
25
26 OEGraphMol refmol;
27 OEReadMolecule(reffs, refmol);
28
29 OEOverlap ov;
30 ov.SetMethod(OEOverlapMethod::Analytic);
31 ov.SetRefMol(refmol);
32
33 OEOverlapResults res;
34 OEGraphMol fitmol;
35 while (OEReadMolecule(fitfs, fitmol))
36 {
37 ov.Overlap(fitmol, res);
38 char buffer[10];
39 sprintf(buffer, "%-6.3f", res.tanimoto);
40 OESetSDData(fitmol, "AnalyticTanimoto", buffer);
41 OEWriteMolecule(outfs, fitmol);
42 }
43 return 0;
44 }
45