I had a hard time until I finally managed to add explicit hydrogens. It seems that in earlier versions of CDK, the HydrogenAdder class had a method 'addExplicitHydrogens()', but this class is now replaced with CDKHydrogenAdder, which handles only implicit hydrogens. After lots of experimenting, I wrote a function that basically copies a molecule and turns all implicit hydrogens into explicit:
Then I used the ModelBuilder3D class, as before, to create a 3D model:

I have no idea why the feature to add explicit hydrogens were removed from CDK. It is necessary eg. for proper docking, detecting hydrogen bonds, and so on. Maybe in later releases they will add it back; if not, you can use my snippet above as a substitute.

1 comments:
cdk.tools.manipulator.AtomContainerManipulator.convertImplicitToExplicitHydrogens
is your friend...
Post a Comment