bool OEPrepareFastROCSMol(OEChem::OEMCMolBase &mol)
bool OEPrepareFastROCSMol(OEChem::OEMCMolBase &mol,
                          const OEShape::OEColorForceField &cff)

Prepares the molecule mol to improve the performance of loading the molecule into memory as an OEShapeDatabase object from an OEFormat_OEB file. The following steps are taken to improve the performance of OEShapeDatabase.Open by as much as 10-fold:

  • Sets the energy of each conformer to 0.0 to avoid writing it to OEB.

  • Suppresses hydrogens and reorders reference conformers for compression.

  • Pre-calculates color atoms.

  • Pre-calculates self-color and self-shape terms for all conformers.

It is recommended to call OEPRECompress on the oemolostream before writing out to OEB. This will store conformers in “PRE-compressed” form therefore alleviating the need to Gzip the OEB file and consequently improving the performance of OEMolDatabase.Open. In general, calling OEPrepareFastROCSMol and OEPRECompress will result in a smaller OEB file than the default OEB.GZ output from OMEGA.

Additionally, if OEB file size is of chief concern a further reduction in file size can be achieved by using an OEMCMolType_HalfFloatCartesian molecule, which stores reference coordinates and torsions in half floating point precision (16-bit). The following code snippet demonstrates how to cast the resultant molecule from OEPrepareFastROCSMol to use half precision:

OEMol halfMol(mol, OEMCMolType::HalfFloatCartesian);
OEWriteMolecule(ofs, halfMol);
halfMol = OEMol(mol, OEMCMolType_HalfFloatCartesian)
OEWriteMolecule(ofs, halfMol)

16-bit floating point will give a file size saving of approximately 12% with a tradeoff of about 7% more performance when loading the OEB from disk into memory.


By default, OEPrepareFastROCSMol will cache color atoms and self color terms for the OEColorFFType_ImplicitMillsDean color force field. The second overload that takes a OEColorForceField can be used to override this default.