Skip to content

Commit

Permalink
vacuum minimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ndonyapour committed Oct 23, 2023
1 parent dd3f984 commit f472dfe
Show file tree
Hide file tree
Showing 18 changed files with 201 additions and 38 deletions.
16 changes: 15 additions & 1 deletion cwl_adapters/combine_structure.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ baseCommand: ['python', '/combine_structure.py']

hints:
DockerRequirement:
dockerPull: ndonyapour/combine_structure
dockerPull: ndonyapour/combine_structure_fix

inputs:
input_structure1:
Expand Down Expand Up @@ -40,6 +40,20 @@ inputs:
- edam:format_3877
inputBinding:
prefix: --input_structure2

input_top_zip_path:
label: Input zip file
doc: |-
Input zip file
Type: string
File type: input
Accepted formats: zip
Example file: https://github.com/bioexcel/biobb_md/blob/master/biobb_md/test/data/gromacs/genion.zip
type: File
format:
- edam:format_3987
inputBinding:
prefix: --input_top_zip_path

output_structure_path:
label: Output combined PDB file path
Expand Down
1 change: 1 addition & 0 deletions examples/docking/docking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ steps:
in:
input_structure1: '*receptor.xyz' # '*receptor_hydrogens.pdb'
input_structure2: '*pose_ligand.xyz'
input_top_zip_path: '*complex_vac.zip'
output_structure_path: '&complex_vac.pdb'

