From: Lubos Vrbka (shnek_at_tiscali.cz)
Date: Tue Feb 08 2005 - 05:28:58 CST

hello!

i am almost done with the script for analysis of prefferential
adsorption... i think i'll post it here in case it would be of some use
for others... currently, i'm solving small problem:
how to "map" residue id to residue name?
it seems that all atomselect's are based on atom numbers, however in my
case i've got residue id based data and i want to assign appropriate
names to it. currently i use following code
..
   # make some mappings
   set all [atomselect top all]
   # resid map for every atom
   set allResid [$all get resid]
   # resname map for every atom
   set allResname [$all get resname]
   # position for every atom
   foreach resID $allResid resNAME $allResname {
     set mapResidResname($resID) $resNAME
   }
..
   # assign residue name (resnameA) to residue id (residA) and print
   foreach {tmp resnameA} [split [array get mapResidResname $residA] ] break
..
is there easier way to do this? i.e. does somewhere in vmd exist a list
with [resid resname] elements?

thanks for helping me. regards,

-- 
Lubos
_@_"