Thanks Greg, The code looks pretty shiny to me! I hope I can find time over the weekend to look at doing the post-processing, and will let you know how I get on.
Kind regards James -----Original Message----- From: Greg Landrum [mailto:[email protected]] Sent: 11 June 2010 06:02 To: James Davidson Cc: [email protected] Subject: Re: [Rdkit-discuss] Number of Aromatic Rings Dear James, On Thu, Jun 10, 2010 at 2:35 PM, James Davidson <[email protected]> wrote: > > I have been trying figure-out how to return the count of aromatic > rings for molecules (in Python), and am going to have to admit defeat! > I saw in an earlier message > (http://www.mail-archive.com/[email protected]/msg00 > 153.html) a similar query, but I'm afraid it didn't help me very much. > I also read the section on Aromaticity in the rdkit book, and realised > that maybe this isn't a trivial exercise! Correct. Counting the number of non-fused rings that are aromatic, like the post you reference does, is pretty easy; including the fused rings that are aromatic is more challenging. > I would like the count to count aromatic ring-systems such that > bicyclic (eg indole or naphthalene) would only count as 1. For > reference, this appears to be the behaviour of the OpenEye > OEDetermineAromaticRingSystems function - where the molecule derived > from the smiles "C(O)(=O)c1cccc2c1[nH]c(C3CCCc4c3cccc4)c2" (which > contains an indole and a > tetrahydronaphthalene) gives a count of 2. > > Any help would be greatly appreciated. I've attached a script that's not quite what you want, but it gets you almost there: it finds all aromatic ring systems, including fused ones. Anthracene, for example, gives 6 rings. The modifications to this to get what you're looking for aren't a straightforward post-processing step, but shouldn't be too bad. If there's not enough here, let me know and I will take a look at adding the extra code. This code isn't perfectly polished and could certainly be faster, but it does seem mostly functional. -greg ______________________________________________________________________ PLEASE READ: This email is confidential and may be privileged. It is intended for the named addressee(s) only and access to it by anyone else is unauthorised. If you are not an addressee, any disclosure or copying of the contents of this email or any action taken (or not taken) in reliance on it is unauthorised and may be unlawful. If you have received this email in error, please notify the sender or [email protected]. Email is not a secure method of communication and the Company cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please check this email for virus infection for which the Company accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated, any views or opinions presented are solely those of the author and do not represent those of the Company. The Vernalis Group of Companies Oakdene Court 613 Reading Road Winnersh, Berkshire RG41 5UA. Tel: +44 118 977 3133 To access trading company registration and address details, please go to the Vernalis website at www.vernalis.com and click on the "Company address and registration details" link at the bottom of the page.. ______________________________________________________________________ ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

