-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_interact_old.sh
97 lines (95 loc) · 2.92 KB
/
run_interact_old.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
###################################
# By: Gustavo E. Olivos-Ramirez #
# Lima-Peru #
###################################
ligand_code=UNK
pdb=all_traj.pdb
i=1
while read line; do
echo "$i"
echo "${line}" >> model_${i}.pdb
[[ ${line[0]} == ENDMDL ]] && ((i++))
done < $pdb
for file in model_*; do
sed -i '1,5d' ${file}
mkdir ${file%.pdb} && mv ${file} ${file%.pdb};
done
for d in model_*; do
cd ${d}
plip -f model_* -t -q -s
cd ../;
done
rm */*proton*
rm */*fixed*
k=1
for d in */; do
echo "$k"
cd ${d}
sed -n -e '/($ligand_code) - SMALLMOLECULE/,/SMALLMOLECULE/p' *.txt > all_interact.dat
sed -i '/(HSD)/,/EOF/d' report.txt
if [ -f all_interact.dat ];
then
cat *.txt >> all_interact.dat;
fi
echo "**" >> all_interact.dat
sed -i -z 's/+//g; s/-//g; s/=//g; s/|//g; s/*\*\n/\n/g' all_interact.dat
awk '{print $1,$2}' all_interact.dat > res_interact.dat
sed -i '/^ $/d' res_interact.dat
rm all_interact.dat
#Hydrophobic
sed -n -e '/Hydrophobic Interactions/,/*/p' res_interact.dat > hydrophobic.dat
sed -i 's/ /-/g' hydrophobic.dat
sed -i '/*/d' hydrophobic.dat
sed -i '1d' hydrophobic.dat
#H-bond
sed -n -e '/Hydrogen Bonds/,/*/p' res_interact.dat > h_bond.dat
sed -i 's/ /-/g' h_bond.dat
sed -i '/*/d' h_bond.dat
sed -i '1d' h_bond.dat
#Salt-bridges
sed -n -e '/Salt Bridges/,/*/p' res_interact.dat > salt_bridges.dat
sed -i 's/ /-/g' salt_bridges.dat
sed -i '/*/d' salt_bridges.dat
sed -i '1d' salt_bridges.dat
#pi-Stacking
sed -n -e '/piStacking/,/*/p' res_interact.dat > pi_stacking.dat
sed -i 's/ /-/g' pi_stacking.dat
sed -i '/*/d' pi_stacking.dat
sed -i '1d' pi_stacking.dat
#pi-Cation
sed -n -e '/piCation/,/*/p' res_interact.dat > pi_cation.dat
sed -i 's/ /-/g' pi_cation.dat
sed -i '/*/d' pi_cation.dat
sed -i '1d' pi_cation.dat
cd ../
((k++));
done
cat */h_bond.dat >> h_bond.dat
cat */hydrophobic.dat >> hydrophobic.dat
cat */salt_bridges.dat >> salt_bridges.dat
cat */pi_stacking.dat >> pi_stacking.dat
cat */pi_cation.dat >> pi_cation.dat
# INTERACTION CODES: HB=h-bond; H=hydrophobic; SB=sald bridge; pS=pi-stacking; pC=pi-cation
sed -e 's/$/ HB/' -i h_bond.dat
sed -e 's/$/ H/' -i hydrophobic.dat
sed -e 's/$/ SB/' -i salt_bridges.dat
sed -e 's/$/ pS/' -i pi_stacking.dat
sed -e 's/$/ pC/' -i pi_cation.dat
cat *dat >> all_interactions.dat
sort -o all_interactions.dat all_interactions.dat
uniq all_interactions.dat -c > unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ //g' unique.csv
sed -i 's/ /,/g' unique.csv
sort -t , -k 2 -g -o unique.csv unique.csv
sed -i '1 i\N,res,type' unique.csv
mkdir plip_results
mv model_* plip_results