From: Ana Celia Araujo Vila Verde (avilaverde_at_engr.psu.edu)
Date: Thu Feb 02 2006 - 08:35:30 CST

Hi,

Thank you all for having replied so fast and for putting up with what was a beginner's doubt. My script is now working (the problem was in fact not having closed the file).

Ana

PS - Nuno, sim sou portuguesa. Até!

_________________________________
Ana Célia Araújo Vila Verde
Penn State University
Department of Chemical Engineering
Fenske Laboratory
University Park, PA 16802
USA
 
Phone: +(1) (814) 863-2879
Fax: +(1) (814) 865-7846
avilaverde_at_engr.psu.edu
_________________________________

-----Original Message-----
From: jmp17_at_duke.edu [mailto:jmp17_at_duke.edu]
Sent: Tuesday, January 31, 2006 12:05 PM
To: Ana Celia Araujo Vila Verde
Subject: Re: vmd-l: printing to a file from a procedure to get RMSD

Ana

Here's what I use. Hopefully it will help:

Jerry

P.S. I usually do the following:

vmd -dispdev text -e rmsd.tcl

where rmsd.tcl is the following file. That way, I can generate RMSD data with vmd in text mode.

-------------------------------------------------------
set psf YOUR_PSF_FILE.psf
set pdb REFERENCE_PDB_FILE.pdb
set dcd YOUR_DCD_FILE.dcd

set outfile [open RMSD.dat w];

mol load psf $psf pdb $pdb
mol load psf $psf dcd $dcd

set nf [molinfo top get numframes]
set frame0 [atomselect 0 "protein and backbone and noh" frame 0]

# rmsd calculation loop
    for {set i 0} {$i < $nf} {incr i } {
      set sel [atomselect 1 "protein and backbone and noh" frame $i]
      $sel move [measure fit $sel $frame0]
      puts $outfile "[measure rmsd $sel $frame0]"
    }
# end of rmsd loop
  close $outfile
--------------------------------------------------------------

On Tue, 31 Jan 2006, Ana Celia Araujo Vila Verde wrote:

> Hi,
>
>
>
> I'm using a script I found in the VMD website to compute the RMSD of a
> molecule relative to the same molecule at frame zero.
>
>
>
> I want the output to go to a file, so I added the necessary commands.
> The file opens when I run the script but nothing gets written in it
> even though output does make it to the screen!
>
>
>
> I'd really appreciate some help. Here's the script (the parts I added
> are between ######):
>
>
>
> # 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}} {
>
> # 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]
>
> ############################
>
> set outFile RSMD_t0.rms
>
> set out [open $outFile w]
>
> ############################
>
> # Does this every 30 frames
>
> for {set frame 0} {$frame < $num_steps} {incr frame
> 30} {
>
> # 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
>
> puts "RMSD of $frame is $rmsd"
>
> ##############################
>
> puts $out "RMSD of $frame is $rmsd"
>
> ##############################
>
> }
>
> }
>
>
>
>
>
>
>
> Thanks,
>
>
>
> Ana
>
> _________________________________
>
> Ana Célia Araújo Vila Verde
>
> Penn State University
>
> Department of Chemical Engineering
>
> Fenske Laboratory
> University Park, PA 16802
>
> USA
>
>
>
> Phone: +(1) (814) 863-2879
> Fax: +(1) (814) 865-7846
>
> avilaverde_at_engr.psu.edu
>
> _________________________________