OEArea¶
class OEArea
This class represents OEArea. OEArea is a simple object that calculates surface area using the same grid-based Gaussians that Zap uses. This class is mostly used for calculating the area term in solvation calculations or the buried area term in bind calculations.
GetArea¶
float GetArea(const OEChem::OEMolBase &mol) bool GetArea(const OEChem::OEMolBase &mol, float *atomArea) float GetArea(const OEChem::OEMolBase &mol, const OEChem::OEResidue &res) float GetArea(const OEChem::OEMolBase &mol, const float *atomArea, const OEChem::OEResidue &res)Calculate the surface area of the passed-in molecule. The first version calculates the surface area of the entire molecule. The second version takes an array sized by
OEMolBase::GetMaxAtomIdx
to return the contribution of each atom to the total surface area. The third and fourth versions calculates and returns the surface area of the residue passed into the function. The fourth version differs from the third version by taking a already calculated atom area array, which avoids calculating atom area repeatedly.Note that whether or not hydrogens are included in these calculations is controlled by
OEArea::SetUseHydrogens
which is set tofalse
by default.The following demonstrates how to calculate the area of a molecule:
Example of calculating the surface area of a molecule
OEArea area; float a = area.GetArea(mol); std::cout << "Molecule area = " << a << std::endl;The following demonstrates how to retrieve the individual atom contributions to the surface area:
Example of calculating the surface area contribution of individual atoms
// declare an array of the correct size for atom values std::vector<float> atomArea(mol.GetMaxAtomIdx()); OEArea area; area.GetArea(mol, &atomArea[0]); for (OEIter<OEAtomBase> atom = mol.GetAtoms(); atom; ++atom) { unsigned int idx = atom->GetIdx(); std::cout << idx << " " << atomArea[idx] << std::endl; }The following demonstrates how to retrieve the per residue contributions to the surface area:
Example of calculating the surface area contribution of indivdual residues
// No need to declare an array of the correct size for atom values OEArea area; for (OEIter<OEResidue> res = OEGetResidues(mol); res; ++res) { float resArea = area.GetArea(mol, res); std::cout << OEResidueToString(res, ":") << " " << resArea << std::endl; }The following demonstrates how to retrieve the per residue contributions to the surface area, in an optimized way where the per atom contributions are pre-calculated and used for the residue based calculation. This is particularly important if this calculation is done on a large set of residues:
Example of calculating the surface area contribution of indivdual residues
// declare an array of the correct size for atom values for performance in repeated calls std::vector<float> atomArea(mol.GetMaxAtomIdx()); OEArea area; area.GetArea(mol, &atomArea[0]); for (OEIter<OEResidue> res = OEGetResidues(mol); res; ++res) { float resArea = area.GetArea(mol, &atomArea[0], res); std::cout << OEResidueToString(res, ":") << " " << resArea << std::endl; }
GetMethod¶
unsigned int GetMethod() constReturns an
int
indicating the method that is used to model the area of the molecule. The two possible return values areOEAreaMethod::Gaussian
andOEAreaMethod::Discrete
.
GetUseHydrogens¶
bool GetUseHydrogens() constReturns a
bool
wheretrue
means explicit hydrogens are turned on andfalse
means they are turned off for the area calculation.
SetMethod¶
bool SetMethod(const unsigned int method)Takes an
int
with the value ofOEAreaMethod::Gaussian
ofOEAreaMethod::Discrete
SetUseHydrogens¶
bool SetUseHydrogens(bool state)This method takes a
bool
wheretrue
turns on explicit hydrogens for calculating area andfalse
turn them off.