OEArea

class OEArea

Calculates surface area using the same grid-based Gaussians that Zap uses. Mostly used for calculating the area term in solvation calculations or the buried area term in bind calculations.

Constructors

OEArea() -> OEArea
OEArea(arg2: OEArea) -> OEArea

Default and copy constructors.

GetArea

GetArea(mol: Union[OEGraphMol,OEMol,OEQMol]) -> float
GetArea(mol: Union[OEGraphMol,OEMol,OEQMol], atomArea: OEFloatArray) -> bool
GetArea(mol: Union[OEGraphMol,OEMol,OEQMol], res: OEResidue) -> float
GetArea(mol: Union[OEGraphMol,OEMol,OEQMol],
        atom_area: OEFloatArray, res: OEResidue) -> float

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 to false by default.

The following demonstrates how to calculate the area of a molecule:

Example of calculating the surface area of a molecule

area = oezap.OEArea()
a = area.GetArea(mol)
print("Molecule area =", a)

Full listing.

The following demonstrates how to retrieve the individual atom contributions to the surface area:

Example of calculating the surface area contribution of individual atoms

atomArea = oechem.OEFloatArray(mol.GetMaxAtomIdx())
area = oezap.OEArea()
area.GetArea(mol, atomArea)

for atom in mol.GetAtoms():
    idx = atom.GetIdx()
    print(idx, atomArea[idx])

Full listing.

The following demonstrates how to retrieve the per residue contributions to the surface area:

Example of calculating the surface area contribution of indivdual residues

area = oezap.OEArea()

for res in oechem.OEGetResidues(mol):
    print (area.GetArea(mol, res))

Full listing.

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

atomArea = oechem.OEFloatArray(mol.GetMaxAtomIdx())
area = oezap.OEArea()
area.GetArea(mol, atomArea)

for res in oechem.OEGetResidues(mol):
    print (area.GetArea(mol, atomArea, res))

Full listing.

GetMethod

GetMethod() -> int

Returns an int indicating the method that is used to model the area of the molecule. The two possible return values are OEAreaMethod_Gaussian and OEAreaMethod_Discrete.

GetUseHydrogens

GetUseHydrogens() -> bool

Returns a bool where true means explicit hydrogens are turned on and false means they are turned off for the area calculation.

SetMethod

SetMethod(method: int) -> bool

Takes an int with the value of OEAreaMethod_Gaussian of OEAreaMethod_Discrete

SetUseHydrogens

SetUseHydrogens(state: bool) -> bool

This method takes a bool where true turns on explicit hydrogens for calculating area and false turn them off.