From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Fri Mar 02 2007 - 07:32:00 CST

On Fri, 2 Mar 2007, Jawahar Neelankatan wrote:

JN> Hi all,

JN> In order to save memory and avoid using the atomselect command for
JN> each frame in a trajectory, I usually do the atomselection at the

this only waste memory, if you do not do a $sel delete after you
are done with using a selection.

JN> beginning and use either "$sel frame $i" or "$sel update" to update
JN> the atomselection for each frame.

JN> My question is this: exactly how does the update process work ? My
JN> guess is that if X atoms are selected in the initial atomselect
JN> command, the "update" command updates the coordinates of those X
JN> atoms in each new frame. So, if the atomselect command has a
JN> selection criterion such as "within 12 of ion", then all atoms
JN> within a sphere of radius 12 Angstrom around the ion are selected.
JN> Let's assume there are X atoms fitting this criterion, in the first
JN> frame. When the frame is switched to another frame and the "update"
JN> command is used, is it those same X atoms that are updated, or is
JN> the atomselection command repeated for that particular frame ? My
JN> concern is that, in the new frame, an atom that was previously
JN> within the 12 Angstrom sphere might have moved out of the sphere, so
JN> it is pointless to update its coordinates.

no, you misunderstood the meaning of frame and update.

$sel frame XX

takes the current selection of atoms and updates the coordinates
to those at frame XX. so for any selection where the atoms will
not change this is sufficient to get the new coordinates.

$sel update

however, will recompute which atoms belong into the selection
at the current frame. so you don't have to worry about atoms
having moved outside of the selection.

in terms of performance. $sel frame XX is fast, whereas
$sel update can be time consuming, so it is to be avoided
if not needed to have scripts run with maximum performance.

cheers,
   axel.

JN>
JN> -Jawahar.
JN>
JN>
JN> ---------------------------------
JN> Have a burning question? Go to Yahoo! Answers and get answers from real people who know.

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