bool OECalcPMI(double* pmi, OEMolBase &mol)
Calculates the PMI (principal moment of inertia) of the given molecule. Units of the PMI calculated are mass_unit, where mass_unit and length_unit are those used to set the radius.
Returns true if calculation is successful, false otherwise. The function returns false if the values for the PMI are all 0.0.
This pointer is populated by the PMI of the given molecule in each dimension, X, Y, and Z.
This is the molecule for which the PMI is calculated. It must have a set radius and set mass for the calculation to be valid.
The following code snippet demonstrates how to calculate the PMI and radius of gyration for a molecule.
mol = oechem.OEGraphMol() pmi = oechem.OEDoubleArray(3) oechem.OESmilesToMol(mol, "C(O)(=O)c1cccc2c1[nH]c(C3CCCc4c3cccc4)c2") oechem.OECalcPMI(pmi, mol) print("PMI:\n") for i in range(3): print(pmi[i]) rGyr = oechem.OEDoubleArray(3) oechem.OEGetRadiusOfGyration(rGyr, pmi, mol) print("Radius of Gyration\n") for i in range(3): print(rGyr[i])