1) Any idea why the following two snippets give different answers, even if
I am essentially replacing the same things?

>>> a = Chem.MolFromSmiles('NCC')
>>> rep = AllChem.ReplaceSubstructs(a, Chem.MolFromSmarts('CC'),
Chem.MolFromSmiles('CCO', sanitize=False), replaceAll=True)[0]
>>> print Chem.MolToSmiles(rep, isomericSmiles=True)

NCCO

>>> b = Chem.MolFromSmiles('CCN')
>>> rep = AllChem.ReplaceSubstructs(b, Chem.MolFromSmarts('CC'),
Chem.MolFromSmiles('CCO', sanitize=False), replaceAll=True)[0]
>>> print Chem.MolToSmiles(rep, isomericSmiles=True)

N.CCO  # expecting NCCO

# Why isn't the replacement connected to the rest of the molecule ?


2) This is more tricky, as it involves our friend deuterium.  Why isn't the
whole mol replaced?  Why is it not being matched?

>>> b = Chem.MolFromSmiles('C(=O)O[2H]')
>>> rep = AllChem.ReplaceSubstructs(b, Chem.MolFromSmarts('C(=O)O[2H]'),
Chem.MolFromSmiles('C(=O)[O-]', sanitize=False), replaceAll=True)[0]
>>> print Chem.MolToSmiles(rep, isomericSmiles=True)

[2H]OC=O # expecting C(=O)[O-]

Thanks for any help/insights you can provide...

-
Jean-Paul Ebejer
Early Stage Researcher
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to