On Mon, Apr 6, 2009 at 7:42 PM, George Oakman <[email protected]> wrote:
>
> How about the cis/trans stereochistry, is is implemented? It looks
> like SubstructMatch accepts "/" and "\" elements in the SMARTS pattern and
> returns sensible results.
Mostly it does:
[5]>>>
Chem.MolFromSmiles('C/C=C\\C').HasSubstructMatch(Chem.MolFromSmarts('C/C=C/C'))
Out[5] False
[6]>>>
Chem.MolFromSmiles('C/C=C\\C').HasSubstructMatch(Chem.MolFromSmarts('C/C=C\\C'))
Out[6] True
[7]>>>
Chem.MolFromSmiles('C/C=C\\C').HasSubstructMatch(Chem.MolFromSmarts('C//C=C\C'))
Out[7] True
[12]>>>
Chem.MolFromSmiles('C/C=C\\C').HasSubstructMatch(Chem.MolFromSmarts('C\\C=C/C'))
Out[12] True
[8]>>>
Chem.MolFromSmiles('C/C=C/C').HasSubstructMatch(Chem.MolFromSmarts('C//C=C\C'))
Out[8] False
[9]>>>
Chem.MolFromSmiles('C/C=C/C').HasSubstructMatch(Chem.MolFromSmarts('C\\C=C\\C'))
Out[9] True
# this is wrong and probably should have a bug filed against it:
[11]>>>
Chem.MolFromSmiles('C/C=C/C').HasSubstructMatch(Chem.MolFromSmarts('C\\C=C\\C'))
Out[11] False
Since matching without the stereochem always works:
[16]>>>
Chem.MolFromSmiles('C/C=C/C').HasSubstructMatch(Chem.MolFromSmarts('CC=CC'))
Out[16] True
[17]>>>
Chem.MolFromSmiles('C/C=C\\C').HasSubstructMatch(Chem.MolFromSmarts('CC=CC'))
Out[17] True
I'd suggest doing that and then post-filtering the results if you need
to. This works for point chirality as well.
-greg