Hi Gustavo,
> template =
> Chem.MolFromSmarts('[a]1(-[S](-*)(=[O])=[O]):[a]:[a]:[a]:[a]:[a]:1')
Unless things have changed since I last looked at the algorithm, you can't
meaningfully pass a SMARTS-based query molecule into the MCS program, outside
of a few simple cases.
It generates a SMARTS pattern based on the properties of the molecule. You
asked it to CompareElements, but those [a] terms all have an atomic number of 0.
>>> template =
Chem.MolFromSmarts('[a#1]1(-[S](-*)(=[O])=[O]):[a#1]:[a#1]:[a#1]:[a#1]:[a#1]:1')
>>> [a.GetAtomicNum() for a in template.GetAtoms()]
[0, 16, 0, 8, 8, 0, 0, 0, 0, 0]
That's why your CompareAny search returns the #0 terms, like:
'[#16,#6](-[#0,#6])(=,-[#8,#9])(=,-[#8,#9])-[#0,#6]1:[#0,#6]:[#0,#6]:[#0,#6]:[#0,#6]:[#0,#7]:1'
> I would appreciate some pointers on how it would be possible to find the
> maximum common substructure of 2 molecules, where in the template structure
> some atoms may be *any*, but some other atoms must be fixed.
Perhaps with isotope labelling?
That is, label the "any" atoms as isotope 1, and label your -[S](=[O])(=[O])-
as -[2S](=[3O])(=[3O])-
Then use rdFMCS.AtomCompare.CompareIsotopes .
If there's anything you don't want to match at all, give each atom a unique
isotope value.
Best regards,
Andrew
[email protected]
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss