From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Jul 07 2003 - 18:16:26 CDT

Hi,
  You can modify the print_rmsd_through_time script to open a text file
and write to it rather than printing to the screen by opening a file,
changing the "puts" line, and closing the file as I show below.
You can compare with the version in the VMD manual to see what I changed:
  http://www.ks.uiuc.edu/Research/vmd/current/ug/node182.html#13124

Here's the updated version, note my comments which are in ALL CAPS
in the source code:

# Prints the RMSD of the protein atoms between each timestep
# and the first timestep for the given molecule id (default: top)
proc print_rmsd_through_time {{mol top}} {
        # OPEN OUTPUT FILE HERE............
        set myfile [open "myrmsdoutput.txt" w]

        # use frame 0 for the reference
        set reference [atomselect $mol "protein" frame 0]
        # the frame being compared
        set compare [atomselect $mol "protein"]

        set num_steps [molinfo $mol get numframes]
        for {set frame 0} {$frame < $num_steps} {incr frame} {
                # get the correct frame
                $compare frame $frame

                # compute the transformation
                set trans_mat [measure fit $compare $reference]
                # do the alignment
                $compare move $trans_mat
                # compute the RMSD
                set rmsd [measure rmsd $compare $reference]

                # PRINT THE RMSD TO MY OUTPUT FILE....
                puts $myfile"RMSD of $frame is $rmsd"
        }

        # CLOSE OUTPUT FILE....
        close $myfile
}

Let us know if you need more help, the Tcl documentation on
the "open", "close", and "puts" commands is available at
http://www.tcl.tk/

Thanks,
  John Stone
  vmd_at_ks.uiuc.edu

On Sat, Jul 05, 2003 at 09:42:10AM -0500, owner-vmd-l_at_ks.uiuc.edu wrote:
> From: <noyk_at_bgumail.bgu.ac.il>
> To: vmd-l_at_ks.uiuc.edu
> Subject: Print results to output file
> Date: Sat, 5 Jul 2003 17:43:24 +0300
>
> Hi,
>
> When I'm using VMD to manipulate the protein trajectories (dcd) I get the results in the terminal window.
> How can I get my results in an output file?
>
> For example-
> I calculate the RMS through the terminal window by using the function print_rmsd_through_time (from the tutorial)
> and the output is a lot of data (If I have many trajectories).
> How can I print the output into a file?
>
> Thanks,
> K.

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078