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
openbabel.  When I use the pybel.Molecule function calcdesc() I get many
descriptors back, but the InChI/Smiles/Smarts descriptors are all 'nan'.
I've copied some of the code below, followed by its output.

You can mostly ignore the stuff unrelated to pybel, it is related to my
personal molecule class that I use.

    a,b = db_read_tooltip()
    b.printxyz()

    mol = openbabel.OBMol()

    for atom in b.system:
        a = mol.NewAtom()
        a.SetAtomicNum(atom.element)
        a.SetVector(atom.X,atom.Y,atom.Z)

    pybelmol = pybel.Molecule(mol)
    print(pybelmol.formula)
    print(pybelmol.calcdesc())



The pybelmol.calcdesc() produces the following:

{'TPSA': 36.92, 'smarts': nan, 'HBD': 6.0, 'nF': 0.0, 'logP':
5.6061000000000005, 'title': nan, 'MW': 329.4691799999999, 'tbonds': 0.0,
'cansmi': nan, 'InChI': nan, 'formula': nan, 'InChIKey': nan, 'bonds': 0.0,
'atoms': 27.0, 'L5': nan, 'HBA1': 18.0, 'HBA2': 4.0, 'sbonds': 0.0,
'cansmiNS': nan, 'dbonds': 0.0, 's': nan, 'MP': -173.67049999999998, 'MR':
94.88419999999998, 'abonds': 0.0}

Thanks for your help.

Matthew Kennedy
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to