# OEGetXLogPResult¶

OEGetXLogPResult(OEMolBase mol, OEFloatArray atomxlogps=None) -> OEXLogPResult


Returns an OEXLogPResult object. The object contains the XLogP for the given molecule as described in the LogP section and a boolean flag indicating whether or not the computation is valid. The main reason the computation may fail is if one or more atoms are not parameterized. The returned value will be equal to the sum on the individual atom contributions plus the linear regression constant -0.127.

The atomxlogps parameter can be used to retrieve the contribution of each atom to the total XLogP as shown in Listing 2. See example in Figure: Example of depicting the atom contributions of the XLogP.

This function exists to make the calling by wrapped languages more convenient. This function should be preferred over the original OEGetXLogP function for wrapped languages.

Listing 2: Example of retrieving individual atom contributions to XLogP

atomXLogP = OEFloatArray(mol.GetMaxAtomIdx())
result = OEGetXLogPResult(mol, atomXLogP)

if (result.IsValid()):
print("XLogP =", result.GetValue())
for atom in mol.GetAtoms():
idx = atom.GetIdx()
print(idx, atomXLogP[idx])
else:
print("XLogP failed for molecule")


Example of depicting the atom contributions of the XLogP