Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Hydration_freenrg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
A set of scripts used to reproduce the hydration free energy results of [Leoffler _et al_](10.1021/acs.jctc.8b00544) using BioSimSpace. Currently designed to be run specifically on the Yoko cluster.

## Usage
* First run "run_generate.sh", this will generate smiles strings for all molecules in the "ligands" folder, placing a file named "SMILES.csv" in the "python" folder. It will then generate perturbable systems in both vacuum and solvent, reading the syste>
* A folder named "Systems" will be created, containing all of the pertubable systems - this is where all simulation data will be stored. Currently 3 replicas of each system are generated.
* One system generation is complete, run "MinEqallsystems.sh", this will loop over every perturbable system in "Systems", minimising the vacuum systems, and minimising and equilibrating the solvated systems.
* Once Minimisation and equilibration are complete, run "runallsystems.sh". This will run all vacuum and solvated systems for all replicas (expect this to take a while).
* Once all simulations are complete, run "analyse_all.sh" to analyse all simulations. This will generate a file called "Free_en_outs.out" in each perturbable system folder, as well as adding to the "results.csv" file in the "energy_results" folder.
* First run ``run_generate.sh``, this will generate smiles strings for all molecules in the ``ligands`` folder, placing a file named ``SMILES.csv`` in the ``python`` folder. It will then generate perturbable systems in both vacuum and solvent.
* A folder named ``Systems`` will be created, containing all of the pertubable systems - this is where all simulation data will be stored. Currently 3 replicas of each system are generated.
* One system generation is complete, run ``min_eq_all_systems.sh``, this will loop over every perturbable system in ``Systems``, minimising the vacuum systems, and minimising and equilibrating the solvated systems. All minimisation and equilibration is perfromed using vanilla OpenMM.
* Once Minimisation and equilibration are complete, simulations can be run using either ``SOMD1`` or ``SOMD2``. In order to run simulations using ``SOMD1`` run ``run_all_somd1.sh``. This will run all vacuum and solvated systems for all replicas using the SOMD1 protocol defined in ``mineq_solv.py`` and ``mineq_vac.py`` (expect this to take a while). In order to run simulations with ``SOMD2`` run ``run_all_somd2.sh``, this will run all vacuum and solvated legs using the protol defined in ``run_one_somd2.sh``.
* Once all simulations are complete, run ``analyse_all_somd1.sh`` if SOMD1 was used to run simulations, or ``analyse_all_somd2`` if SOMD2 was used. This will generate a file called ``Free_en_outs.out`` in each perturbable system folder, as well as adding to the ``results.csv`` file in the ``energy_results`` folder.

