From: Ana Celia Araujo Vila Verde (avilaverde_at_engr.psu.edu)
Date: Tue Mar 13 2007 - 16:17:48 CDT

Hi,
 
Try the script below . To run, copy the script into a file. Put the file in the same directory as the input *dcd and *psf, in a Linux machine that runs VMD. Then, type at the prompt:
vmd -dispdev text -e nameOfYourFile
 
 
I hope this helps,
 
Ana
 
 
 
 
# User input starts here############################################################
set dcdFile sim242RES8_3GBP1.2_fromEquil209_Au111.dcd ;# name of your psf file
set psfFile 3GBP1.2_fromEquil209_Au111.psf ;# name of pdb file

set ti 0 ;# the time at which this simulation starts, in ns
set incrm 1; # the comparison is done every incrm number of frames
set durTimestep 0.000001; # duration of the timestep in the simulation, in nanoseconds
set stepsFrame 2000; # number of timesteps in each frame in *dcd file
# User input stops here ##########################################################
 
mol load psf $psfFile dcd $dcdFile
 
set num_steps [molinfo top get numframes]
set ver [string trimright $dcdFile .dcd]
set outEtoE [open endToEnd${ver}.dat w]
set prot [atomselect top "protein and name CA"]
set number [$prot num]
set proti [atomselect top "protein and name CA and resid 1" ] ;#distance is calculated between the first and last alpha carbons
set protf [atomselect top "protein and name CA and resid $number" ]

for {set frme 1} {$frme <= $num_steps} {incr frme $incrm} { ;# for each frame in the *dcd
    $proti frame $frme
    $protf frame $frme
    set xi [$proti get {x}]
    set yi [$proti get {y}]
    set zi [$proti get {z}]
 
    set xf [$protf get {x}]
    set yf [$protf get {y}]
    set zf [$protf get {z}]
 
    set endToEnd [expr sqrt( ($xi-$xf)*($xi-$xf) + ($yi-$yf)*($yi-$yf) + ($zi-$zf)*($zi-$zf) )]
 
    set time [expr {$frme*$stepsFrame*$durTimestep + $ti}]
    puts $outEtoE "$time $endToEnd"
}
 
exit
 
 
 
_________________________________
Ana Célia Araújo Vila Verde
Penn State University
Department of Chemical Engineering
Fenske Laboratory
University Park, PA 16802
USA
 
 <http://www.gfct.fisica.uminho.pt/Members/acvv>
Phone: +(1) (814) 863-2879
Fax: +(1) (814) 865-7846
avilaverde_at_engr.psu.edu
http://www.che.psu.edu/Faculty/JMaranas/group/avv.html
http://www.gfct.fisica.uminho.pt/Members/acvv
_________________________________

-----Original Message-----
From: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] On Behalf Of Jianhui Tian
Sent: Tuesday, March 13, 2007 4:17 PM
To: vmd-l_at_ks.uiuc.edu
Subject: vmd-l: Calculate End-End distance for DCD

Hi VMD users,
 
Does anyone know how to calculate the end-end distance in vmd for the DCD trajoectory of NAMD output? Thanks a lot.
 
Jianhui