From: Murpholino Peligro (murpholinox_at_gmail.com)
Date: Thu Mar 08 2012 - 15:33:19 CST

Hi all!
I want to know the average distance for alpha carbons in my protein with N
residues (in this case 111)
I was trying to get the distance for residue i and that of residue i-1
Until now I have>
set file [open "ca-dist.dat" w]
for { set i 2 } { $i <= 111 } { incr i } {
    set j 0
    for { set j [ expr $i - 1 ] } { $j <= [ expr $i -1 ] } { incr j } {
        set seli [[atomselect top "protein and name CA and resid $i"] get
index]
        set selj [[atomselect top "protein and name CA and resid $j"] get
index]
        puts "$j $selj $i $seli" ;# everything is ok 'til here
        set dist 0 ;# not sure if this line is correct
        set dist [ measure bond {"$selj $seli"} ] ;# I think the problem
are the double quotes, but I really don't have idea
        puts "$j $i $dist"

    }; # for j
}; # for i
close $file
Any help with the code is appreciated
loading the ca-dist.dat into R in this way I can get the average distance
very easy and do some plots

Ps ca-dist.tcl is somewhat different of what I want

-- 
Mr. Murpholino X
"mi segundo nombre es Peligro!!"