substruct matching is wrong for [Si] #1199

Open
rmrmg opened this Issue Dec 12, 2016 · 1 comment

Projects

None yet

2 participants

@rmrmg
rmrmg commented Dec 12, 2016

Substruct matching for [Si] is differ that for C (see examples below). In my humble opinion result for carbon is correct and for silicon is wrong.

xx1=Chem.MolFromSmiles('c1cccc(Si(Br)Br)c1')
xx2=Chem.MolFromSmiles('Si(Br)Br')
xx1.HasSubstructMatch(xx2)
False

yy1=Chem.MolFromSmiles('c1cccc(C(Br)(Br)Br)c1')
yy2=Chem.MolFromSmiles('C(Br)(Br)Br')
yy1.HasSubstructMatch(yy2)
True

@greglandrum
Member

In this case the Si atom in the query xx2 has a radical electron. This is not matched in molecule xx1, so you don't end up with a match.

If you want to have reliable substructure queries, you are better off using Chem.MolFromSmarts instead of Chem.MolFromSmiles for the queries. That should do what you want here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment