From: Bennion, Brian (
Date: Tue Apr 26 2016 - 17:26:05 CDT

the tcl command llength coupled with lsort -unique is what you could use.

From: [] on behalf of Mihaela Drenscko []
Sent: Tuesday, April 26, 2016 2:46 PM
Subject: vmd-l: Finding waters near a protein


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