# OEScore¶

class OEScore


OEScore is a class for scoring and optimizing poses within the active site. Use of this class is as follows:

1. Choose a scoring function at construction time by passing one of the following constants to the constructor
2. Initialize the active site by passing either a receptor (see Receptors chapter) or a protein and box to the OEScore.Initialize method.
3. Score or optimize the molecules using:

Note

The following free function can take OEScore objects.

## Constructor¶

OEScore(const unsigned int scoring = OEScoreType::Default)


Constructs OEScore to use the specified scoring function from the OEScoreType namespace.

## IsInitialized¶

bool IsInitialized() const


Returns true if this object has been successfully initialized and is ready to score poses.

## Initialize¶

Sets up this object to score poses within an active site. Initialization can be done with either a receptor or a protein and box enclosing the active site.

Both overloads return true if setup was successful.

bool Initialize(const OEChem::OEMolBase& receptor)


This overload of OEScore.Initialize takes a receptor.

receptor
A receptor describing the active site of the target protein (see Receptors chapter). This object does not depend upon receptor once this call is completed (i.e. receptor can be destroyed after calling this method).
bool Initialize(const OEChem::OEMolBase& protein,
const OEBoxBase& box)


This overload of OEScore.Initialize takes a protein and box.

protein
The structure of a target protein. This object does not depend upon receptor once this call is completed (i.e. protein can be destroyed after calling this method).
box
An OEBoxBase enclosing active site.

## GetName¶

std::string GetName() const


Returns the name of the scoring function.

## GetComponentNames¶

OESystem::OEIterBase<const std::string>* GetComponentNames() const


Returns the name of the scoring function components.

## GetHighScoresAreBetter¶

bool GetHighScoresAreBetter() const


Returns true if higher scores indicate a better result.

Returns false if lower scores indicate a better result.

## ScoreLigand¶

float ScoreLigand(const OEChem::OEMolBase& pose)


Scores a pose within the active site.

pose
Structure of a pose within the active site

If an error occurs this function will return FLT_MAX if OEScore.GetHighScoresAreBetter returns false or -FLT_MAX otherwise.

## ScoreAtom¶

float ScoreAtom(const OEChem::OEAtomBase& atom,
const OEChem::OEMolBase& pose)


Returns the score of an atom of a given pose within the active site.

atom
Atom of pose to score.
pose
Structure of a pose within the active site

If an error occurs this function will return FLT_MAX if OEScore.GetHighScoresAreBetter returns false or -FLT_MAX otherwise.

## ScoreLigandComponent¶

float ScoreLigandComponent(const OEChem::OEMolBase& pose,
std::string compName)


Returns the given component’s contribution to the total score.

pose
Structure of a pose within the active site
compName
Name of the score component to report. Name must be one returned by OEScore.GetComponentNames.

If an error occurs this function will return FLT_MAX if OEScore.GetHighScoresAreBetter returns false or -FLT_MAX otherwise.

## ScoreAtomComponent¶

float ScoreAtomComponent(const OEChem::OEAtomBase& atom,
const OEChem::OEMolBase& pose,
std::string compName)


Returns the given components contribution to the score of a given atom score.

atom
Atom of pose to score.
pose
Structure of a pose within the active site
compName
Name of the score component to report. Name must be one returned by OEScore.GetComponentNames.

If an error occurs this function will return FLT_MAX if OEScore.GetHighScoresAreBetter returns false or -FLT_MAX otherwise.

## SystematicSolidBodyOptimize¶

Performs a solid body optimization on the pose or poses passed. Three rotational and three translational degrees of freedom are explored, the pose (and protein) are held rigid. A plus and minus rotational step is taken for each rotational and translational degree of freedom (for a total of 3^6 or 729 positions tested for each pose).

Both overloads return true if no error occurred.

bool SystematicSolidBodyOptimize(OEChem::OEMCMolBase& poses,
unsigned int searchResolution
= OESearchResolution::Default)


This overload of OEScore.SystematicSolidBodyOptimize optimizes all poses of an OEMCMolBase.

poses
An OEMCMolBase with conformers that are poses within the active site to be optimized.
searchResolution
Search resolution of the optimization (see OESearchResolution constant namespace).

The optimized poses are returned in poses. This poses retain their original ordering and are not ordered by the new optimized score.

bool SystematicSolidBodyOptimize(OEChem::OEMolBase& pose,
unsigned int searchResolution
= OESearchResolution::Default)


This overload of OEScore.SystematicSolidBodyOptimize optimizes a single pose.

pose
A pose within the active site to be optimized.
searchResolution
Search resolution of the optimization (see OESearchResolution constant namespace).

## AnnotatePose¶

Adds VIDA scoring annotation to the pose or poses passed.

The annotated poses must be written out in either oeb or oeb.gz format and are only viewable in VIDA.

bool AnnotatePose(OEChem::OEMolBase& pose)


This overload of OEScore.AnnotatePose annotates a single pose.

pose
Structure of a pose within the active site
bool AnnotatePose(OEChem::OEMCMolBase& poses)


This overload of OEScore.AnnotatePose annotates all poses of a given ligand.

poses
An OEMCMolBase the conformers of which are poses within the active site.

## CacheScoringSetup¶

This function caches the current scoring setup of the OEScore object onto a receptor object. When another OEScore object is initialized with this receptor the it will read in the cached score data rather than recalculating it from scratch, thus improving the startup time of the OEScore object.

bool CacheScoringSetup(OEChem::OEMolBase& receptor, bool clearOldData = true)

receptor
A receptor object. This must be the same receptor object the OEScore object was initialized with or an exact copy.
clearOldData
Flag to clear cached data from a prior call to CacheScoringSetup with this receptor. The cached data can be quite sizable (hundreds of megabytes), so leaving this flag at the default value of true is recommended.

Note

The cached score data on a receptor will be saved when the receptor is written to a file.