Hi Cedric,

Nik already made a couple of good points; I just have one thing to
add: it's relatively easy with the RDKit to produce an "unhappy" (in
the sense that it cannot be sanitized) molecule by the process of
removing non-ring atoms. This makes what you're doing more difficult.
This is a particular problem with aromatic nitrogens.

As an example:

[11]>>> m = Chem.MolFromSmiles('c1cccn1C')
[12]>>> nm = Chem.DeleteSubstructs(m,Chem.MolFromSmarts('[!r]'))
[13]>>> smi = Chem.MolToSmiles(m)
[14]>>> smi = Chem.MolToSmiles(nm)
[15]>>> smi
Out[15] 'c1ccnc1'
[16]>>> m2 = Chem.MolFromSmiles(smi)
[06:51:45] Can't kekulize mol
[17]>>> mb = Chem.MolToMolBlock(nm)
[06:51:55] Can't kekulize mol

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/glandrum/RDKit/<ipython console> in <module>()

ValueError: Sanitization error: Can't kekulize mol

#--------------------------------------------

this may account for some of the problems you are seeing.

Note that the recent post from James Davidson had an example
attachment that tries to fix this type of problem; you might want
either re-think how you are removing the non-ring atoms or work with
the script in James' email to cleanup the problems you are
encountering.

Best Regards,
-greg

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to