From: Lubos Vrbka (shnek_at_tiscali.cz)
Date: Thu Feb 10 2005 - 02:46:53 CST

hello!

my last mail seems to get lost in the cyberspace, so i'm posting once
more the same question...

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?

best regards,
lubos

-- 
Lubos
_@_"