Bugs item #3428027, was opened at 2011-10-25 00:51 Message generated for change (Tracker Item Submitted) made by dalke You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3428027&group_id=40728
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: File Translation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Dalke (dalke) Assigned to: Nobody/Anonymous (nobody) Summary: incorrect treatment of aromatic with explicit bond Initial Comment: I was reviewing the Open Babel SMILES code and noticed that if atom1 and atom2 are joined, and atom1 and atom2 are aromatic, then the bond order is reset to _order=5. This is done in different ways in smilesformat.cpp On line 1055: if (_order != 2) _order=5; //Potential aromatic bond -- but flag explicit double bonds On line 1958: _order=5; //Potential aromatic bond I haven't yet figured out if they are supposed to be the same or different, but I strongly suspect that it's supposed to be the same check. It is possible, but rare, to have an explicit '-' bond marked to indicate that a bond between two aromatics is supposed to be a single/non-aromatic bond. For examples: c12-c3c(cccc3)[IH]c1cccc2 Clc1cc-2c3c(cccc3n1)-c4c2cccc4 [Ni]123n4c5c6ccccc6c4nc-7[n+]2c(-c8ccccc78)nc9n1c(c1ccccc91)nc-1[n+]3c(-c2ccccc12)n5 O=c1nc-2cccccc2s1 c-12n(c3ccccc3n2)Cc4c1cc5ccccc5c4 These are not handled correctly in Open Babel. In RDKit: >>> from rdkit import Chem >>> mol = Chem.MolFromSmiles("c12-c3c(cccc3)[IH]c1cccc2") >>> Chem.MolToSmiles(mol) 'c1ccc2c(c1)[IH]c1ccccc1-2' See the "-2" at the end? That's the explicit single bond. While Open Babel sees the explicit '-' as being an aromatic: % echo 'c12-c3c(cccc3)[IH]c1cccc2 blah' | babel -ismi -osmi c12c3c(cccc3)[IH]c1cccc2 blah As an extreme example, here's a triple-bond joining two aromatic rings in RDKit: >>> mol = Chem.MolFromSmiles("c1ccc[n-2]1#[n-2]1cccc1") >>> Chem.MolToSmiles(mol) 'c1cc[n-2](#[n-2]2cccc2)c1' Open Babel totally ignores the triple bond and says the bond between the two aromatic rings is a single bond. % echo "c1ccccc1#c1ccccc1 blah" | babel -ismi -osmi c1ccccc1c1ccccc1 blah BTW, I'm using the Open Babel build from today's version control. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3428027&group_id=40728 ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel