Menu

#993 InChI to SVG stereochemical layer silent error

2.3.x
closed
1
2017-03-20
2017-03-18
No

SVG output when inputting InChIs with sp3 information is broken. No svg file is outputted and it has no error in the program. Adding '-xT /sp3' has no effect in making the program run despite the fact the apparent error is due to tetrahedral stereochemistry information.

The input was:

obabel -iinchi /tmp/tmpnwiywrmy -osvg -xd -xC -xj -xr 1

The file executed is attached (also is below, it is a couple of InChIs.

InChI=1S/C4H9BrO/c1-3(5)4(2)6/h3-4,6H,1-2H3/t3-,4+/m1/s1
InChI=1S/Na.H2O/h;1H2/q+1;/p-1

If the output is changed to SMILES then the output is correct:

obabel -iinchi /tmp/tmpnwiywrmy -osmi
C[C@H]([C@H](C)O)Br 
[Na+].[OH-] 

Also if the tetrahedral stereochemistry layer is removed from the first InChI (i.e. InChI=1S/C4H9BrO/c1-3(5)4(2)6/h3-4,6H,1-2H3/m1/s1) the .svg is outputted correctly (albeit without stereochemistry)

obabel -iinchi /tmp/tmpnwiywrmy -osvg -xd -xC -xj -xr 1
<?xml version="1.0"?>
<svg version="1.1" id="topsvg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:cml="http://www.xml-cml.org/schema" x="0" y="0" width="100%" height="100%" viewBox="0 0 100 50">
<title>OBDepict</title>
<rect x="0" y="0" width="100" height="50" fill="white"/>
<g transform="translate(0,0)">
<svg width="50" height="50" x="0" y="0" viewBox="0 0 183.923 180"
font-family="sans-serif" stroke="rgb(0,0,0)" stroke-width="2"  stroke-linecap="round">
<line x1="74.6" y1="140.0" x2="74.6" y2="100.0" stroke="rgb(0,0,0)"  stroke-width="2.0"/>
<line x1="143.9" y1="100.0" x2="109.3" y2="80.0" stroke="rgb(0,0,0)"  stroke-width="2.0"/>
<line x1="74.6" y1="100.0" x2="109.3" y2="80.0" stroke="rgb(0,0,0)"  stroke-width="2.0"/>
<line x1="74.6" y1="100.0" x2="51.3" y2="86.5" stroke="rgb(0,0,0)"  stroke-width="2.0"/>
<line x1="109.3" y1="80.0" x2="109.3" y2="53.0" stroke="rgb(0,0,0)"  stroke-width="2.0"/>
<text x="22.000000" y="88.000000" fill="rgb(165,40,40)"  stroke="rgb(165,40,40)" stroke-width="1" font-size="16" >Br</text>
<text x="103.282032" y="48.000000" fill="rgb(255,12,12)"  stroke="rgb(255,12,12)" stroke-width="1" font-size="16" >OH</text>
</svg>
</g>
<g transform="translate(50.000000,0.000000)">
<svg width="50.000000" height="50.000000" x="0" y="0" viewBox="0 0 81.000000 80.000000"
font-family="sans-serif" stroke="rgb(0,0,0)" stroke-width="2.000000"  stroke-linecap="round">
<text x="45.800000" y="35.968000" fill="rgb(170,91,242)"  stroke="rgb(170,91,242)" stroke-width="1" font-size="16" >+</text>
<text x="35.000000" y="48.000000" fill="rgb(170,91,242)"  stroke="rgb(170,91,242)" stroke-width="1" font-size="16" >Na</text>
<text x="44.800000" y="25.888000" fill="rgb(255,12,12)"  stroke="rgb(255,12,12)" stroke-width="1" font-size="16" >_</text>
<text x="34.000000" y="48.000000" fill="rgb(255,12,12)"  stroke="rgb(255,12,12)" stroke-width="1" font-size="16" >OH</text>
</svg>
</g>
</svg>

This problem is reproducable across several standard InChIs with stereochemical layers.

1 Attachments

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2017-03-20

    Works for me with OB 2.4.1. I recall that I fixed an InChI bug at some point.

     
  • Noel O'Boyle

    Noel O'Boyle - 2017-03-20
    • status: open --> closed
    • assigned_to: Noel O'Boyle
     
MongoDB Logo MongoDB