-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.calculate_bin.sh
163 lines (116 loc) · 2.67 KB
/
5.calculate_bin.sh
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
date
show=0
return_dir=`pwd`
echo 'main location:' $return_dir
echo
chmod +x 5.clean_bin_folder.sh
./5.clean_bin_folder.sh
bin_calculation(){
cd $file_rdf
cp ${return_dir}/5.bin.py .
sed 's/##bin_size##/'${bin}'/g' 5.bin.py > 5.bin_${bin}.py
echo "Calculating bin size = $bin"
python 5.bin_${bin}.py
echo 'done!'
mkdir -p ${return_dir}/average_curves_bin${bin}
}
pmf_calculation(){
# Making directory pmf with new bin
cd ..
file_pmf=$(echo $file_rdf | sed 's/_rdf/_pmf/g')
rm -r ${file_pmf}_bin${bin}
mkdir -p ${file_pmf}_bin${bin}
cd ${file_pmf}_bin${bin}
# Copying just the relevant rdf curves
echo "copying just relevant rdf curves"
cp ../${file_pmf}/0.comparison2.dat .
comp_line=$(wc -l 0.comparison2.dat | cut -d " " -f1)
for ((cc=1; cc<=$comp_line; cc+=1)) do
num_cur=$(head -n$cc 0.comparison2.dat | tail -n1 | cut -f1)
cp ../${file_rdf}/bin_${bin}/rdf${num_cur}_bin${bin}.dat .
done
# Converting rdf to pmf
echo ${file_rdf}_bin${bin} '->' ${file_pmf}_bin${bin}
cp ${return_dir}/5.pmf.py .
python 5.pmf.py
rm rdf*dat
# Calculating average
echo "calculating average"
cp ${return_dir}/5.average.py .
num_cur_nr=$(tail -n1 list_rdfs.log)
sed 's/##show##/'${show}'/g' 5.average.py | sed 's/##max##/'${num_cur_nr}'/g' > 555
mv 555 5.average.py
python 5.average.py
pH_name=$(echo $file_pmf | cut -d "_" -f1)
cp 0.average.pfm ${return_dir}/average_curves_bin${bin}/${virus}_${arch}_${pH_name}_bin${bin}.pmf
echo
cd ..
}
cd DATA
for ((v=1; v<=4 ; v+=1)) do
if [ $v -eq 1 ]; then
virus=ZIKV-UG
fi
if [ $v -eq 2 ]; then
virus=ZIKV-BR
fi
if [ $v -eq 3 ]; then
virus=DENV2
fi
if [ $v -eq 4 ]; then
virus=WNV
fi
cd $virus
for ((f=4; f<=5 ; f+=1)) do
if [ $f -eq 1 ]; then
arch=monomer
fi
if [ $f -eq 2 ]; then
arch=dimer
fi
if [ $f -eq 3 ]; then
arch=dimer_0.005M
fi
if [ $f -eq 4 ]; then
arch=dimer
fi
if [ $f -eq 5 ]; then
arch=d_vdw
fi
if [ $f -eq 6 ]; then
arch=fixed_charges
fi
if [ $f -eq 7 ]; then
arch=charge_central
fi
if [ $f -eq 8 ]; then
arch=charge_distributed
fi
cd $arch
echo "---------------------------------" $virus - $arch "---------------------------------"
echo
ls | grep rdf | grep pH > unique_rdf
line=$(ls | grep rdf | grep pH | wc -l)
for ((l=1; l <= $line ; l+=1)) do
file_rdf=$(head -n$l unique_rdf | tail -n1)
bin=2
bin_calculation
pmf_calculation
bin=3
bin_calculation
pmf_calculation
bin=5
bin_calculation
pmf_calculation
echo "---------------------------------"
echo
done
rm unique_rdf
cd ..
done
echo
cd ..
done
cd $return_dir
date
aplay /usr/share/sounds/sound-icons/piano-3.wav