From: Cosseddu, Salvatore (S.M.Cosseddu_at_warwick.ac.uk)
Date: Sun Feb 19 2012 - 13:50:37 CST

Dear Mish,

What do you exactly mean by "any"?
If I understood your message, do you know anything about tcl scriptiong?
put in a file something like this (es dist.tcl):

proc measure_dist_cent_mass { selstring1 selstring2 {molID {top}} {weight {}}} {

set sel1 [atomselect $molID $selstring1]
set sel2 [atomselect $molID $selstring2]

if {![llength $weight]} {
set cent_sel1 [measure center $sel1]
set cent_sel2 [measure center $sel2]
} else {
set cent_sel1 [measure center $sel1 weight $weight]
set cent_sel2 [measure center $sel2 weight $weight]
}

set dist [veclength [vecsub $cent_sel1 $cent_sel2]]

$sel1 delete
$sel2 delete
return $dist

}

open TkConsole and run

source <path>/dist.tcl
where path is the directory of the script. Than you can obtain the information you want using the command

measure_dist_cent_mass "resid 70" "resid 40"

or, if you'd like the distance from center of mass

measure_dist_cent_mass "resid 70" "resid 40" top mass

(measure_dist_cent_mass <first selection string> <second selection string> [<molID>] [<weight>])
molID and weight are optional, but if you want to use weight, you have to put also molID.

I've just wrote this simple procedure from scratch, so it could contain bugs. Please refer to VMD manual and a good TCL book.

Regards
Salvatore

--
Salvatore Cosseddu
PhD student 
Centre for Scientific Computing and School of Engineering
University of Warwick
Coventry CV4 7AL
United Kingdom
email: S.M.Cosseddu_at_warwick.ac.uk
-----Messaggio originale-----
Da: owner-vmd-l_at_ks.uiuc.edu per conto di mish
Inviato: dom 19/02/2012 16:27
A: vmd-l_at_ks.uiuc.edu
Oggetto: vmd-l: Distance between center of mass of two amino acid residues.
 
Hello all,
Can any suggest me some way to measure the distance between geometric
center ( or center of mass) if two amino acid residues in any any protein?
Sincerely
Mish,