From: Akash Pandya (akashpandya93_at_gmail.com)
Date: Tue Nov 24 2020 - 04:07:02 CST

 Hi all,

I've got this tcl script to calculate the number of water molecules around
my protein (shown below). I wanted to find out what command I can include
to calculate the number of waters around each of my 442 residues. So the
output returns an average number of water molecules around each residue? I
know the bookkeeping will be quite complicated but if anyone has any
suggestions as to how I can do this, it will be much appreciated.

set frames [molinfo top get numframes]
set fp [open "waters.txt" w]
set protein "resid 1 to 442"
for {set i 0} {$i < $frames} {incr i} {
                puts "Frame: $i"
                set a [atomselect top "(water within 5 of ($protein) )"
frame $i]
                set num [$a num]
                puts $fp "$i $num"
                $a delete
}
close $fp

Best wishes,

Akash