From: Mihaela Drenscko (
Date: Tue Apr 26 2016 - 16:46:02 CDT


I found this script:

set sel [atomselect top "water and same residue as (within 2 of protein)"]
set n [molinfo top get numframes]
for { set i 0 } { $i < $n } { incr i } {
  $sel frame $i
  $sel update
  $sel writepdb water_$i.pdb

with the output of water atoms near a protein for each frame.

But actually I need to know how many water molecules are near the protein ,
in other words, I need to read into each pdb file, or find other way to
display the number of water molecule. How can this be accomplished?

Thank you,

P.S. Or perhaps the number the water molecules can be counted with
"measure" command? I haven't seen listed a counting results for measuring
anything. I there an alternative with "measure"?