Another Python options question.
I can use the protonation option on the CLI:

echo "C1=C(NC=N1)C[C@@H](C(=O)O)N" | obabel -i smi -o mol -p 3
But I can't figure it out with the Python API:

import openbabel

obConversion = openbabel.OBConversion()
obConversion.SetInAndOutFormats("smi", "mol")
mol = openbabel.OBMol()
obConversion.AddOption("p", obConversion.GENOPTIONS, "3.0")
obConversion.ReadString(mol, "C1=C(NC=N1)C[C@@H](C(=O)O)N")
output = obConversion.WriteString(mol)
print output
Output is generated but it's not protonated. Same if using OUTOPTIONS instead of GENOPTIONS.

Is the use of the options in Python documented anywhere?





_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to