I'm not a chemist but I know someone who is (my boss),
so excuse me if I've made a chemical blunder here...
We are using
ac = new MFAnalyser(ac).removeHydrogens();
to render all hydrogens implicitly in a Renderer2D. In
general, this works well. However, for some exotic
molecules that have hydrogens bound to multiple atoms
(e.g. boranes) then removeHydrogens() disconnects the
molecule and gets the hydrogenCount wrong (e.g. B2H6
becomes two separate BH3).
Attached is a patch for this problem that
1) adds a new private method
MFAnalyser.removeHydrogens(List preserve) that allows
you to remove hydrogens except those passed in the
perserve List. It also gets the hydrogenCount correct.
2) MFAnalyser.removeHydrogens() simply calls
3) adds a new public method
that calls MFAnalyser.removeHydrogens(mulitple_h),
where multiple_h are the hydrogen atoms bound to
To apply the patch
%> cd cdk-source-20040324
%> patch -p1 < MFAnalyser.removeHydrogens_patch.diff
This fixes the problem and all jUnit tests pass.
Log in to post a comment.