Re: [Rdkit-discuss] ring in RDKIT many question

2010-07-20 Thread Greg Landrum
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

---
ValueErrorTraceback (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


Re: [Rdkit-discuss] ring in RDKIT many question

2010-07-17 Thread Greg Landrum
Dear Cedric,

On Fri, Jul 16, 2010 at 11:12 AM, Cedric MORETTI
cedric.more...@firmenich.com wrote:

 I have a small problem with cycles.

 I used this macro:

 http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01053.html



 to determine, whether or not the presence of a cycle (thank you greg) and
 the smile of this cycle.

 Then I used the output SDF file to determine the presence or absence of
 heteroring (if in the ring there are a nitrogen for exemple) and I have in
 some cases a type None when the same smile that is provided by RDKIT
 macro.

 I thought the error came because of point of a dicycle but not at all.



 Also you have an idea for determining the bicyclic and tricyclic?

 I thought after the 1, 2, 3 smi and divide by 2 but does not work at
 all: (

I don't think I understand the question.

If you want to search for heteroatoms in rings, the easiest way is to
find substructure matches for the SMARTS [!#6;r]. That will give you
all non-carbon atoms that are in rings.

-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