wic:
Expand Down
36 changes: 28 additions & 8 deletions examples/docking/dsb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ steps:
sdf_path: ~sdf_path
- stability.yml:
in:
crd_path: '*complex_vac.pdb'
top_zip_path: '*complex_vac.zip'
nsteps: 10000
dt: 0.002
temperature: 298.0
pressure: 1.0
- stability.yml:
in:
crd_path: '*ligand_GMX.gro'
top_zip_path: '*ligand_GMX.zip'
nsteps: 10000
dt: 0.002
temperature: 298.0
Expand All @@ -31,13 +35,18 @@ wic:
environment:
action: checkpoint
steps:
(1, setup.yml):
(1, setup_vac_min.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(3, solv_ion.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(2, basic.yml):
in:
top_zip_path: '*genion_complex.zip'
wic:
steps:
(3, prod.yml):
Expand Down Expand Up @@ -72,13 +81,24 @@ wic:
action: restore
save_defs: ['genion_complex.zip', 'prod_complex.gro']
steps:
(1, setup.yml):
(1, setup_vac_min.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_ligand.zip'
(1, topology.yml):
wic:
steps:
(1, editconf):
in:
output_crd_path: '&ligand_box.g96'
(3, solv_ion.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_ligand.zip'
(2, basic.yml):
in:
top_zip_path: '*genion_ligand.zip'
wic:
steps:
(3, prod.yml):
Expand Down
1 change: 1 addition & 0 deletions examples/docking/gen_topol_params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ steps:
in:
input_structure1: ~input_receptor_xyz_path
input_structure2: '*pose_ligand.xyz'
input_top_zip_path: '*complex_vac.zip'
output_structure_path: '&complex_vac.pdb'

wic:
Expand Down
13 changes: 9 additions & 4 deletions examples/docking/vs_demo_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,18 @@ wic:
wic:
inlineable: False # Due to yml wic tag inlineing issue and ~ inputs
steps:
(1, setup.yml):
(1, setup_vac_min.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(3, solv_ion.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(2, basic.yml):
in:
top_zip_path: '*genion_complex.zip'
wic:
steps:
(3, prod.yml):
Expand Down
13 changes: 9 additions & 4 deletions examples/docking/vs_demo_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,18 @@ wic:
wic:
inlineable: False # Due to yml wic tag inlineing issue and ~ inputs
steps:
(1, setup.yml):
(1, setup_vac_min.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(3, solv_ion.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(2, basic.yml):
in:
top_zip_path: '*genion_complex.zip'
wic:
steps:
(3, prod.yml):
Expand Down
13 changes: 9 additions & 4 deletions examples/docking/vs_demo_4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,18 @@ wic:
wic:
inlineable: False # Due to yml wic tag inlineing issue and ~ inputs
steps:
(1, setup.yml):
(1, setup_vac_min.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(3, solv_ion.yml):
wic:
steps:
(4, genion):
in:
output_top_zip_path: '&genion_complex.zip'
(2, basic.yml):
in:
top_zip_path: '*genion_complex.zip'
wic:
steps:
(3, prod.yml):
Expand Down
6 changes: 6 additions & 0 deletions examples/gromacs/basic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
inputs:
top_zip_path:
type: File
format:
- edam:format_3987
nsteps:
type: int
dt:
Expand All @@ -16,6 +20,8 @@ steps:
# to this level and use the following syntax to pass it to only one call site.
# (Moreover, the former will create multiple definitions of &min.tpr, which is not allowed.)
- min.yml:
in:
top_zip_path: ~top_zip_path
- equil.yml:
- prod.yml:
in:
Expand Down
7 changes: 7 additions & 0 deletions examples/gromacs/cg.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
inputs:
top_zip_path:
type: File
format:
- edam:format_3987

steps:
- grompp:
in:
input_top_zip_path: ~top_zip_path
config:
mdp:
integrator: cg
Expand Down
10 changes: 10 additions & 0 deletions examples/gromacs/min.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
inputs:
top_zip_path:
type: File
format:
- edam:format_3987

steps:
- steep.yml:
in:
top_zip_path: ~top_zip_path
# Fatal error:
# The coordinates could not be constrained. Minimizer 'cg' can not handle
# constraint failures, use minimizer 'steep' before using 'cg'.
- cg.yml:
in:
top_zip_path: ~top_zip_path
# Fatal error:
# The combination of constraints and L-BFGS minimization is not implemented.
# Either do not use constraints, or use another minimizer (e.g. steepest
Expand Down
33 changes: 31 additions & 2 deletions examples/gromacs/setup_vac_min.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
inputs:
crd_path:
type: File
format:
- edam:format_1476
- edam:format_2033
top_zip_path:
type: File
format:
- edam:format_3987

steps:
- topology.yml:
in:
crd_path: ~crd_path
- min.yml: # Minimize in vacuum first, then in solvent.
in:
top_zip_path: ~top_zip_path
- solv_ion.yml:

in:
top_zip_path: ~top_zip_path
wic:
graphviz:
label: System Setup
label: System Setup
steps:
(1, topology.yml):
wic:
graphviz:
label: 'Initialize\nPeriodic Box'
(2, min.yml):
wic:
graphviz:
label: 'Vacuum Minimization'
(3, solv_ion.yml):
wic:
graphviz:
label: 'Add Water\nSolvent'
28 changes: 21 additions & 7 deletions examples/gromacs/solv_ion.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
inputs:
top_zip_path:
type: File
format:
- edam:format_3987

steps:
- editconf:
# - editconf:
# in:
# #input_crd_path: ~crd_path
# config:
# box_type: cubic
# distance_to_molecule: 1.2
- gmx_editconf:
in:
config:
box_type: cubic
distance_to_molecule: 1.0
#input_crd_path: ~crd_path
#input_crd_path: '*complex_vac.pdb'
align_principal_axes: 0
box_type: cubic
distance_to_molecule: 1.2
- solvate:
in:
input_top_zip_path: '*complex_vac.zip'
input_top_zip_path: ~top_zip_path
output_crd_path: '&solvate.gro'
output_top_zip_path: '&solvate.zip'
- grompp:
Expand All @@ -28,10 +42,10 @@ wic:
graphviz:
label: Solvation & Ionization
ranksame:
- (1, editconf)
- (1, gmx_editconf)
- (4, genion)
steps:
(1, editconf):
(1, gmx_editconf):
wic:
graphviz:
label: 'Initialize\nPeriodic Box'
Expand Down
3 changes: 2 additions & 1 deletion examples/gromacs/stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ inputs:
- edam:format_3987

steps:
- setup.yml:
- setup_vac_min.yml:
in:
crd_path: ~crd_path
top_zip_path: ~top_zip_path
- basic.yml:
in:
top_zip_path: '*genion.zip'
nsteps: ~nsteps
dt: ~dt
ref-t: ~temperature
Expand Down
7 changes: 7 additions & 0 deletions examples/gromacs/steep.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
inputs:
top_zip_path:
type: File
format:
- edam:format_3987

# On my machine, 10 iterations of steepest descent is sufficient to prevent
# conjugate gradient from crashing. (i.e. pytest works for me!)
# But using only 10 iterations is causing the tests on github actions to fail!
# 25 seems to work, but let's just set it to 100.
steps:
- grompp:
in:
input_top_zip_path: ~top_zip_path
config:
mdp:
integrator: steep
Expand Down
9 changes: 8 additions & 1 deletion examples/gromacs/topology.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
inputs:
crd_path:
type: File
format:
- edam:format_1476
- edam:format_2033

steps:
# We want to perform vacuum minimization first, before solvation and ionization.
# NOTE: Gromacs no longer supports non-periodic boundary conditions (!!!),
# so we must emulate a vacuum by using a very large (1000 Angstrom) box.
- editconf:
in:
input_crd_path: '*complex_vac.pdb'
input_crd_path: ~crd_path
output_crd_path: '&complex_box.g96'
config:
box_type: cubic
Expand Down
2 changes: 2 additions & 0 deletions examples/gromacs/tutorial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ steps:
- modeling.yml:
- stability.yml:
in:
crd_path: '*complex_vac.pdb'
top_zip_path: '*complex_vac.zip'
nsteps: 10000
dt: 0.002
temperature: 298.0
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/Dockerfile_combine_structure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM condaforge/mambaforge
# NOT mambaforge-pypy3 (rdkit is incompatible with pypy)

RUN mamba install -c conda-forge rdkit
RUN mamba install -c conda-forge rdkit mdanalysis gromacs

ADD combine_structure.py .
Loading

0 comments on commit f472dfe

Please sign in to comment.