From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Mon Dec 09 2002 - 14:33:43 CST

Hi,

VMD has a Tcl function called "measure contacts" which will give you lists
of all atoms that are within a certain distance of other atoms. I assume
you would want something like this, not just a list of all N^2 distances?
Anyway, you use it like so:

  set sel1 [atomselect top "<some selection>"]
  set cutoff 2.5 # arbitrary
  set contactlists [measure contacts $cutoff $sel1]
  set list1 [lindex $contactlists 0]
  set list2 [lindex $contactlists 1]

Now corresponding elements in list1 and list2 are indices of atoms that
are neighbors. You can also pass two atom selections to the measure routine,
in which case list1 will contain only atoms from the first selection and list2
will contain only atoms from the second selection.

Cheers,
Justin

On Mon, Dec 09, 2002 at 02:59:30PM +0100, Vlad Cojocaru wrote:
> Dear VMDers,
> Daoes anyone have a script for calculating interatomic distances for
> a bunch of atoms (selected) from a pdb file?
> Best regards,
> vlad
>
> --
> Vlad Cojocaru
> Max Planck Institute for Biophysical Chemistry
> Department: 060
> Am Fassberg 11, 37077 Goettingen, Germany
> tel: ++49-551-201.1389
> e-mail: Vlad.Cojocaru_at_mpi-bpc.mpg.de
> home tel: ++49-551-9963204
>
>

-- 
  Justin Gullingsrud        3111 Beckman Institute        217-244-8946
  I been dropping the new science, and I be kicking the new knowledge,
  and I'm seeing to a degree that you can't get in college.  -- b.boys