Erroneous molecule from MDL file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Erroneous molecule from MDL file

cgram
Hi,

I have this MDL file (I removed the header):

 12 11  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  5  1  0  0  0  0
  1  2  1  0  0  0  0
  2  3  1  0  0  0  0
  3  9  1  0  0  0  0
  3  8  1  0  0  0  0
  3  4  1  0  0  0  0
  4 11  1  0  0  0  0
  4 10  1  0  0  0  0
  4  5  1  0  0  0  0
  5 12  1  0  0  0  0
  5  6  1  0  0  0  0
  6  7  1  0  0  0  0
M  END

It should correspond to this molecule: O1OCCC1O (in SMILES format). I verified the MDL file manually. However, when I convert the file to a SMILES string with openbabel, I get this: O1OCCC1O.[H], which is almost correct, but for some reason it decides to add on a random hydrogen. I am treating the hydrogens explicitly in the MDL file, because I have to keep track of their exact indices, so I cannot remove them from the file. The script I am using is

import pybel

mol = pybel.readfile('mdl', 'mol.mdl').next()
print mol.write(format='smi')

What am I missing?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erroneous molecule from MDL file

Craig James-2


On Wed, Jun 15, 2016 at 3:22 PM, cgram <[hidden email]> wrote:
Hi,

I have this MDL file (I removed the header):

 12 11  0  0  0  0  0  0  0  0999 V2000

With 12 atoms and 11 bonds, this structure can't be right if it has a ring in it. It would have to have 12 bonds.

Craig
 
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  5  1  0  0  0  0
  1  2  1  0  0  0  0
  2  3  1  0  0  0  0
  3  9  1  0  0  0  0
  3  8  1  0  0  0  0
  3  4  1  0  0  0  0
  4 11  1  0  0  0  0
  4 10  1  0  0  0  0
  4  5  1  0  0  0  0
  5 12  1  0  0  0  0
  5  6  1  0  0  0  0
  6  7  1  0  0  0  0
M  END

It should correspond to this molecule: O1OCCC1O (in SMILES format). I
verified the MDL file manually. However, when I convert the file to a SMILES
string with openbabel, I get this: O1OCCC1O.[H], which is almost correct,
but for some reason it decides to add on a random hydrogen. I am treating
the hydrogens explicitly in the MDL file, because I have to keep track of
their exact indices, so I cannot remove them from the file. The script I am
using is

import pybel

mol = pybel.readfile('mdl', 'mol.mdl').next()
print mol.write(format='smi')

What am I missing?



--
View this message in context: http://forums.openbabel.org/Erroneous-molecule-from-MDL-file-tp4659331.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss



--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erroneous molecule from MDL file

cgram
Oh wow, of course it ends up being something small like that. Thanks a lot for your help!
Loading...