Dear all,
I stumbled upon a - to me - rather strange behavior with
MMFFHasAllMoleculeParams().
I want to generate a molecule from SMILES, check if all MMFF parameters are
present, add hydrogens and generate conformers. However, the outcome (error or
not error) depends on the order of checking of the MMFF parameters and adding
hydrogens.
Everything is fine if I first add the hydrogens:
In [1]: m = Chem.MolFromSmiles('Cc1nc(=O)c(C[NH3+])c(-c2c[nH]c3ccccc23)[nH]1')
In [1]: m = AllChem.AddHs(m)
Out[2]: AllChem.MMFFHasAllMoleculeParams(m)
Out[2]: True
In [3]: AllChem.EmbedMultipleConfs(m, numConfs=100)
Out[3]: <rdkit.rdBase._vecti at 0x111761950>
But here’s what happens when I first check the MMFF parameters:
In [4]: m = Chem.MolFromSmiles('Cc1nc(=O)c(C[NH3+])c(-c2c[nH]c3ccccc23)[nH]1')
In [5]: AllChem.MMFFHasAllMoleculeParams(m)
Out[5]: True
In [6]: m = AllChem.AddHs(m)
In [7]: AllChem.EmbedMultipleConfs(m, numConfs=100)
RDKit ERROR: [08:41:02] Explicit valence for atom # 11 N, 4, is greater than
permitted
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-17-6b197697e61c> in <module>()
----> 1 AllChem.EmbedMultipleConfs(m, numConfs=100)
ValueError: Sanitization error: Explicit valence for atom # 11 N, 4, is greater
than permitted
Interestingly, if I do the check first, but then remove the hydrogens before
adding hydrogens, things work again:
In [8]: m = Chem.MolFromSmiles('Cc1nc(=O)c(C[NH3+])c(-c2c[nH]c3ccccc23)[nH]1')
In [9]: AllChem.MMFFHasAllMoleculeParams(m)
Out[9]: True
In [10]: m = AllChem.RemoveHs(m)
In [11]: m = AllChem.AddHs(m)
In [12]: AllChem.EmbedMultipleConfs(m, numConfs=100)
Out[12]: <rdkit.rdBase._vecti at 0x111761a50>
I cannot really explain the behavior. It only happens for some molecules. Is
MMFFHasAllMoleculeParams() modifying the molecule, i.e. already addying
hydrogens?
Best,
Sereina
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss