Hi all,
I'm having an issue with SMARTS pattern matching and chirality.
I'm trying to recognize one specific chiral configuration, but I get unexpected 
answers, 
see the following example:
------------------------------
#!/usr/bin/env python
import pybel
ob = pybel.ob
patterns = [ ('p1' , '[$(*[C@@H])]'),
              ('p2' , 'F[C@@H](Br)Cl'),
              ('p3' , '[$(*[C@H])]'),
              ('p4' , 'F[C@H](Br)Cl'),
            ]
smi ='F[C@H](Br)Cl'
mol = pybel.readstring('smi', smi)
print "Molecule", mol
for pname, p in patterns:
     print "PATTERN %s : %s => " % (pname, p),
     smarts = pybel.Smarts(p)
     print smarts.findall(mol)
------------------------------

$ python smartest.py
Molecule F[C@H](Br)Cl

PATTERN p1 : [$(*[C@@H])] =>  [(1,), (3,), (4,), (5,)]
PATTERN p2 : F[C@@H](Br)Cl =>  [(1, 2, 4, 5)]
PATTERN p3 : [$(*[C@H])] =>  [(1,), (3,), (4,), (5,)]
PATTERN p4 : F[C@H](Br)Cl =>  [(1, 2, 4, 5)]

I would expect patterns p1 and p2 to return no matches, and p3 and p4 to 
succeed.
Although, even carbon chirality is clearly the opposite in the molecule and p1, 
p2, the 
script finds matches.
Am I missing something, maybe?

Advices will be much appreciated.

Thanks

S

-- 
  Stefano Forli, PhD

  Staff Scientist
  Molecular Graphics Laboratory
  Dept. of Integrative Structural
   and Computational Biology, MB-112F
  The Scripps Research Institute
  10550  North Torrey Pines Road
  La Jolla,  CA 92037-1000,  USA.

     tel: (858) 784-2055
     fax: (858) 784-2860
     email: fo...@scripps.edu
     http://www.scripps.edu/~forli/

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to