From: Ashar Malik (asharjm_at_gmail.com)
Date: Sun Dec 14 2014 - 14:38:33 CST

Hey there,

I want to analyze the number of water molecules/per frame within some
> cutoff distance of residue of my simulated trajectories

for the above - as far as I can understand you don't need to make two
selections, since you are not doing any comparisons.

something like this directly in your for loop should get you what you want:

set sel [atomselect top "same residue as waters and within 5 of resname
HEME"]

the above gets you the selection of all residues of only water within 5A of
residue HEME. Now at this point you need to be clear as to what you want --
you can write the entire selection as a PDB and go to the next frame -
which I believe is really not something very practical - are you just
looking at NUMBER of waters ?? those can be extracted from the above
selection which you are refreshing at each iteration of the for loop.

Hope this helps.

Best,
/A

On Mon, Dec 15, 2014 at 5:02 AM, Kshatresh Dutta Dubey <kshatresh_at_gmail.com>
wrote:
>
> Hi,
>
> I want to analyze the number of water molecules/per frame within some
> cutoff distance of residue of my simulated trajectories. I dont have
> expertise of tcl scripting however I tried following scripts:
>
> set outfile [open waters.dat w];
> set nf [molinfo top get numframes]
> set frame0 [atomselect top "water within 3 of resname HEM" frame 0]
> set sel [atomselect top "water within 3 of resname HEM"]
> for {set i 1 } {$i < $nf } { incr i } {
> $sel frame $i
> puts $outfile "[[ $sel $frame0] num] "
> }
> close $outfile
>
> But every time it is stops with error: atomselection: improper method:
> atomselect28, that means something is not right in last 3rd line.
> I will be thankful if someone suggests me to figure out the issue.
>
> Regards
> Kshatresh
>