Re: [Rdkit-discuss] valence problem
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2014-07-13 04:19:08
|
Hi Adrian,
On Thu, Jul 10, 2014 at 12:42 PM, Adrian Jasiński <jas...@gm...
> wrote:
> Hi all
> I have a problem with generating molecule from smiles.
>
> from rdkit import Chem
> template = Chem.MolFromSmiles('F[P-](F)(F)(F)(F)F.CN(C)C(F)=[N+](C)C')
>
> I got an error:
> Explicit valence for atom # 1 P, 7, is greater than permitted
>
> But the SMILES for this structure should be valid.
> I checked many web services and the structure is always the same
> the CAS number for this structure is 164298-23-1
>
The default RDKit behavior is to reject hypervalent P. This is probably
something I should change given how frequently the PF6- anion occurs.
> Can I skip checking the valence during generating mol from smiles?
>
>
You can, but you probably want to at least do a partial sanitization so
that the molecule is actually useful:
In [14]: m = Chem.MolFromSmiles('F[P-](F)(F)(F)(F)F.CN
(C)C(F)=[N+](C)C',sanitize=False)
In [15]: m.UpdatePropertyCache(strict=False)
In [16]:
Chem.SanitizeMol(m,Chem.SanitizeFlags.SANITIZE_FINDRADICALS|Chem.SanitizeFlags.SANITIZE_KEKULIZE|Chem.SanitizeFlags.SANITIZE_SETAROMATICITY|Chem.SanitizeFlags.SANITIZE_SETCONJUGATION|Chem.SanitizeFlags.SANITIZE_SETHYBRIDIZATION|Chem.SanitizeFlags.SANITIZE_SYMMRINGS,catchErrors=True)
Out[16]: rdkit.Chem.rdmolops.SanitizeFlags.SANITIZE_NONE
-greg
|