Mercurial > repos > chemteam > gmx_fep
comparison alchemical_run/gmx_fep.sh @ 0:19d1d4c30402 draft
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tools/free_energy commit b73986b131478d51e119de635fea5bd752c23b99"
author | chemteam |
---|---|
date | Mon, 11 Nov 2019 13:20:39 -0500 |
parents | |
children | 453311042f29 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:19d1d4c30402 |
---|---|
1 #!/bin/bash | |
2 | |
3 # _________ read inputs from the galaxy wrapper and define some variables ____________ | |
4 | |
5 lam=$1 | |
6 iter=$((lam+1)) | |
7 | |
8 mkdir MDP | |
9 mkdir data | |
10 mkdir traj | |
11 | |
12 FREE_ENERGY=`pwd` | |
13 MDP=$FREE_ENERGY/MDP | |
14 | |
15 | |
16 for i in `seq 0 $lam` | |
17 do | |
18 cp em_steep.mdp em_steep_$i.mdp | |
19 sed -i "s/%L%/$i/" em_steep_$i.mdp | |
20 cp nvt.mdp nvt_$i.mdp | |
21 sed -i "s/%L%/$i/" nvt_$i.mdp | |
22 cp npt.mdp npt_$i.mdp | |
23 sed -i "s/%L%/$i/" npt_$i.mdp | |
24 cp md.mdp md_$i.mdp | |
25 sed -i "s/%L%/$i/" md_$i.mdp | |
26 done | |
27 mv *.mdp $MDP | |
28 | |
29 for (( i=0; i<$iter; i++ )) | |
30 do | |
31 LAMBDA=$i | |
32 | |
33 # A new directory will be created for each value of lambda | |
34 | |
35 mkdir Lambda_$LAMBDA | |
36 cd Lambda_$LAMBDA | |
37 | |
38 # _______ ENERGY MINIMIZATION STEEP _______ | |
39 | |
40 echo "Starting minimization for lambda = $LAMBDA..." | |
41 | |
42 mkdir EM | |
43 cd EM | |
44 | |
45 # Iterative calls to grompp and mdrun to run the simulations | |
46 | |
47 gmx grompp -f $MDP/em_steep_$LAMBDA.mdp -c $FREE_ENERGY/morph.gro -p $FREE_ENERGY/morph.top -o min$LAMBDA.tpr | |
48 | |
49 gmx mdrun -deffnm min$LAMBDA | |
50 | |
51 sleep 10 | |
52 | |
53 | |
54 # _______ NVT EQUILIBRATION _______ | |
55 | |
56 echo "Starting constant volume equilibration..." | |
57 | |
58 cd ../ | |
59 mkdir NVT | |
60 cd NVT | |
61 | |
62 gmx grompp -f $MDP/nvt_$LAMBDA.mdp -c ../EM/min$LAMBDA.gro -p $FREE_ENERGY/morph.top -o nvt$LAMBDA.tpr | |
63 | |
64 gmx mdrun -deffnm nvt$LAMBDA | |
65 | |
66 echo "Constant volume equilibration complete." | |
67 | |
68 sleep 10 | |
69 | |
70 # _______ NPT EQUILIBRATION _______ | |
71 | |
72 echo "Starting constant pressure equilibration..." | |
73 | |
74 cd ../ | |
75 mkdir NPT | |
76 cd NPT | |
77 | |
78 gmx grompp -f $MDP/npt_$LAMBDA.mdp -c ../NVT/nvt$LAMBDA.gro -p $FREE_ENERGY/morph.top -t ../NVT/nvt$LAMBDA.cpt -o npt$LAMBDA.tpr | |
79 | |
80 gmx mdrun -deffnm npt$LAMBDA | |
81 | |
82 echo "Constant pressure equilibration complete." | |
83 | |
84 sleep 10 | |
85 | |
86 # ________ PRODUCTION MD ___________ | |
87 | |
88 echo "Starting production MD simulation..." | |
89 | |
90 cd ../ | |
91 mkdir Production_MD | |
92 cd Production_MD | |
93 | |
94 gmx grompp -f $MDP/md_$LAMBDA.mdp -c ../NPT/npt$LAMBDA.gro -p $FREE_ENERGY/morph.top -t ../NPT/npt$LAMBDA.cpt -o md$LAMBDA.tpr | |
95 | |
96 gmx mdrun -deffnm md$LAMBDA | |
97 | |
98 echo "Production MD complete." | |
99 | |
100 # End | |
101 echo "Ending. Job completed for lambda = $LAMBDA" | |
102 | |
103 cd $FREE_ENERGY | |
104 done | |
105 | |
106 cp Lambda_*/Production_MD/*.xvg data/ | |
107 tar cf data.tar data/ | |
108 | |
109 cp Lambda_*/Production_MD/*.trr traj/ | |
110 tar cf traj.tar traj/ | |
111 | |
112 exit; | |
113 | |
114 |