Dear all,
One of the "frequently requested features" (often correctly couched as
bug reports) for the RDKit is to include stereochemistry information
in substructure searches.
As of this morning, this is now possible:
In [10]: m = Chem.MolFromSmiles('CC[C@H](F)Cl')
In [11]:
m.HasSubstructMatch(Chem.MolFromSmiles('C[C@H](F)Cl'),useChirality=True)
Out[11]: True
In [12]:
m.HasSubstructMatch(Chem.MolFromSmiles('C[C@@H](F)Cl'),useChirality=True)
Out[12]: False
In [13]:
m.HasSubstructMatch(Chem.MolFromSmiles('C[C@@H](Cl)F'),useChirality=True)
Out[13]: True
In [14]: m2 = Chem.MolFromSmiles('C/C=C/F')
In [15]: m2.HasSubstructMatch(Chem.MolFromSmiles('C/C=C/F'),useChirality=True)
Out[15]: True
In [16]: m2.HasSubstructMatch(Chem.MolFromSmiles('C/C=C\\F'),useChirality=True)
Out[16]: False
In [18]: m3 = Chem.MolFromSmiles('C/C=C(\\C)F')
In [19]:
m3.HasSubstructMatch(Chem.MolFromSmiles('C/C=C(\\C)F'),useChirality=True)
Out[19]: True
In [20]:
m3.HasSubstructMatch(Chem.MolFromSmiles('C/C=C(/C)F'),useChirality=True)
Out[20]: False
In [21]:
m3.HasSubstructMatch(Chem.MolFromSmiles('C/C=C(/F)C'),useChirality=True)
Out[21]: True
There's still testing to do, but I think this is pretty solid and am
really glad to have this (mostly) finished.
Best,
-greg
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss