3 # Provide names of the pdb files
4 set protein1 = 1UDI_A.pdb
5 set protein2 = 1UDI_B.pdb
7 # Provide number of steps in milions
10 # Provide number of clusters
13 # Provide temperature of clustering
16 # Provide UNRES instalation pathway
17 set UNRES = /users2/vetinari/unres_hom_m/unres
21 ################################################################################
22 ################################################################################
23 ################################################################################
24 sed -e "s=UUU=$UNRES=" start_unres_example.mat > start_unres.mat
25 sed -e "s=UUU=$UNRES=" start_wham_example.mat > start_wham.mat
26 sed -e "s=UUU=$UNRES=" start_cluster_example.mat > start_cluster.mat
29 # Generation of initial orientations
30 echo "Generation of initial orientations"
32 gfortran -O3 generator_v13b.f -o generator_v13b
33 ./generator_v13b $protein1 $protein2 0 > log
34 grep -v "TER" $protein1 > prot1
35 grep -v "TER" $protein2 > prot2
36 cat prot1 "TER" prot2 > reference.pdb
40 ################################################################################
41 # Setting up and running MREMD
42 echo "Setting up and running MREMD"
43 set nstep2 = `echo $nstep \* 1000000 | bc | awk -F "." '{print $1}'`
44 set box = `grep -A1 "Boxsize (suggested)" log | tail -1 | cut -c 3-8`
45 sed "s/boxxx/$box/g" unres_example.inp > unres_dock.inp
46 sed "s/NNN/$nstep2/g" unres_dock.inp > unres_dock.in
47 mv unres_dock.in unres_dock.inp
53 ################################################################################
54 # Setting up and running WHAM analysis
55 echo "Setting up and running WHAM analysis"
56 #set resnum = `grep -A 1 "PDB data will be read from file" dimer.out_GB000 | tail -1 | awk '{print $2}'`
57 #set resnum = `echo $resnum + 5 | bc`
59 #grep -A $resnum "PDB data will be read from file" dimer.out_GB000 | grep -B 9999 "nsup=" | egrep -v "PDB|Nres:|nsup=" | awk '{print $3}' > seq_raw
61 egrep "CA|TER" reference.pdb > temp.pdb
62 set res1 = `grep -B 9999 "TER" temp.pdb | grep -v TER | grep -c CA`
63 set res2 = `grep -A 9999 "TER" temp.pdb | grep -v TER | grep -c CA`
64 set start1 = `head -1 temp.pdb | awk '{print $4}'`
65 set end2 = `tail -1 temp.pdb | awk '{print $4}'`
66 set start2 = `grep -A 1 TER temp.pdb | tail -1 | awk '{print $4}'`
67 set end1 = `grep -B 1 TER temp.pdb | head -1 | awk '{print $4}'`
69 echo First protein has $res1 residues, while second molecule has $res2 residues.
70 echo $start1 $end1 $start2 $end2
74 if ($start1 != GLY) then
78 head -$res1 temp.pdb | awk '{print $4}' >> seq_raw
80 if ($end1 != GLY) then
84 if ($start2 != GLY) then
88 tail -$res2 temp.pdb | awk '{print $4}' >> seq_raw
90 if ($end2 != GLY) then
95 set resnum = `grep -c "." seq_raw`
97 echo System contains $resnum residues including dummy atoms.
103 while ($i <= $resnum)
105 set aa = `head -$i seq_raw | tail -1`
108 else if ($aa == ALA) then
110 else if ($aa == ARG) then
112 else if ($aa == ASN) then
114 else if ($aa == ASP) then
116 else if ($aa == CYS) then
118 else if ($aa == GLU) then
120 else if ($aa == GLN) then
122 else if ($aa == GLY) then
124 else if ($aa == HIS) then
126 else if ($aa == ILE) then
128 else if ($aa == LEU) then
130 else if ($aa == LYS) then
132 else if ($aa == MET) then
134 else if ($aa == PHE) then
136 else if ($aa == PRO) then
138 else if ($aa == SER) then
140 else if ($aa == THR) then
142 else if ($aa == TRP) then
144 else if ($aa == TYR) then
146 else if ($aa == VAL) then
156 set i = `echo $i + 1 | bc`
157 set j = `echo $j + 1 | bc`
162 set range1 = `echo $nstep2 / 2500 | bc | awk -F "." '{print $1}'`
163 set range1 = `echo $range1 | bc`
164 set div = `echo 12000 \* 10 / 24 | bc | awk -F "." '{print $1}'`
165 set range0 = `echo $range1 - $div | bc | awk -F "." '{print $1}'`
166 if ($range0 < 0 ) then
171 echo WHAM will analyze range of snapshots from $range0 to $range1.
173 sed "s/xxxxx/$box/g" wham_example.inp > wham.inp
174 sed "s/XXX/$resnum/g" wham.inp > wham
175 head -4 wham > wham.in
176 grep -B 1 -A 999 "HOMOL_DIST" wham_example.inp > wham
177 cat wham.in seq wham > wham.inp
178 sed "s/BBB/$range0/g" wham.inp > wham
179 sed "s/CCC/$range1/g" wham > wham.inp
184 ################################################################################
185 # Setting up and running cluster analysis
186 echo "Setting up and running cluster analysis"
188 sed "s/XXX/$resnum/g" cluster_example.inp > clust
189 head -8 clust > clust.in
190 grep -B 1 -A 999 "HOMOL_DIST" cluster_example.inp > clus
191 cat clust.in seq clus > cluster.inp
192 sed "s/nclust=ZZZ/nclust=$nclust/g" cluster.inp > clut
193 sed "s/temper=AAA/temper=$temper/g" clut > cluster.inp
194 rm clust clust.in clus
195 #qsub start_cluster.mat