OEBestOverlay
class OEBestOverlay
Note
This deprecated class will not be developed further. It is being replaced by OEOverlay and OEROCS which provides more control and greater expandability.
This class is used to optimize the overlap between 2 molecules. Both molecules can contain one or more conformers. The reference molecule is held rigid and the fit molecule orientation is calculated to maximize overlap. Each conformer of the fit molecule is optimized against each conformer of the reference molecule, resulting in a large number of results that can be returned. The OEBestOverlayResults and OEBestOverlayScore classes are used to make handling this large amount of results easier.
Additionally, the reference or fit shape can be a grid instead of a molecule.
Since an OEBestOverlay optimization can result in numerous final
results, one for each starting position, the
OEBestOverlayResults class is a container to hold
all the results for a fit conformer against a reference
conformer. This class is essentially a container for one or more
OEBestOverlayScore instances. The actual number
of scores depends on the OEBOOrientation used
in the OEBestOverlay.
For OEBOOrientation_Inertial, there will be 4,
8 or 20 scores per ref-fit conformer pair, depending on the
symmetry of each conformer. For
OEBOOrientation_AsIs, there will be just 1
OEBestOverlayScore inside each
OEBestOverlayResults instance. And for
OEBOOrientation_Random, then there will be 1 OEBestOverlayScore for
each of the N random starts.
When dealing with the results from OEBestOverlay, the user can either use a double loop, i.e. loop over all the OEBestOverlayResults instances for each ref-fit conformer pair then loop over each OEBestOverlayScore inside each OEBestOverlayResults instance. In this case, the results also come out in conformer order.
for res in best.Overlay(fitmol):
for score in res.GetScores():
# do something with score
Or, there is a free function
OESortOverlayScores, that takes an iterator of
OEBestOverlayResults and returns a single, sorted iterator of
OEBestOverlayScores that can be used in a single loop.
scoreiter = OEBestOverlayScoreIter()
OESortOverlayScores(scoreiter, best.Overlay(fitmol), OEHighestTanimotoCombo())
for score in scoreiter:
# do something with score
Constructors
OEBestOverlay() -> OEBestOverlay
OEBestOverlay(refmol: OEMol) -> OEBestOverlay
OEBestOverlay(refgrid: OEScalarGrid, interpolate: float = 0.5) -> OEBestOverlay
OEBestOverlay(arg2: OEBestOverlay) -> OEBestOverlay
An empty OEBestOverlay class instance can be created, or a new instance can take the reference molecule or grid as an argument. Note that by default, grids that have a resolution larger that 0.5 Å will be interpolated to that resolution.
ClearColorForceField
ClearColorForceField() -> None
Clear out any color force field. No color scores will be calculated.
ClearUserStarts
ClearUserStarts() -> None
Set the number of User Starts back to zero.
GetCarbonRadius
GetCarbonRadius() -> float
Return the current value for the carbon radius approximation.
GetInitialOrientation
GetInitialOrientation() -> int
Get the current value for initial orientation. Possible values are from the
OEBOOrientation namespace.
GetMaxRandomTranslation
GetMaxRandomTranslation() -> float
Get the value in Å of maximum random translation.
GetMethod
GetMethod() -> int
Return the current value of overlap method.
GetMinimizeType
GetMinimizeType() -> int
Get the current value for minimize type. Possible values are from the
OEBOMinType namespace.
GetNumRandomStarts
GetNumRandomStarts() -> int
Get the current number of random starts.
GetNumUserStarts
GetNumUserStarts() -> int
Get the number of user starts currently set. Note that these are not actually
used unless OEBOOrientation_UserInertialStarts is also set.
GetRadiiApproximation
GetRadiiApproximation() -> int
Return the current value of the radii approximation.
GetRandomSeed
GetRandomSeed() -> int
Get the current value of the random seed.
GetRefGrid
GetRefGrid() -> OEScalarGrid
GetRefMol
GetRefMol() -> OEMol
GetRefSelfColor
GetRefSelfColor() -> float
Return the self color score of the reference molecule.
GetRefSymmetry
GetRefSymmetry(confIdx: int) -> int
Return the current representation level.
GetSymmetryThreshold
GetSymmetryThreshold() -> float
GetUseHydrogens
GetUseHydrogens() -> bool
Return the status of hydrogen use in OEBestOverlay.
GetUserStarts
GetUserStarts(xyz: OEFloatArray) -> bool
Extract the coordinates of the user starts. xyz should be sized to
3 * GetNumUserStarts().
Overlay
Overlay(fitmol: OEMol) -> Iterable[OEBestOverlayResults]
Perform the calculation and return the an iterator of the results.
SetCarbonRadius
SetCarbonRadius(cradius: float) -> None
Set the radius to use when using
OEOverlapRadii_Carbon. By default this is
set to 1.7 Å.
SetColorForceField
SetColorForceField(type: int) -> bool
SetColorForceField(ifs: oeistream) -> bool
SetColorForceField(filename: str) -> bool
SetColorForceField(cff: OEColorForceField) -> bool
Set the color force field to be used. Once set, color scores will be calculated and included in the results. Color gradients will not be included in the optimization unless specifically set using SetColorOptimize(true).
SetColorOptimize
SetColorOptimize(state: bool) -> None
Add color gradients to shape gradients in the optimization. Has no effect unless
a color force field is also set via OEBestOverlay.SetColorForceField.
SetInitialOrientation
SetInitialOrientation(orient: int) -> None
Determines the initial orientation (starting position) for each
optimization. The default is
OEBOOrientation_Inertial. Alternatives are defined
in the OEBOOrientation namespace.
SetMaxRandomTranslation
SetMaxRandomTranslation(trans: float) -> None
If using random starts, this set the maximum distance (in Å) that the center of mass of the fit molecule will be moved away from the center calculated for inertial frame alignment.
SetMethod
SetMethod(method: int) -> None
Set the method used to calculate overlap. The default for
OEBestOverlay is OEOverlapMethod_Grid. Alternatives are defined
in the OEOverlapMethod namespace.
SetMinimizeType
SetMinimizeType(type: int) -> None
Set the score to use in the optimization. Options are in the
OEBOMinType namespace.
SetNumRandomStarts
SetNumRandomStarts(n: int) -> None
If SetInitialOrientation is set to
OEBOOrientation_Random, this method sets
the number of random starting positions that will be used.
SetRadiiApproximation
SetRadiiApproximation(type: int) -> None
Set the radius approximation used to calculate overlap. The
default for OEBestOverlay is
OEOverlapRadii_Carbon. Alternatives are
defined in the OEOverlapRadii namespace.
SetRandomSeed
SetRandomSeed(seed: int) -> None
Set a random seed value to allow reproducible random searches.
SetRefGrid
SetRefGrid(refgrid: OEScalarGrid, interpolate: float = 0.5) -> bool
Set a reference grid for the calculation. OEBestOverlay makes an internal copy. Pre-existing reference molecules or grids are replaced.
SetRefMol
SetRefMol(refmol: OEMol) -> bool
Set a reference molecule for the calculation. OEBestOverlay makes an internal copy. Pre-existing reference molecules or grids are replaced.
SetSymmetryThreshold
SetSymmetryThreshold(threshold: float) -> None
SetUseHydrogens
SetUseHydrogens(state: bool) -> None
Boolean to determine whether hydrogens are included in the shape calculation. By default this is false and hydrogens are ignored.
SetUserStarts
SetUserStarts(xyz: OEFloatArray, nstarts: int) -> None
Set a set of 3D coordinates for doing separate inertial
starts. xyz should be 3 * nstarts. These are not used unless
OEBOOrientation_UserInertialStarts is also set.