From: Bennion, Brian (bennion1_at_llnl.gov)
Date: Tue Dec 30 2014 - 10:25:41 CST

Where do you set the variable b?

Brian

________________________________
From: owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] on behalf of sunyeping [sunyeping_at_aliyun.com]
Sent: Monday, December 29, 2014 10:39 PM
To: vmd-l
Subject: vmd-l: a script to count the frames in which some water molecules interact with selected protein atoms

Dear all,

I compsed the follow script to count the frames in which some water molecules interact with selected protein atoms

set n [molinfo top get numframes]
set pockect_A [atomselect top "segname P1 and resid 7 45 59 63 66 69 159 171"]
set a [$pockect_A get index]
set wat1 [atomselect top "segname WT1 and resid 2828"]
set wat2 [atomselect top "segname WT1 and resid 8173"]
set wat3 [atomselect top "segname WT4 and resid 2284"]
set wat4 [atomselect top "segname WT4 and resid 6029"]
set wat5 [atomselect top "segname WT5 and resid 2201"]
set wat6 [atomselect top "segname WT7 and resid 8622"]
set waters [list $wat1 $wat2 $wat3 $wat4 $wat5 $wat6]
set file [open count_frame_water.dat w]
set loop_count 0
foreach water $waters {
incr loop_count
puts -nonewline $file water$loop_count
for {set i 0} {$i<$n} {incr i} {
foreach ai $a {
foreach bj $b {
lappend t [measure bond "$ai $bj" frame $i]
}
}
lsort -decreasing $t; set max [lindex $t 0]
if { $max<=3.5} {
puts -nonewline $file $i
}
puts $file \n
}
}
close $file

It cannot work properly. It seems that the foreach loop of foreach water $waters is carried inly once. Could you check it and find what are the faults of it?
Thanks in advance.

Yeping Sun

Institute of Microbiology, Chinese Academy of Sciences