统计某一对儿氢键在整个轨迹中出现的总次数,可以由此得到氢键的占据百分数,donor和accept是原子index,给氢原子的原子叫donor,受到氢原子的叫acceptor。fps是帧数
proc hb {fps1 fps2 donor accept} {
set cum 0
for {set i $fps1} {$i<=$fps2} {incr i 1} {
set dd [atomselect top "index $donor" frame $i]
set aa [atomselect top "index $accept" frame $i]
set temp [measure hbonds 3.5 35 $dd $aa]
if {$temp!="{} {} {}"} {puts $temp;incr cum}
}
puts $cum
}
显示蛋白质中的氢键数目随时间变化
for {set i 0} {$i<=100} {incr i 1} {
set dd [atomselect top protein frame $i]
puts "$i [llength [lindex [measure hbonds 3.0 35 $dd] 0]]"
$dd delete
}