2008/8/17 Evgueni Kolossov <ekolos...@gmail.com>

> Thanks Greg,
> But this is not enough:
>
> unsigned int minRingSize=ringInfo->
>>
>> minAtomRingSize(atomIdx);
>> for(VECT_INT_VECT_CI ringIt=ringInfo->atomRings().begin();
>>    ringIt!=ringInfo->atomRings().end();++ringIt){
>>  if(ringIt->size()==minRingSize){
>>    if(std::find(ringIt->begin(),ringIt->end(),atomIdx)!=ringIt->end()){
>>      // our atom is in this ring; do something
>>    }
>>  }
>>  }
>> }
>
> In this case we got an iterator (ringIt) which is itself a vector (if I am
> right) of Ring atoms.
> So to do something with atoms  inside this ring we need somehow iterate
> through the atoms...
> Can you show how to do this?
> I have tried to do it this way:
> for (unsighed int i=0; i<minRingSize; i++)
> {
>     RDKit::Atom * pAtom = mol.getAtomWithIdx(ringIt[i]) ;
>     ..........
> }
> but this is not working.
>
> Regards,
> Evgueni
>
>
> 2008/8/15 Greg Landrum <greg.land...@gmail.com>
>
> Dear Evgueni,
>>
>> this is a general interest answer, so I'm directing it to the mailing
>> list.
>>
>> On Fri, Aug 15, 2008 at 11:56 AM, Evgueni Kolossov
>> <ekolos...@btinternet.com> wrote:
>> >
>> > I need to understand a little bit more about RingInfo.
>> > For a given atom I got:
>> > - the number of rings atom involved (pRingInfo->numAtomRings(Atom_Idx))
>> > - the size of the smallest ring atom involved
>> > (pRingInfo->minAtomRingSize(Atom_Idx))
>>
>> correct.
>>
>> > Now I need to iterate through the atoms in the smallest ring with my
>> atom. I
>> > can get atoms using pRingInfo->atomRings() but how I know this will give
>> me
>> > the list of atoms in the smallest ring and in the ring where is my atom?
>>
>> sample code, not actually tested, should give the idea:
>>
>> unsigned int minRingSize=ringInfo->minAtomRingSize(atomIdx);
>> for(VECT_INT_VECT_CI ringIt=ringInfo->atomRings().begin();
>>    ringIt!=ringInfo->atomRings().end();++ringIt){
>>  if(ringIt->size()==minRingSize){
>>    if(std::find(ringIt->begin(),ringIt->end(),atomIdx)!=ringIt->end()){
>>      // our atom is in this ring; do something
>>    }
>>  }
>>  }
>> }
>>
>>
>> > What if my atom is a member of more than one ring?
>>
>> The above code should work in that case as well.
>>
>> -greg
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
>
>
> --
> Dr. Evgueni Kolossov (PhD)
> ekolos...@gmail.com
> Tel. +44(0)1628 627168
> Mob. +44(0)7812070446
>



-- 
Dr. Evgueni Kolossov (PhD)
ekolos...@gmail.com
Tel. +44(0)1628 627168
Mob. +44(0)7812070446

Reply via email to