>> + if (atom->IsNitrogen() && atom->GetFormalCharge() == 0 && >> atom->GetValence() == 3 && charge > 0) { >> + atomState[idx] = DOUBLE_ALLOWED; // It has an electron it can >> donate, because of the total charge >> + charge--; >> + if (DEBUG) { cout << "atom " << idx << " rejected NR3 double bonds >> overruled by totalcharge " << endl; }
> Are we on the right track here or should this be handled differently? Bringing the total charge into kekulize is a good idea and I don't know why it wasn't done earlier. I'm less certain this code above is The Right Thing(tm) and have been trying to think of whether there's a better solution. Certainly it works on this set of molecules, but I'm not sure if it's correct for everything. -Geoff ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel