From: Chitrak Gupta (
Date: Mon Oct 19 2015 - 16:36:15 CDT

Hi Daniela,

I believe something like this would work.

set wat [atomselect top "water and same residue as within $dist of resid
for {set i 0} {$i < $numframes} {incr i 1} {
          animate goto $i
          $wat frame $i
          $wat update
          puts [expr [$wat num]/3]


On Mon, Oct 19, 2015 at 4:05 PM, Daniela Rivas <>

> Hi,
> I have a trajectory file and I would like to plot the number of water
> molecules within a distance from a residue in time. I've been trying to
> figure out how to do it but I couldn't find anything.
> I hope you can help me.
> Thanks,
> Daniela.