Skip to content

Commit

Permalink
centering the traj after equilibration..
Browse files Browse the repository at this point in the history
  • Loading branch information
RiesBen committed Apr 3, 2024
1 parent faf3a5d commit 561deeb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
25 changes: 21 additions & 4 deletions src/abfe/rules/ligand_fep_workflow/ligand_fep_setup.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ rule fep_setup_ligand:
equil_gro=run_path+"/ligand/equil-mdsim/npt_equil2/npt_equil2.gro",
params:
sim_dir=run_path+"/ligand/fep",
feptop_dir=run_path+"/ligand/fep/fep-topology",

vdw_windows=n_vdw_windows,
vdw_range=" ".join(map(str, lam_vdw_range)),
coul_windows=n_coul_windows,
Expand All @@ -28,20 +30,35 @@ rule fep_setup_ligand:
fep_gro=run_path+"/ligand/fep/fep-topology/equil.gro"
shell:
'''
set -e
echo "build initial dirs"
mkdir -p {params.sim_dir}/template
mkdir -p {params.sim_dir}/fep-topology
cp -r {params.template_dir}/template/* {params.sim_dir}/template
cp -r {input.ligand_top}/* {params.sim_dir}/fep-topology
cp {input.equil_gro} {params.sim_dir}/fep-topology/equil.gro
echo "center equil sim"
echo "0" | gmx trjconv -s {params.feptop_dir}/ligand.gro -f {input.equil_gro} -o {params.feptop_dir}/whole.gro -pbc whole
echo "0" | gmx trjconv -s {params.feptop_dir}/ligand.gro -f {params.feptop_dir}/whole.gro -o {params.feptop_dir}/nojump.gro -pbc nojump
echo "1 0" | gmx trjconv -s {params.feptop_dir}/ligand.gro -f {params.feptop_dir}/nojump.gro -o {output.fep_gro} -pbc mol -center -ur compact
rm {params.feptop_dir}/whole.gro {params.feptop_dir}/nojump.gro
# create simulation directory
echo "build simulation dirs:"
mkdir -p {params.sim_dir}/simulation
let max_window={params.vdw_windows}
for i in $(seq 0 $((max_window-1)))
do
echo "build simulation dirs: mk"
mkdir -p {params.sim_dir}/simulation/vdw.${{i}}
cp -r {params.sim_dir}/template/vdw/* {params.sim_dir}/simulation/vdw.${{i}}
echo "build simulation dirs: cp"
cp -rf {params.sim_dir}/template/vdw/* {params.sim_dir}/simulation/vdw.${{i}}
echo "build simulation dirs: sed"
sed -i "s/<state>/${{i}}/g" {params.sim_dir}/simulation/vdw.${{i}}/*/*.mdp
sed -i "s/<lamRange>/{params.vdw_range}/g" {params.sim_dir}/simulation/vdw.${{i}}/*/*.mdp
done
Expand All @@ -50,7 +67,7 @@ rule fep_setup_ligand:
for i in $(seq 0 $((max_window-1)))
do
mkdir -p {params.sim_dir}/simulation/coul.${{i}}
cp -r {params.sim_dir}/template/coul/* {params.sim_dir}/simulation/coul.${{i}}
cp -rf {params.sim_dir}/template/coul/* {params.sim_dir}/simulation/coul.${{i}}
sed -i "s/<state>/${{i}}/g" {params.sim_dir}/simulation/coul.${{i}}/*/*.mdp
sed -i "s/<lamRange>/{params.coul_range}/g" {params.sim_dir}/simulation/coul.${{i}}/*/*.mdp
done
Expand Down
16 changes: 8 additions & 8 deletions src/abfe/utils/check_dag_completion.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/usr/bin/env bash

ori=${PWD}
snakemake --unlock -c1
snakemake -R $(snakemake --list-code-changes) --touch -c4
snakemake --unlock -c1 -s Snakefile.smk
snakemake -R $(snakemake --list-code-changes -s Snakefile.smk) --touch -c4 -s Snakefile.smk

for dir in */?
do
cd ${dir}
snakemake --unlock -c1
snakemake -R $(snakemake --list-code-changes) --touch -c4
snakemake --unlock -c1 -s Snakefile.smk
snakemake -R $(snakemake --list-code-changes -s Snakefile.smk) --touch -c4 -s Snakefile.smk
cd ${ori}
done

for dir in */?/ligand
do
cd ${dir}
snakemake --unlock -c1
snakemake -R $(snakemake --list-code-changes) --touch -c4
snakemake --unlock -c1 -s Snakefile.smk
snakemake -R $(snakemake --list-code-changes -s Snakefile.smk) --touch -c4 -s Snakefile.smk
cd ${ori}
done

for dir in */?/complex
do
cd ${dir}
snakemake --unlock -c1
snakemake -R $(snakemake --list-code-changes) --touch -c4
snakemake --unlock -c1 -s Snakefile.smk
snakemake -R $(snakemake --list-code-changes -s Snakefile.smk) --touch -c4 -s Snakefile.smk
cd ${ori}
done

0 comments on commit 561deeb

Please sign in to comment.