#61 Strange behaviour of Renderer2D with Hs

closed
5
2012-10-08
2003-02-25
Stefan Kuhn
No

If I render the same molecule with Renderer2D with the
implicit Hs as explicit atoms the result looks strange.
The molecule I used was the following without Hs (as mdl):
10 10 0 0 0 0 0 0 0 0 1 V2000
42.0000 7.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 3.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 10.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
65.0000 7.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 2.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 12.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
53.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
31.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
20.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
49.0000 13.0000 0.0000 O 0 0 0 0 0 0 0
0 0 0 0 0
5 4 1 0 0 0 0
6 4 1 0 0 0 0
6 5 1 0 0 0 0
7 1 1 0 0 0 0
7 4 1 0 0 0 0
8 1 1 0 0 0 0
9 2 1 0 0 0 0
9 3 1 0 0 0 0
9 8 1 0 0 0 0
10 1 2 0 0 0 0
M END
All works fine. The same with Hs:
23 23 0 0 0 0 0 0 0 0 1 V2000
42.0000 7.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 3.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 10.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
65.0000 7.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 2.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 12.0000 0.0000 C 0 0 0 0 0 0 0
0 0 0 0 0
53.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
31.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
20.0000 7.0000 0.0000 N 0 0 0 0 0 0 0
0 0 0 0 0
49.0000 13.0000 0.0000 O 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 3.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 3.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 3.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 10.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 10.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
9.0000 10.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
65.0000 7.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 2.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 2.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 12.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
79.0000 12.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
53.0000 7.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
31.0000 7.0000 0.0000 H 0 0 0 0 0 0 0
0 0 0 0 0
5 4 1 0 0 0 0
6 4 1 0 0 0 0
6 5 1 0 0 0 0
7 1 1 0 0 0 0
7 4 1 0 0 0 0
8 1 1 0 0 0 0
9 2 1 0 0 0 0
9 3 1 0 0 0 0
9 8 1 0 0 0 0
10 1 2 0 0 0 0
2 11 1 0 0 0 0
2 12 1 0 0 0 0
2 13 1 0 0 0 0
3 14 1 0 0 0 0
3 15 1 0 0 0 0
3 16 1 0 0 0 0
4 17 1 0 0 0 0
5 18 1 0 0 0 0
5 19 1 0 0 0 0
6 20 1 0 0 0 0
6 21 1 0 0 0 0
7 22 1 0 0 0 0
8 23 1 0 0 0 0
M END
and the result gets bad looking. Notice that the
coordinates for the Hs are the same as for their
"parent" atom, but this should just lead to atoms
painted at the same place.

Discussion

  • Christoph Steinbeck

    Logged In: YES
    user_id=54358

    This bug has become obsolete with the new working version of
    HydrogenPlacer. If you have a 2D model with coordinates
    without hydrogens, you can simply use the
    HydrogenAdder.addExplicitHydrogensToSatisfyValency(Molecule
    molecule) to get hydrogens added to the molecule and have
    them layouted. If you have a molecule without coordinates
    and hydrogens, make a layout of it and then use
    HydrogenAdder.addExplicitHydrogensToSatisfyValency(Molecule
    molecule).

     
  • Christoph Steinbeck

    Logged In: YES
    user_id=54358

    Here is a screenshot of the behavious of the fix, based on
    the orignal example given in the bug report. Please note
    that the bad layout at the N is another bug :-)