From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Nov 20 2008 - 11:54:38 CST

On Thu, 20 Nov 2008, Mark M Huntress wrote:

mark,

MH> I am kind of new at using Namd/vmd, and I saw this correspondence on
MH> the vmd mailing list archive. I am also trying to align my frames so
MH> I can find the average positions of the atoms. Could you please give
MH> an example of how to use this proc command? I mean, do you specify
MH> mol or something? Do you specify sel by set sel [atomselect top
MH> "protein"]
MH> ?

MH> I mean, could you maybe show me the three or so lines that you would
MH> type to make this work (After the script below is typed in)?

please help yourself to a study of the various VMD scripting
tutorials and a thorough reading of the text mode interface
and scripting documentation of the VMD user's guide. a look into
a tcl tutorial does not hurt either. those are there exactly for
beginners to learn how things are done in vmd/tcl scripting,
that will help you more than any three lines of commands ...

cheers,
   axel.

MH> Thanks,
MH> Mark
MH>
MH>
MH> This is the old message:
MH>
MH> Hi Li,
MH> If you want to compute the average structure or the RMSD of the system
MH> throughout your trajectory you should really align all frames first. This
MH> removes rotation and center of mass movements which could lead to distorted
MH> average structure.
MH> But even after the alignment your avg structure will suffer from "unnatural"
MH> atom positions, especially in rotating parts like methyl groups:
MH> The trajectory_smooth script just computes the arithmetic meanof each
MH> coordinate over the specified number of frames. The arithmetic mean position
MH> of methyl H-atoms is somewhere on the rotation axis, leading to an ill
MH> looking conformation of these atoms. But this should be no problem for
MH> studying the structure in general.
MH> Below is a script that does the alignment for you.
MH> Hope this helps,
MH> Jan
MH>
MH> This is the process I am trying to use:
MH>
MH> #############################################################
MH> # Align all frames of a molecule to the first frame #
MH> #############################################################
MH> proc align_all_frames {sel {mol top}} {
MH> set seltext [$sel text]
MH> # use frame 0 for the reference
MH> set reference [atomselect $mol "$seltext" frame 0]
MH> # the frame being compared
MH> set compare [atomselect $mol "$seltext"]
MH> set all [atomselect $mol all]
MH> set num_steps [molinfo $mol get numframes]
MH> for {set frame 0} {$frame < $num_steps} {incr frame} {
MH> # get the correct frame
MH> $compare frame $frame
MH> $all frame $frame
MH> # compute the transformation
MH> set trans_mat [measure fit $compare $reference]
MH> # do the alignment
MH> $all move $trans_mat
MH> # compute the RMSD
MH> set rmsd [measure rmsd $compare $reference]
MH> puts "$frame $rmsd"
MH> }
MH> display update
MH> }
MH>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.