$MPIRUN -machinefile $PBS_NODEFILE -np 2 $CLUSTER_WHAM_BIN
+if `awk '{cap=toupper($0); if (cap!=$0) {print 1;exit}}' file.seq` then
+#no allatom conversion/refinementkx for proteins with D-aminoacids
+ ln -s file_wham_T*K_ave.pdb ave
+ sed -n '/ENERGY/,/ENDMDL/p' ave >tmp.pdb
+ setenv numstruc `grep ENERGY tmp.pdb|wc -l`
+ setenv allline `cat tmp.pdb|wc -l`
+ setenv onestruc `echo $allline "/" $numstruc| bc -l|sed 's/\.0*//'`
+ foreach i (2 4 6 8 10)
+ setenv headval `echo $i "*" $onestruc|bc -l`
+ setenv halfi `echo $i/2|bc`
+ head -n $headval tmp.pdb | tail -n $onestruc >MODEL${halfi}.pdb
+ end
+ rm ave tmp.pdb
+else
+# proteins with L-aminoacids only
ln -s file_wham_T*K_ave.pdb ave
../files/cluster2allatom.sh ave
rm ave
foreach i (`seq 1 5`)
../files/refine.sh MODEL$i.pdb $ssbond
end
+endif
/users2/local/pymol_1.6/pymol -c ../files/model.pml