Discussion:
[Rdkit-discuss] Sanitize Error
Changge Ji
2017-07-01 15:19:46 UTC
Permalink
Dear All,

I want to do some substructure match using MCS.
It seems that Sanitize is needed for MCS.
I met with the over valance error when using sanitize for some molecules.

Like the following one :
--------------------------------
sa = Chem.MolFromSmiles('c1cocn1')
sa =Chem.MolFromSmarts(Chem.MolToSmarts(sa))
Chem.SanitizeMol(sa)
----------------------------------
The error info says that Explicit valence for O is greater than permitted.



Since I need to use smarts derived from MCS analysis, I can't use Chem.MolFromSmiles(mol,kekuleSmiles=True).

Is there any easy way to avoid such error?

Many thanks for your help.


Best,
Changge




Changge Ji
Andrew Dalke
2017-07-01 21:40:45 UTC
Permalink
Post by Changge Ji
I want to do some substructure match using MCS.
It seems that Sanitize is needed for MCS.
I met with the over valance error when using sanitize for some molecules.
--------------------------------
sa = Chem.MolFromSmiles('c1cocn1')
sa =Chem.MolFromSmarts(Chem.MolToSmarts(sa))
Chem.SanitizeMol(sa)
----------------------------------
The error info says that Explicit valence for O is greater than permitted.
Since I need to use smarts derived from MCS analysis, I can't use Chem.MolFromSmiles(mol,kekuleSmiles=True).
I don't understand what you are doing. Where is the MCS?

Why do you take the oxazole SMILES and turn it into the SMARTS '[#6]1:[#6]:[#8]:[#6]:[#7]:1'?

Why do you think you need to sanitize the MCS?
Post by Changge Ji
mol = Chem.MolFromSmarts("ccO")
Chem.SanitizeMol(mol)
[23:26:28] non-ring atom 0 marked aromatic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Sanitization error: non-ring atom 0 marked aromatic

Finally, I think you mean Chem.MolToSmiles() at the end. But I can't figure out why you need that.
Post by Changge Ji
from rdkit import Chem
from rdkit.Chem import MCS
benzoxazole = Chem.MolFromSmiles("n1c2ccccc2oc1")
sulfamoxole = Chem.MolFromSmiles("O=S(=O)(Nc1nc(c(o1)C)C)c2ccc(N)cc2")
zoxazolamine = Chem.MolFromSmiles("C1=CC2=C(C=C1Cl)N=C(O2)N")
MCS.FindMCS([benzoxazole, sulfamoxole, zoxazolamine])
MCSResult(numAtoms=6, numBonds=6, smarts='[#6]:1:[#6]:[#6]:[#6]:[#6]:[#6]:1', completed=1)
Post by Changge Ji
mcs_smarts = MCS.FindMCS([benzoxazole, sulfamoxole, zoxazolamine]).smarts
mcs_smarts
'[#6]:1:[#6]:[#6]:[#6]:[#6]:[#6]:1'
Post by Changge Ji
mcs_pat = Chem.MolFromSmarts(mcs_smarts)
benoxaprofen.HasSubstructMatch(mcs_pat)
True

There is no need to do an explicit SanitizeMol().

Best regards,


Andrew
***@dalkescientific.com

Continue reading on narkive:
Loading...