From: Justin Gullingsrud (justinrocks_at_gmail.com)
Date: Wed Feb 02 2005 - 11:41:19 CST

Hi,

You'd want to use the "measure contacts" command, described in the VMD
User's guide. Given two selections, one for CL and one for protein,
and a cutoff distance, it will give you lists of corresponding to all
CL-protein pairs within that distance. You can then create another
set of selections to extract the resid information. Here's a basic
example:

proc findResidPairs { sel1 sel2 cutoff } {
  # create specified atom selections
  set A [atomselect top $sel1]
  set B [atomselect top $sel2]
  
  # make a table of the data values we need
  set all [atomselect top all]
  set allResid [$all get resid]
  set allPos [$all get {x y z}]

  # extract the pairs. listA and listB hold corresponding pairs from
selections 1 and 2, respectively.
  foreach {listA listB} [measure contacts $cutoff $A $B] break

  # go through the pairs, finding their resids and distance.
  foreach indA $listA indB $listB {
    set residA [lindex $allResid $indA]
    set residB [lindex $allResid $indB]
    set dist [vecdist [lindex $allPos $indA] [lindex $allPos $indB]]
    puts "$residA $residB $dist"
  }
}

####

# Run it with the following command:
findResidPairs "resname CL" "protein" 4

Cheers,
Justin

On Wed, 02 Feb 2005 13:51:46 +0100, Lubos Vrbka <shnek_at_tiscali.cz> wrote:
> dear all,
>
> i'm trying to solve following problem, however couldn't find anything
> appropriate in the list archives...
>
> i want to know which residues of the protein are most favored by given
> ion in the solution.
>
> it is possible to do selection like
> resname CL within 4 of protein
> however is it possible to get list in the following form
> resid_of_CL resid_of_protein distance
>
> thank you in advance for any hint. with best regards,
> lubos
>
> --
> Lubos
> _@_"
>

-- 
The spirit of Plato dies hard.  We have been unable to escape the
philosophical tradition that what we can see and measure in the world
is merely the superficial and imperfect representation of an
underlying reality.
                -- S.J. Gould, "The Mismeasure of Man"