Collections:
"babel -h" Command - Add Hydrogens to Molecule Data
How to add hydrogen atoms to molecule data during data conversion?
✍: FYIcenter.com
 Most molecules contains many hydrogen atoms. 
When molecules are written in many data formats, those hydrogen atoms are 
removed. We normally can read molecule structure without hydrogen atoms.
Most molecules contains many hydrogen atoms. 
When molecules are written in many data formats, those hydrogen atoms are 
removed. We normally can read molecule structure without hydrogen atoms.  
But if you want to add those removed hydrogen atoms back during the molecule data conversion process, you can use the "babel" generic option "-h" as shown in the example below:
fyicenter$ obabel -:c1ccccc1 -o sdf --gen2D -h
 OpenBabel05212009372D
 12 12  0  0  0  0  0  0  0  0999 V2000
   -0.8660   -0.5000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.7321   -0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.7321    1.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.8660    1.5000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000    1.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.8660   -1.5320    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.6258   -0.5160    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.6258    1.5160    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.8660    2.5320    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.8937    1.5160    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.8937   -0.5160    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  6  1  0  0  0  0
  1  2  2  0  0  0  0
  1  7  1  0  0  0  0
  2  3  1  0  0  0  0
  2  8  1  0  0  0  0
  3  4  2  0  0  0  0
  3  9  1  0  0  0  0
  4  5  1  0  0  0  0
  4 10  1  0  0  0  0
  5  6  2  0  0  0  0
  5 11  1  0  0  0  0
  6 12  1  0  0  0  0
M  END
$$$$
1 molecule converted
As you can see from the output, 6 hydrogen atoms were added back to the benzene molecule, because of the "-h" option. Without the "-h" option, "babel" command converts only carbon atoms of the benzene molecule that are specified in the input SMILES string.
As a comparison, here is the output of the above "babel" command without the "-h" option:
fyicenter$ obabel -:c1ccccc1 -o sdf --gen2D
 OpenBabel05212009382D
  6  6  0  0  0  0  0  0  0  0999 V2000
   -0.8660   -0.5000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.7321   -0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.7321    1.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.8660    1.5000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000    1.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
  1  6  1  0  0  0  0
  1  2  2  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4  5  1  0  0  0  0
  5  6  2  0  0  0  0
M  END
$$$$
1 molecule converted
⇒ "babel -d" Command - Delete Hydrogens from Molecule Data
⇐ "babel ... -f # -l #" - Split Large Molecule File
2020-07-15, 4303🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1000960 SMILES: COc1cc(CCC(=O)/C=C/CCc2c c(OC)c(O)c(OC)c2)ccc1OReceived at...
Molecule Summary: ID: FYI-1003919 Names: InChIKey: WPLOOJLSWIHXCU-UHFFFAOYS A-NSMILES: CCc4nc(C(N)=O...
Molecule Summary: ID: FYI-1002035 Names: InChIKey: JZRWCGZRTZMZEH-UHFFFAOYS A-NSMILES: CC1=C(SC=[N+]...
Can I search for a molecule by its InChIKey? Yes. You can search for a molecule by its InChIKey usin...
Molecule Summary: ID: FYI-1003629 Names: InChIKey: MAYDHTMNDDNOQD-UHFFFAOYS A-NSMILES: CCN3CCN(Cc2nn...