From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Apr 23 2007 - 11:12:07 CDT

Hi,
  In addition to what Peter said, I thought I'd point out
one specific portion of your script which is certainly eating
a huge amount of your memory:

You don't want to be doing this:
> #######################################
> #Get all the atomselect.
> for {set i 1} {$i <= 1536} {incr i} {
> set atom($i) [atomselect top "water within 5.5 of resid $i"]
> }

You should be creating and deleting the selections as-needed since you
don't have enough memory to keep > 1500 of them around...

  John

On Mon, Apr 23, 2007 at 10:24:48AM -0400, Jianhui Tian wrote:
> Hi all,
>
> I have a water box of 1536 molecules. Now what I want to do is to make
> atomselect of each of the molecule and then get the residue list of other
> molecules within some distance of each water molecule. The problem is that
> the tcl code will get killed. I dont know the reason. Is it due to the
> memory limitation. I only have 512 memory in my PC now. How can I do what I
> want to do here? I also posted the code I write about this part.
>
>
> #########################################
> #########################################
> proc simplifylist {slist} {
> set newlist { }
> foreach elem $slist {
> if {[lsearch $newlist $elem] == -1} {
> lappend newlist $elem
> }
> }
> set newlist [lsort $newlist]
> return $newlist
> }
>
> ########################################
> # Load the trajectoty files.
> mol new prmtop type parm7
> mol addfile dcd type dcd waitfor all
>
> set numfrm [molinfo top get numframes]
> set systm [atomselect top all]
>
> #######################################
> #Get all the atomselect.
> for {set i 1} {$i <= 1536} {incr i} {
> set atom($i) [atomselect top "water within 5.5 of resid $i"]
> }
>
> for {set i 0} {$i < $numfrm} {incr i} {
>
> ######### Get all the connected list for each of the water molecule.
> for {set j 1} {$j <= 1536} {incr j} {
> $atom($j) frame $i
> $atom($j) update
> set list($j) [$atom($j) get resid]
> set list($j) [simplifylist $list($j)]
> puts "frame $i residue $j: $list($j)\n"
> }
> }
>
> exit

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