#!usr/bin/tclsh # analysis of the distance between the C- and N-termini of deca-alanine. # to use this script, type in the command # vmd -dispdev text -e analysis.vmd -args current_replica current_step # current_step denotes the # of times the simulation has been restarted. # read in command line arguments: first replica, then step if {$argc != 3} { puts "Not enough arguments!" exit } set rep [lindex $argv 0] set step [lindex $argv 1] # load psf and trajectory mol new ../alanin.psf type psf mol addfile ../output/$rep/stretch_alanin.job$step.$rep.sort.dcd type dcd waitfor all # define the distance. Notice that the atom ID in VMD starts from 0. set a1 0; set a2 65 # Delete all existing bond labels so that the one we add has index 0. label delete Bonds # Use the top molecule set molid [molinfo top] # Add the dihedral monitor label add Bonds $molid/$a1 $molid/$a2 # Get all values set output [label graph Bonds 0] # write out the distance time series set outFileName time_series/alanine_${step}_$rep.anal set fileID [open $outFileName w] foreach distance $output {puts $fileID $distance} close $fileID quit