> I would like to get an advise, if I can name the PNG image file with the name 
> of the formula in SDF.
...
> And I need a PNG file ZINC40154034.png

You can't do this directly with the obabel command-line program, but you can do 
this pretty easily in Python:

http://open-babel.readthedocs.io/en/latest/UseTheLibrary/PythonExamples.html#split-an-sdf-file-using-the-molecule-titles
 
<http://open-babel.readthedocs.io/en/latest/UseTheLibrary/PythonExamples.html#split-an-sdf-file-using-the-molecule-titles>

You'd want something like this:
import pybel
for mol in pybel.readfile("sdf", "bigmol.sdf"):
   mol.write("png", "%s.png" % mol.title)

Replace the "for mol" loop as appropriate (e.g., use the "glob" python module 
to loop through file names).

Hope that helps,
-Geoff
------------------------------------------------------------------------------
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