On Jun 3, 2011, at 10:02 AM, Saurabh Srivastava wrote: > Case 1) Consider matching the SMILE string "C[C@H](C(=O)O)O" against the > smart "*C(*)(O)C*". The daylight server says that there is no match, while if > I run "obgrep -f "*C(*)(O)C*" smiles.smi" with smiles.smi containing the > above SMILE string, then openbabel says the match succeeds. On the other > hand, if I run with no "-f" flag then I get an barrage of incorrect matches > against other molecules.
This is an issue of implicit vs. explicit hydrogens. Daylight treats the "[C@H]" very specially. They have a special singleton hydrogen atom in their data model. See http://www.daylight.com/dayhtml/doc/man/man3/dt_isohydro.html This is still an implicit atom, so does not match "*". Try these examples on the Daylight depiction server: SMILES: C[C@]([H])(C(=O)O)O SMARTS: *C(*)(O)C* SMILES: C[C@]([2H])(C(=O)O)O SMARTS: *C(*)(O)C* You will see the first does not match while the second does. I assume the explicit [H] in SMILES is turned into an implicit hydrogen in the the Daylight object model. If I make it deuterium, as with [2H], then it cannot be made implicit, which lets the "*" match the [2H]. The solution to your problem is that for a cross-platform SMARTS you must use [!#1] instead of *. That is, [!#1]C([!#1])(O)C[!#1] I consider this to be a flaw in the Daylight SMARTS definition. "*" should match "any atom except hydrogen", and for the special case where you want to match hydrogen then use "[*,#1]". Andrew [email protected] ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
