#543 Too many hydrogens attached to amines

master
closed
nobody
5
2012-10-08
2007-09-11
Anonymous
No

The StructureDiagramGenerator depicts to many hydrogens attached to primary, secondary and tertiary amines if the molecule is optained using the SmilesParser. It seems that this bug does not occur if the molecule depicted is optained from a SDF-file.

Discussion

  • Nobody/Anonymous

    picture of a molecule showing the bug

     
  • Nobody/Anonymous

    Logged In: NO

    The bug can be hand fixed by user if you add implicit hydrogens before depiction.

    Pseudo code:

    IMolecule mol;
    StructureDiagramGenerator sdg;
    HydrogenAdder hAdder;

    hAdder.addImplicitHydrogensToSatisfyValency(mol);

    sdg.setMolecule(mol);
    sdg.generateCoordinates();
    mol = sdg.getMolecule();
    viewer.display(mol,true);

     
  • Egon Willighagen

    Logged In: YES
    user_id=25678
    Originator: NO

    That is caused by a bug in the old HydrogenAdder. Fixed by the CDKHydrogenAdder in trunk/.