Hello,

I am using the openbabel python module to compute the InChi string of an
obmol object. However, I have to construct the obmol manually like so: 

 # Coordinates is this format:
((O,(0.0,0.0,0.0)),(H,(1.0,0.0,0.0)),(H,(-1.0,0.0,0.0)) 
 mol = openbabel.OBMol() 
 for entry in coordinates: 
        newAtom = mol.NewAtom()
        newAtom.SetAtomicNum(symbolToNumber(entry[0]))
        newAtom.SetVector(*(map(float,entry[1])))

Therefore, I need to have an OBConverter object with no input format and
output format, ideally like this:

converter.SetInAndOutFormats(None,"inchi")

However, calling this and then doing:

inchi = converter.WriteString(mol)

just returns a blank string, even when mol is populated correctly. Is my
problem with the setup of OBConverter or is it something else? I appreciate
any insight. 

Thank you,

Sam Manzer

--
View this message in context: 
http://forums.openbabel.org/OBConversion-of-mol-object-without-input-format-tp3808639p3808639.html
Sent from the openbabel-scripting mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting

Reply via email to