Hi Nik, Thanks for your speedy reply.
On 21/01/13 17:19, Stiefl, Nikolaus wrote: > do you just have to check if an atom is in a 6-membered ring? If so then > > > In [8]: m = > Chem.MolFromSmiles('COc1ccc(cc1O[C@H]1C[C@@H]2CC[C@H]1C2)C1CNC(=O)NC1') > > In [9]: [a.IsInRingSize(6) for a in m.GetAtoms()] > > > Should help. Hmmm! I thought I tried that! I seem to get a different result: RDKit::RingInfo* ring_info_p = rdkm.getRingInfo(); for (unsigned int iat=0; iat<rdkm.getNumAtoms(); iat++) { bool b = ring_info_p->isAtomInRingOfSize(iat, 6); std::string name; rdkm[iat]->getProp("name", name); std::cout << iat << " " << name << " " << b << std::endl; } results in: 0 O3 0 1 C17 1 2 N1 1 3 HN1 0 4 N2 1 5 HN2 0 6 C18 1 7 H18 0 8 H18A 0 9 C15 1 10 H15 0 11 C16 1 12 H16A 0 13 H16 0 14 C12 1 15 C13 1 16 H13 0 17 C14 1 18 H14 0 19 C2 1 20 O1 0 21 C1 0 22 H1B 0 23 H1A 0 24 H1 0 25 C11 1 26 H11 0 27 C3 1 28 O2 0 29 C4 0 30 H4 0 31 C9 0 32 H9 0 33 C8 0 34 H8 0 35 H8A 0 36 C7 0 37 H7A 0 38 H7 0 39 C10 0 40 H10 0 41 H10A 0 42 C6 0 43 H6 0 44 C5 0 45 H5A 0 46 H5 0 The ring atoms of interest are C4, C5, C6, C7, C8, C9, (C10 is the bridging carbon) Anyway, this will fix norbornane - but not the general case (I'm thinking of amantadine and the like - see below). Oh, it just occurred to me that I didn't start with the SMILES string (I created an rdkit molecule from the restraints). I will try the SMILES string. > > Sorry - maybe I do not fully understand your question > It was poorly formed, sorry. I see now that there is another part I neglected to mention. I need to know all the 3,4,5,6-membered rings that an atom might be part of (actually, to be strictly accurate, I need to know the number of each of such rings) so the atoms of norbornane would result in 5,5 (one atom) or 5,6 (four such atoms) or 5,5,6 (two such atoms). Thanks, Paul. ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss