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