From: Mark Cunningham (
Date: Tue Jul 05 2011 - 21:09:24 CDT

There is no such thing as a "corrected distance." The move amounts to translations
and rotations, both of which preserve distances between atoms in the molecule being
moved. The measure fit that you attempted only specified one atom. That is not
enough information to define the orientation. I've commented out lines within your
script that aren't necessary.

The measure bond requires a list. It's most economical to compute it once and pass it
to your myrmsd function. The suggested change (see below) will fail if there are multiple
atoms that satisfy your selection criteria, i.e., if there are multiple chains.

From: [] on behalf of snoze pa []
Sent: Tuesday, July 05, 2011 6:12 PM
Subject: vmd-l: Distance between atoms in frame

Dear VMD users,

I need some help to calculate the distance between atoms. I am using multiple large dcd files and would appreciate your help to get the corrected distance between two CA atoms of residue 13 and 18 along trajectory. I want to use bigdcd because large multiple dcd files. I am not expert in tcl programming but trying hard to get it.

Thank you.

source bigdcd.tcl

proc myrmsd { frame } {
  global pair
# global ref sel all
# $all move [measure fit $sel $ref]
# puts "$frame: [measure bond [list [list $ind1 $mol] [list $ind2 $mol]] frame all]"
   puts "$frame: [measure bond $pair]"

set mol [mol new solvated_ionised.psf waitfor all]
set all [atomselect $mol all]
set ref [atomselect $mol "protein and resid 13 and name CA"]
set sel [atomselect $mol "protein and resid 18 and name CA"]
#set ind1 [join [$ref get index]]
#set ind2 [join [$sel get index]]
set pair [list [$ref list] [$sel list]]

mol addfile solvated_ionised.pdb type pdb waitfor all
bigdcd myrmsd dcd solvated_ionised4.dcd solvated_ionised5.dcd