From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Oct 07 2013 - 16:46:15 CDT

Hi,
  After you've run the "mol new" and "mol addfile" commands, what do you
get from this command:
  molinfo top get numframes

Also, you should use this command to update your selections:
  $sel frame $k

You would also need to use this command to prevent memory from being
gobbled up, by adding it into the end of your loop:
  $sel delete

Even better is to pull the creation of "sel" entirely outside of
the loop, and just do "$sel update" after "$sel frame", so that you're
only updating the selection and not creating/destroying it over and over
since the selection text isn't changing at all...

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Mon, Oct 07, 2013 at 04:42:15PM -0400, Nupur Bansal wrote:
> Hi,
>
> No, I did not get any error then.
>
> Thanks
> Nupur
>
> On Oct 7, 2013, at 4:38 PM, John Stone <johns_at_ks.uiuc.edu> wrote:
>
> > Hi,
> > I noticed that you have netcdf within angle brackets, which may be
> > the source of your problem. Do you get any error when you run just the
> > "mol new" and "mol addfile" commands in your script by hand?
> >
> > Cheers,
> > John Stone
> > vmd_at_ks.uiuc.edu
> >
> > On Mon, Oct 07, 2013 at 04:28:04PM -0400, Nupur Bansal wrote:
> >> Hi,
> >>
> >> I have a protein-ligand complex simulated using Amber. Now, I am trying to find the residues closest to the ligand using VMD. The script is giving me an error "No timestep available for 'within' search! " and is selecting all the residues of the protein.
> >> I don't know why this is happening. Can somebody help me in debugging this error?
> >>
> >> This is the script that I am using:
> >>
> >> set first 0
> >> set last 0
> >>
> >> set sys [mol new cur1_sb_strip.prmtop]
> >> mol addfile type <netcdf> cur1_sb_strip.netcdf first$first last$last waitfor all
> >>
> >> set all [atomselect $sys all]
> >> for {set k 0} {$k <= $last} {incr k} {
> >> molinfo top set frame $k
> >> $all update
> >> set sel [atomselect top "protein and (name CA) and within 3 of (resname CUR and not hydrogen)"]
> >> set num1 [$sel num]
> >> set resid1 [$sel get resid]
> >> puts "number=$num1"
> >> puts "resid=$resid1"
> >> }
> >>
> >> Thanks
> >> Nupur Bansal
> >> Graduate Student
> >> Merz Group
> >> Michigan State University
> >
> > --
> > NIH Center for Macromolecular Modeling and Bioinformatics
> > Beckman Institute for Advanced Science and Technology
> > University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> > http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> > http://www.ks.uiuc.edu/Research/vmd/
>

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/