Menu

#1382 No types defined for atoms with > 1 single electron

cdk-1.6.x
closed
nobody
cdk.core (2)
5
2016-08-11
2009-10-13
Stefan Kuhn
No

It looks like the atom typing is only taking one single electron into account. I had to add this code to ControllerHub.updateAtom in order to get correct H counts on atoms with multiple single electrons.
if(container.getConnectedSingleElectronsCount(atom)>1 && atom.getHydrogenCount()-container.getConnectedSingleElectronsCount(atom)+1>-1)
atom.setHydrogenCount(atom.getHydrogenCount()-container.getConnectedSingleElectronsCount(atom)+1);

Discussion

  • Egon Willighagen

    I don't think anyone ever defined atom types with more than one single electron. If that's all what this report is about, please file it as feature request for the missing atom types.

    It would actually be helpful if you report for what radical it actually fails.

     
  • Egon Willighagen

    Apologies. Let me rephrase that.

    Can you please provide information about the radical for which the atom type is missing?

     
  • Stefan Kuhn

    Stefan Kuhn - 2009-10-14

    If I take a hexane ring and run the updateAtom of jcp, which does this:
    IAtomType type = matcher.findMatchingAtomType(container, atom);
    if (type != null) {
    Integer neighbourCount = type.getFormalNeighbourCount();
    I get neightbourCount==4. If I add a single electron to an atom, neighbourCount becomes 3. If I add a further (or even more) single electrons, it stays 3. I suppose this is indeed a general Problem with atom types with more than 1 single electron not existing, but I don't know much how the atom typing works. So I state the problem as it is.

     
  • Egon Willighagen

    Stefan, is it just carbon with two single electrons that you are requesting an atom type for, or are there more elements?

    Do you have a source of information for properties for them, in terms of neighbor count, hybridization state, formal charge, etc?

    How atom typing works is not too difficult. There is a table of known atom types, and there is an algorithm that matches the input against this table. If there is a match, it returns that match; if there is not, it returns null.

    The current table already contains more atom types than the CDK did at any time, but surely there is a lot of chemistry not understood by the CDK yet; your two single electron atoms are an example of that.

    Once we have the properties of the atoms established, we I can add them to the list and matching algorithm.

     
  • Egon Willighagen

    Ticket moved from /p/cdk/feature-requests/138/

     
  • Egon Willighagen

    Ticket moved from /p/bodr/bugs/14/

     
  • Egon Willighagen

    I created a unit test and fix: https://github.com/cdk/cdk/pull/219

     
  • Egon Willighagen

    • labels: --> cdk.core
    • Group: --> cdk-1.6.x
     
  • Egon Willighagen

    • status: open --> closed
     
  • Egon Willighagen

    Patch is merged in.

     
MongoDB Logo MongoDB