Re: [Rdkit-discuss] Chem.CanonSmiles
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Greg L. <gre...@gm...> - 2010-06-28 03:27:23
|
Dear Christian, On Sat, Jun 26, 2010 at 11:15 AM, bouille <amb...@wa...> wrote: > > Using Fedora13 I can use Rdkit from svn I'm glad that updating to Fedora 13 helped. > Hereunder my script I have an error as Chem.CanonSmiles > cannot raise out > > row = 'CC[NH+](CC)CC.O1c2ccccc2O[P-]1123Oc4ccccc4O1.O2c1ccccc1O3' > > if row is not None: > > flag = 0 > > try: > #Shell.IPShellEmbed()() > mol1 = Chem.CanonSmiles(row) > > if mol1 is None: > flag = 1 > except ValueError: > flag=1 > > if (flag == 0): > #print "c'est bon" > mol = Chem.MolFromSmiles(mol1) > molH = Chem.AddHs(mol) > #print molH > if embedsubroutine(molH) == 0: > #print 'Embeded, now optimizing: ',count > #if optimizesubroutine(molH)==0: > > sdf3D = Chem.MolToMolBlock(molH) > #cursor.execute (" insert into 3dStock1 SET cd_id = %s, mon3D = %s > ", (row[0],sdf3D )) > #cursor.execute (" UPDATE montests SET MASS = %s WHERE cd_id = %s > ", (mass1, row[0])) > print sdf3D > #else: > #print 'Failure with optimzation',count > #continue > else: > print 'Due failed embed, cannot optimze',count > > > else: > flag = 0 > #count += 1 > print "mauvais"+ str(row[0]) > #break > else: > print "ca passe" > > I have an error > > [11:10:33] Explicit valence for atom # 15 P, 7, is greater than > permitted > Traceback (most recent call last): > File "unTest.py", line 37, in <module> > mol1 = Chem.CanonSmiles(row) > File "/home/bouille/Rdkit/rdkit/Chem/__init__.py", line 36, in > CanonSmiles > return MolToSmiles(m,useChiral) > Boost.Python.ArgumentError: Python argument types in > rdkit.Chem.rdmolfiles.MolToSmiles(NoneType, int) > did not match C++ signature: > MolToSmiles(RDKit::ROMol {lvalue} mol, bool isomericSmiles=False, > bool kekuleSmiles=False, int rootedAtAtom=-1) I'm not sure what your question is. The error message is pretty clear: the P in your molecule has a valence of 7. The RDKit expects P to have a valence of either 3 or 5. The anion in this compound, trisphat, is an example of a hypervalent phosphorous, which the RDKit does not currently accept. If enough people think it's important, we can discuss how to molecules like this can be supported by the RDKit. Best Regards, -greg |