forked from MChavent/Hbond-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
value2beta.tcl
75 lines (53 loc) · 1.68 KB
/
value2beta.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
# inter2beta.tcl
#
# Created by Matthieu Chavent (2018-2019).
#
# use: inter2beta top <VMD selection for protein> <VMD selection for protein2> <data file created by the H-bond_analysis script for protein1> <data file created by the H-bond_analysis script for protein2>
proc inter2beta {MolID sel1 sel2 file_dat1 file_dat2} {
set all [atomselect $MolID "all"]
$all set beta 0.011
set liste_lect ""
set liste_tenC ""
set fp_lect [open $file_dat1 r]
set file_data_lect [read $fp_lect]
close $fp_lect
set data_lect [split $file_data_lect "\n"]
set data_lect [lreplace $data_lect end end]
set list_res_lect ""
set list_inter_lect ""
foreach elt $data_lect {
set data [split $elt]
lappend list_res_lect [lindex $data 0]
lappend list_inter_lect [lindex $data 1]
}
#puts $list_res_lect
#puts $list_inter_lect
for {set i 0} {$i < [expr [llength $list_res_lect]]} {incr i} {
set res_nb [lindex $list_res_lect $i]
set inter [lindex $list_inter_lect $i]
set res [atomselect $MolID "$sel1 and resid $res_nb"]
if {$inter > 0.011} {
$res set beta $inter
}
}
set fp_ten [open $file_dat1 r]
set file_data_ten [read $fp_ten]
close $fp_ten
set data_ten [split $file_data_ten "\n"]
set data_ten [lreplace $data_ten end end]
set list_res_ten ""
set list_inter_ten ""
foreach elt $data_ten {
set data [split $elt]
lappend list_res_ten [lindex $data 0]
lappend list_inter_ten [lindex $data 1]
}
for {set i 0} {$i < [expr [llength $list_res_ten]]} {incr i} {
set res_nb [lindex $list_res_ten $i]
set inter [lindex $list_inter_ten $i]
set res [atomselect $MolID "$sel2 and resid $res_nb"]
if {$inter > 0.011} {
$res set beta $inter
}
}
}