[Rdkit-discuss] Two ReplaceSubstructs questions.
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: JP <jea...@in...> - 2012-02-02 18:59:49
|
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
|