Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#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

  • picture of a molecule showing the bug

     
    Attachments
  • 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);

     
  • Logged In: YES
    user_id=25678
    Originator: NO

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