Hi all,

I want to find out whether an atom in a molecule matches to an atom in a
defined substructure.

Let's assume the following:

>>>m = Chem.MolFromSmiles('CS(=O)(=O)N')
>>>sub = Chem.MolFromSmarts('[C]S(=O)(=O)[ND1]')
>>>m.GetSubstructMatches(sub)
((0, 1, 2, 3, 4),)

How can I do the following:
>>>ox1 = m.GetAtomsWithIdx(2)
>>>ox2 = m.GetAtomsWithIdx(3)
>>>query_atom = sub.GetAtomsWithIdx(2)
>>> ox1 matches query_atom
True
>>> ox2 matches query_atom
True

Initially I thought I could use ox1.Matches(query_atom), but this seems to
match independently of the context of the query atom.

Thanks a lot for your help!

Andreas
-- 
*Andreas Tosstorff*


*Post Doctorate Scientist*
*Computer Aided Drug Design | Roche Pharma Research and Early Development**F.
Hoffmann-La Roche Ltd* | Bldg. 92.3.88 | Grenzacherstrasse 124 | CH-4070
Basel | Switzerland
Tel +41 (0) 61 68 20 867

 *Doing now what patients need next*
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to