From: Akash Pandya (akashpandya93_at_gmail.com)
Date: Thu Apr 16 2020 - 07:17:02 CDT

Hi,

I am new to the VMD mailing list. I want to count the number of ligand
molecules within 5 A around my protein. So I wrote a tcl script for this
(shown below):

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

index 6616 to 8155 is my ligand. This script gives the number of ligand
molecules at each time frame. So my question is what command can I enter to
also get the number of ligand molecules around EACH RESIDUE (resid 1 to
442)?

Cheers,
Akash