I'was having related problems when manually building an OBMol from external data like
Matthew, so I've tested calculating descriptors, and I found I get a bunch of Nan's, too.
My data contains coordinates, elements and bond orders, so I add to the molecule both
OBAtom's and OBBond's (in between
Hi Matthew,
could it be that your code fails to provide the connectivity information, i.e.
which atoms are connected by bonds ? Trying to generate a smiles/inchi on
disconnected atoms makes no sense, which would explain the nan-values ?
OBabel should be able to guess / generate this information
I tested both these cases.
1) If I call mol.ConnectTheDots() then cast the OBMol to a pybel.Molecule,
calcdesc() still returns nan for SMILES/INCHI/SMARTS, but the
OBMol.numBonds gets set to the appropriate number.
2) If I call mol.PerceiveBondOrder() then cast the OBMol to a
pybel.Molecule, cal
> I am attempting to begin using pybel/openbabel to calculate inchi strings on
> the fly without having to write temporary files and use command line open
> babel.
Try this as a workaround:
inchi = pybelmol.write(‘inchi’)
smiles = pybelmol.write(‘can’)
I’m wondering if there’s something subt