## Notes
* Ensure that, prior to running scripts, the proper conda environment is listed in all bash scripts (``conda activate <your env name>``).
* Protocols for SOMD1 and SOMD2 are defined differently: to alter SOMD1 protocols the relevant ``mineq_*.py`` script should be altered, to alter SOMD2 protocols, the ``run_one_somd2.sh`` script sohuld be altered.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for filename in ./Systems/*; do
echo "System directory = $PWD"
systemfolder="$PWD"
for rep in ./rep*; do
cd $rep/solv
cd $rep/solvated_somd1
echo "$PWD"
cd lambda_0.0000
lj-tailcorrection -t somd.prm7 -c somd.rst7 -m somd.pert -C somd.cfg -l 0.00 -r traj000000001.dcd -s 1 1> ../freenrg-LJCOR-lam-0.000.dat 2> /dev/null
Expand All @@ -38,6 +38,6 @@ for filename in ./Systems/*; do
done
cd $maindir$filename
echo "HERE $PWD"
python $maindir/python/analysis.py > hydration_energy.out
python $maindir/python/analysis_somd1.py > hydration_energy.out
cd $maindir
done
27 changes: 27 additions & 0 deletions Hydration_freenrg/bash_scripts/analyse_all_somd2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#SBATCH -n 1
#SBATCH --cpus-per-task 4
# allocate 5 GB of memory per job
#SBATCH --mem 5000
# Set job name
#SBATCH --job-name=analysis
#SBATCH --output=./scriptouts/analysis.o
#SBATCH --error=./scriptouts/analysis.err

export CUDA_VISIBLE_DEVICES=""
eval "$(conda shell.bash hook)"
conda activate sireDEV
python3 --version
cd ../
maindir="$PWD"
echo "master dir is $maindir"
for filename in "$maindir"/Systems/*; do
cd $filename
echo "System directory = $PWD"
systemfolder="$PWD"
cd $maindir$filename
echo "HERE $PWD"
python $maindir/python/analysis.py > hydration_energy.out
cd $maindir
done

2 changes: 1 addition & 1 deletion Hydration_freenrg/bash_scripts/min_eq_all_systems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#SBATCH --error=./scriptouts/MinEq.err

eval "$(conda shell.bash hook)"
conda activate openbiosim
conda activate sireDEV
python --version
cd ../
sdir="$PWD"
Expand Down
2 changes: 1 addition & 1 deletion Hydration_freenrg/bash_scripts/min_eq_one_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#Designed to be run from within the /Systems/{currentsystem} folder
#Directory work should be handled by MinEqallsystems.sh
eval "$(conda shell.bash hook)"
conda activate openbiosim
conda activate sireDEV
python3 --version
reps=( rep0 rep1 rep2 )
rep=${reps[SLURM_ARRAY_TASK_ID]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#SBATCH --error=./scriptouts/runall.err

eval "$(conda shell.bash hook)"
conda activate openbiosim
conda activate sireDEV
python3 --version
cd ../
maindir="$PWD"
Expand All @@ -22,8 +22,8 @@ for filename in ./Systems/*; do
for rep in ./rep*; do
cd $rep
echo "rep directory = $PWD"
sbatch --wait --array=0-16 $maindir/bash_scripts/run_one_system_solv.sh
sbatch --wait --array=0-16 $maindir/bash_scripts/run_one_system_vac.sh
sbatch --wait --array=0-16 $maindir/bash_scripts/run_one_solv_somd1.sh
sbatch --wait --array=0-16 $maindir/bash_scripts/run_one_vac_somd1.sh
cd ..
done
cd $maindir
Expand Down
28 changes: 28 additions & 0 deletions Hydration_freenrg/bash_scripts/run_all_somd2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#SBATCH -n 1
# allocate 1 processor as a manager
#SBATCH --cpus-per-task 1
# allocate 0.1 GB of memory per job
#SBATCH --mem 100
# Set job name
#SBATCH --job-name=runall
#SBATCH --output=./scriptouts/runall_1fs.o
#SBATCH --error=./scriptouts/runall_1fs.err

eval "$(conda shell.bash hook)"
conda activate sireDEV
python3 --version
cd ../
maindir="$PWD"
for filename in ./Systems/*; do
cd $filename
echo "System directory = $PWD"
for rep in ./rep*; do
cd $rep
echo "rep directory = $PWD"
sbatch --wait $maindir/bash_scripts/run_one_somd2.sh
cd ..
done
cd $maindir
done

2 changes: 1 addition & 1 deletion Hydration_freenrg/bash_scripts/run_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#SBATCH --error=./scriptouts/systemgenerate.err

eval "$(conda shell.bash hook)"
conda activate openbiosim
conda activate sireDEV
python3 --version
./convtoSMILES.sh
cd ../
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lam=${lamvals[SLURM_ARRAY_TASK_ID]}

echo "lambda is: " $lam

cd ./solv/lambda_$lam
cd ./solvated_somd1/lambda_$lam
echo "$PWD"
srun somd-freenrg -C ./somd.cfg -c ./somd.rst7 -t ./somd.prm7 -m ./somd.pert -p CUDA -l $lam
cd ..
Expand Down
24 changes: 24 additions & 0 deletions Hydration_freenrg/bash_scripts/run_one_somd2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#SBATCH -n 1
# Request 1 gpu per job
#SBATCH --gres=gpu:4
# allocate 5 processors/CPUs per GPU
#SBATCH --cpus-per-gpu 4
# allocate 5 GB of memory per job
#SBATCH --mem 5000
# Set job name
#SBATCH --job-name=solv_run
#SBATCH --output=run.%j.o
#SBATCH --error=run.%j.er

eval "$(conda shell.bash hook)"
conda activate sireDEV
python3 --version
file_name_solv="mineq_solv.bss"
file_name_vac="mineq_vac.bss"
# Solvated leg
somd2 ${file_name_solv} --runtime 500ps --timestep 1fs --h-mass-factor 1.0 --num-lambda 17 --temperature 298K --pressure 1atm --checkpoint-frequency 200ns --energy-frequency 0.25ps --output-directory solvated_somd2 --no-restart --cutoff-type rf --cutoff 10.0A --overwrite --perturbable-constraint none --constraint none --somd1-compatibility
wait
#Vacuum leg
somd2 ${file_name_vac} --runtime 500ps --timestep 1fs --h-mass-factor 1.0 --num-lambda 17 --temperature 298K --checkpoint-frequency 1ns --output-directory vacuum_somd2 --energy-frequency 0.25ps --no-restart --cutoff-type rf --cutoff 10.0A --overwrite --perturbable-constraint none --constraint none --somd1-compatibility
wait
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lam=${lamvals[SLURM_ARRAY_TASK_ID]}

echo "lambda is: " $lam

cd ./vac/lambda_$lam
cd ./vacuum_somd1/lambda_$lam
echo "$PWD"
srun somd-freenrg -C ./somd.cfg -c ./somd.rst7 -t ./somd.prm7 -m ./somd.pert -p CUDA -l $lam
cd ..
Expand Down
23 changes: 0 additions & 23 deletions Hydration_freenrg/bash_scripts/test.sh

This file was deleted.

88 changes: 0 additions & 88 deletions Hydration_freenrg/python/analysis.py

This file was deleted.

Loading