-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStability_analysis.tcl
116 lines (102 loc) · 3.62 KB
/
Stability_analysis.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
##################################################
## Project: 2021-M1AP
## Script purpose: Rg calculation
## Date: September 15, 2021
## Author: Umut Gerlevik
##################################################
set case [lindex $argv 0]
set subgroup [lindex $argv 1]
# REPEAT 1 ---------------------------------------
# Load trajectory
mol new ../${subgroup}_${case}/3_production/seok${case}_onlyProt.psf type psf
mol addfile ../${subgroup}_${case}/3_production/seok${case}_250ns_onlyProt_each25k.dcd type dcd first 0 last -1 step 2 waitfor all
mol addfile ../${subgroup}_${case}/3_production/seok${case}_250to500ns_onlyProt_each25k.dcd type dcd first 0 last -1 step 2 waitfor all
set nf [molinfo top get numframes]
# FoldX Stability
mkdir foldx_stability_${case}
cd foldx_stability_${case}
for {set i 0} {$i <= $nf} {incr i 100} {
[atomselect top all frame ${i}] writepdb ${i}.pdb
set fd [open "${i}.pdb" r]
set newfd [open "${i}.pdb.tmp" w]
while {[gets $fd line] >= 0} {
set newline [string map {HSD HIS HSE HIS HSP HIS} $line]
puts $newfd $newline
}
close $fd
close $newfd
file rename -force "${i}.pdb.tmp" "${i}.pdb"
exec foldx --command=Stability --pdb=${i}.pdb
}
set i [expr {${i} - 1}]
[atomselect top all frame ${i}] writepdb ${i}.pdb
set fd [open "${i}.pdb" r]
set newfd [open "${i}.pdb.tmp" w]
while {[gets $fd line] >= 0} {
set newline [string map {HSD HIS HSE HIS HSP HIS} $line]
puts $newfd $newline
}
close $fd
close $newfd
file rename -force "${i}.pdb.tmp" "${i}.pdb"
exec foldx --command=Stability --pdb=${i}.pdb
set outfile [open stability_seok${case}.dat w]
set i 0
while {$i < $nf} {
puts $outfile "$i,[exec gawk {FNR==1 {print $2}} ${i}_0_ST.fxout]"
set i [expr {${i} + 100}]
}
set i [expr {${i} - 1}]
puts $outfile "${i},[exec gawk {FNR==1 {print $2}} ${i}_0_ST.fxout]"
close $outfile
file rename stability_seok${case}.dat ../../${subgroup}_${case}/3_production/.
cd ..
file delete -force ./foldx_stability_${case}
mol delete all
# REPEAT 2 ---------------------------------------
# Load trajectory
mol new ../${subgroup}_${case}/3_production/seok${case}_onlyProt.psf type psf
mol addfile ../${subgroup}_${case}/4_production_repeat2/seok${case}_250ns_r2_onlyProt_each25k.dcd type dcd first 0 last -1 step 2 waitfor all
mol addfile ../${subgroup}_${case}/4_production_repeat2/seok${case}_250to500ns_r2_onlyProt_each25k.dcd type dcd first 0 last -1 step 2 waitfor all
set nf [molinfo top get numframes]
# FoldX Stability
mkdir foldx_stability_${case}
cd foldx_stability_${case}
for {set i 0} {$i <= $nf} {incr i 100} {
[atomselect top all frame ${i}] writepdb ${i}.pdb
set fd [open "${i}.pdb" r]
set newfd [open "${i}.pdb.tmp" w]
while {[gets $fd line] >= 0} {
set newline [string map {HSD HIS HSE HIS HSP HIS} $line]
puts $newfd $newline
}
close $fd
close $newfd
file rename -force "${i}.pdb.tmp" "${i}.pdb"
exec foldx --command=Stability --pdb=${i}.pdb
}
set i [expr {${i} - 1}]
[atomselect top all frame ${i}] writepdb ${i}.pdb
set fd [open "${i}.pdb" r]
set newfd [open "${i}.pdb.tmp" w]
while {[gets $fd line] >= 0} {
set newline [string map {HSD HIS HSE HIS HSP HIS} $line]
puts $newfd $newline
}
close $fd
close $newfd
file rename -force "${i}.pdb.tmp" "${i}.pdb"
exec foldx --command=Stability --pdb=${i}.pdb
set outfile [open stability_seok${case}.dat w]
set i 0
while {$i < $nf} {
puts $outfile "$i,[exec gawk {FNR==1 {print $2}} ${i}_0_ST.fxout]"
set i [expr {${i} + 100}]
}
set i [expr {${i} - 1}]
puts $outfile "${i},[exec gawk {FNR==1 {print $2}} ${i}_0_ST.fxout]"
close $outfile
file rename stability_seok${case}.dat ../../${subgroup}_${case}/4_production_repeat2/.
cd ..
file delete -force ./foldx_stability_${case}
exit