From: Ashar Malik (
Date: Thu Jan 31 2019 - 00:00:10 CST

Not sure what this script will end up doing.

Here is what you do need to do.

   1. find number of frames in trajectory
   2. Loop over all frames
   3. In every iteration (of loop) make one (not 2) selection of waters
   within r-distance of protein
   4. count water molecules and log them
   5. delete selection
   6. go to next iteration and repeat from 3

On Thu, Jan 31, 2019 at 1:40 PM ISHRAT JAHAN <> wrote:

> Dear Sir,
> I am trying to calculate the number of water molecules at particular
> distance (for different value of r) from surface of protein through out
> the trajectory and similarly for osmolytes.
> I have written the following scripts. Kindly guide me whether it is
> correct or not.
> set sel1 [atomselect top "water within 1.0 of protein"]
> set sel2 [atomselect top "solvent within 1.0 of protein"]
> set nf [molinfo top get numframes]
> for {set i 0}{$i < $nf}{incr i}{
> puts "frame $i of $nf"
> $sel1 frame $i
> $sel2 frame $i
> }
> close
> Thank you
> Regards