From: Luis Gracia (lug2002_at_med.cornell.edu)
Date: Wed Apr 06 2005 - 16:02:58 CDT

Hi!

I never mentioned it, but the RMSDTT plugin can be accesible from within
scripts. Following are some examples I write sometime ago for somebody
else, but let me first say that the pairwise analysis in the examples is
already included in the RMSDTT plugin (no scripting no more ;-) ) in
version "cvs 1.9":
http://physiology.med.cornell.edu/faculty/hweinstein/vmdplugins/

You'll have to modify the following scripts to loop over residues to do
what you want, but it should be straightforward. Here are the examples:

> First you have to open the plugin to initialize all
> the variables. Then you select the main options, like plot, save
> to file. And finally you compute the rmsd. The trick here is to
> correctly activate/deactivate the molecules, set the reference
> molecule (top), and use "::RMSDTT::onlyactive" to make the changes.
> Remember to use "::RMSDTT::onlyactive" after each change in the
> molecule list (activate/deactivate, loading new mols, deleting mols).
>
> The selection goes directly in the :RMSDTT::compute_rms command. It
> won't use the command buttons for 'backbone' or 'trace'. This is the
> command:
> ::RMSDTT::compute_rms {base sel_text frame_ref}
> base is 'top', 'ave' or 'selected', but better go with 'top'
> sel_text is your selection
> frame_ref, well, the frame reference
>
> Here is an example in which I loop through some trajectories, loading
> them, and computing the rmsd one by one.
>
> ---------------------------
> rmsdtt
> set ::RMSDTT::file_out_sw 1
> set ::RMSDTT::plot_sw 0
>
> set mols [list mol1 mol2 mol3 mol4 mol5 mol6 mol7 mol8]
>
> set n [molinfo num]
> for {set i 0} {$i < $n} {incr i 1} {
> mol inactive $i
> }
>
> foreach {i} $mols {
> mol load psf "$i.psf" dcd "$i.dcd"
> set n [molinfo num]
> incr n -1
> ::RMSDTT::onlyactive
> set ::RMSDTT::file_out "$i.dat"
> ::RMSDTT::compute_rms {top} {resid 1 to 17} {0}
> ::RMSDTT::saveData
> mol inactive $n
> }
> -----------------------------
>
> The following script will do a pairwise rmsd calculationt with only
> one trajectory, and save it in different files (look in the rmsdtt
> code for the saveData proc to see how to create a matrix).
>
> -----------------------------
> rmsdtt
> set ::RMSDTT::file_out_sw 1
> set ::RMSDTT::plot_sw 0
> ::RMSDTT::onlyactive
>
> set n [molinfo top get numframes]
> for {set f 0} {$f < $n} {incr f 1} {
> set ::RMSDTT::file_out "frame$f.dat"
> ::RMSDTT::compute_rms {top} {resid 1 to 17} $f
> ::RMSDTT::saveData
> }
> -----------------------------
>
> other variables you might want to change:
> ::RMSDTT::time_sw
> ::RMSDTT::time_ini
> ::RMSDTT::time_step

Best,

Luis

-- 
Luis Gracia, PhD
Department of Physiology & Biophysics
Weill Medical College of Cornell University
1300 York Avenue, Box 75
New York, NY 10021
Tel: (212) 746-6375
Fax: (212) 746-8690
lug2002_at_med.cornell.edu