From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Fri Mar 02 2007 - 08:31:54 CST

On Fri, 2 Mar 2007, Jawahar Neelankatan wrote:

JN> Hi Axel,

JN> Thanks for the info. That really helps. The NAMDENERGY plugin
JN> calculates energies between atoms defined in two selections, $sel1
JN> and $sel2. It does so for all frames in a trajectory. Does it update
JN> the atom selections using the "update" command or does it basically
JN> just calculate energies between the same two groups of atoms defined

the NAMDENERGY plugin is a tcl script, so you can see for yourself.

cheers,
    axel.

JN> initially ? If I use an atomselection criterion (such as all atoms
JN> within a fixed radius) that can lead to varying results from frame
JN> to frame, does NAMDENERGY update the selections from frame to frame
JN> or does it just use the same set of atoms for all frames ?

JN>
JN> -Jawahar
JN>
JN>
JN> Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu> wrote: On Fri, 2 Mar 2007, Jawahar Neelankatan wrote:
JN>
JN> JN> Hi all,
JN>
JN> JN> In order to save memory and avoid using the atomselect command for
JN> JN> each frame in a trajectory, I usually do the atomselection at the
JN>
JN> this only waste memory, if you do not do a $sel delete after you
JN> are done with using a selection.
JN>
JN> JN> beginning and use either "$sel frame $i" or "$sel update" to update
JN> JN> the atomselection for each frame.
JN>
JN>
JN> JN> My question is this: exactly how does the update process work ? My
JN> JN> guess is that if X atoms are selected in the initial atomselect
JN> JN> command, the "update" command updates the coordinates of those X
JN> JN> atoms in each new frame. So, if the atomselect command has a
JN> JN> selection criterion such as "within 12 of ion", then all atoms
JN> JN> within a sphere of radius 12 Angstrom around the ion are selected.
JN> JN> Let's assume there are X atoms fitting this criterion, in the first
JN> JN> frame. When the frame is switched to another frame and the "update"
JN> JN> command is used, is it those same X atoms that are updated, or is
JN> JN> the atomselection command repeated for that particular frame ? My
JN> JN> concern is that, in the new frame, an atom that was previously
JN> JN> within the 12 Angstrom sphere might have moved out of the sphere, so
JN> JN> it is pointless to update its coordinates.
JN>
JN> no, you misunderstood the meaning of frame and update.
JN>
JN> $sel frame XX
JN>
JN> takes the current selection of atoms and updates the coordinates
JN> to those at frame XX. so for any selection where the atoms will
JN> not change this is sufficient to get the new coordinates.
JN>
JN> $sel update
JN>
JN> however, will recompute which atoms belong into the selection
JN> at the current frame. so you don't have to worry about atoms
JN> having moved outside of the selection.
JN>
JN> in terms of performance. $sel frame XX is fast, whereas
JN> $sel update can be time consuming, so it is to be avoided
JN> if not needed to have scripts run with maximum performance.
JN>
JN> cheers,
JN> axel.
JN>
JN>
JN> JN>
JN> JN> -Jawahar.
JN> JN>
JN> JN>
JN> JN> ---------------------------------
JN> JN> Have a burning question? Go to Yahoo! Answers and get answers from real people who know.
JN>
JN>

-- 
=======================================================================
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.