Menu

#947 cml reader ignores hydrogenCount attribute

2.3.x
open
nobody
CML (2)
5
2014-11-10
2014-11-10
No

As per help Open Babel should not try to add implicit hydrogen atoms if hydrogenCount="0" is given.

$ obabel -V
Open Babel 2.3.2 -- Jan 21 2014 -- 23:20:09
$ obabel -Hcml
...
In the absence of hydrogenCount and any explicit hydrogen on
an atom, implicit hydrogen is assumed to be present appropriate
to the radical or spinMultiplicity attributes on the atom or
its normal valency if they are not present.
...

However Open Babel 2.3.2 seems to ignore this attribute:

$ obabel Si2.cml -o smi 
[SiH3][SiH3]    mol9999
1 molecule converted

Si2.cml:

<molecule xmlns="http://www.xml-cml.org/schema" 
    xmlns:cmlx="http://www.xml-cml.org/schema/cmlx" 
    xmlns:convention="http://www.xml-cml.org/convention/" 
    xmlns:cc="http://www.xml-cml.org/dictionary/compchem/" 
    xmlns:compchem="http://www.xml-cml.org/dictionary/compchem/" 
    xmlns:g="http://www.xml-cml.org/dictionary/gaussian/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:nonsi="http://www.xml-cml.org/unit/nonSi/" 
    xmlns:cml="http://www.xml-cml.org/dictionary/cml/" 
    id="mol9999" 
    spinMultiplicity="1" 
    formalCharge="0">
  <atomArray>
    <atom id="a1" elementType="Si" x3="0.0" y3="0.0" z3="-0.2010959542" hydrogenCount="0"/>
    <atom id="a2" elementType="Si" x3="0.0" y3="0.0" z3="1.8510959542" hydrogenCount="0"/>
  </atomArray>
  <bondArray>
    <bond atomRefs2="a1 a2" id="a1_a2" order="unknown"/>
  </bondArray>
  <property dictRef="cml:molmass">
    <scalar xmlns:unit="http://www.xml-cml.org/unit/si/" dataType="xsd:double" units="unit:dalton">56.171</scalar>
  </property>
  <formula concise="Si 2"/>
</molecule>
1 Attachments

Discussion