RDKit "Add Hs" node adds 3D Hs to 2D molecules


I just stepped on a strange behavior from the RDKIT "Add Hs" node.
When I try to add explicit hydrogens to a 2D molecule, hydrogens are in 3D.
The molecule is still flagged as RDKIT 2D but is a combination of 2D and 3D coordinates...

I attached a small workflow with a very simple molecule.

What am I doing wrong?
Is it possible to rather add 2D Hs to 2D mols and 3D Hs to 3D mols using RDKit?

Thank you for your help!

Jose Manuel

Supplementary Informations:
Knime 2.11.1
RDKit KNIME integration
ChemAxon/Infocom Marvin Extensions Feature    2.8.2.v0300

Hi Jose,

It's not currently possible to add Hs with 2D coordinates. The only way to do this would be to add the Hs normally and then generate 2D coordinates for the molecule again. This has the disadvantage of replacing the original coordinates, but it's what is currently there.

Out of curiousity: why are you interested in having 2D coordinates?


Hi Greg,

thank you for your reply!

I would like to do two separate tasks :
1) compute InChI code and InChI key
2) generate 3D conformations

The problem is that I start with 2D structures and whenever I add Hs with RDKIT, I get 2D-3D mixed coordinates. This can lead to stereochemistry errors when converting molecules back into SDF.

I attached a workflow with hand-drawn example molecules.

Jose Manuel