-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze_ligandBinding.tcl
42 lines (37 loc) · 1.22 KB
/
analyze_ligandBinding.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set dcdname [lindex $argv 0]
# Load trajectory
mol new pca_${dcdname}_cMD100ns_CA.psf type psf
mol addfile pca_${dcdname}_cMD100ns_CA.dcd type dcd first 0 last -1 step 1 waitfor all
# Align to first frame
set reference [atomselect top "backbone" frame 0]
# the frame being compared
set compare [atomselect top "backbone"]
set num_steps [molinfo top get numframes]
set num [expr {$num_steps - 1}]
for {set frame 0} {$frame < $num} {incr frame} {
# get the correct frame
$compare frame $frame
# compute the transformation
set trans_mat [measure fit $compare $reference]
# do the alignment
$compare move $trans_mat
}
set reference [atomselect top "backbone and (resid 607 to 623)" frame 0]
# the frame being compared
set compare [atomselect top "backbone and (resid 607 to 623)"]
# Backbone RMSD
set outfile [open rmsd_ligandBinding_${dcdname}.dat w]
for {set frame 0} {$frame < $num_steps} {incr frame} {
# get the correct frame
$compare frame $frame
# compute the transformation
set trans_mat [measure fit $compare $reference]
# do the alignment
$compare move $trans_mat
# compute the RMSD
set rmsd [measure rmsd $compare $reference]
# print the RMSD
puts $outfile "$frame $rmsd"
}
close $outfile
exit