Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayarri committed Jun 25, 2024
1 parent cde6a42 commit 7361334
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1,969 deletions.
33 changes: 19 additions & 14 deletions biobb_wf_protein-complex_md_setup/docs/source/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import nglview
import ipywidgets
import os
import zipfile
import sys

pdbCode = "3HTB"
ligandCode = "JZ4"
Expand All @@ -132,6 +133,9 @@ Splitting the molecule in **three different files**:
***
**Building Blocks** used:
- [Pdb](https://biobb-io.readthedocs.io/en/latest/api.html#module-api.pdb) from **biobb_io.api.pdb**
- [ExtractHeteroAtoms](https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.extract_heteroatoms) from **biobb_structure_utils.utils.extract_heteroatoms**
- [ExtractMolecule](https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.extract_molecule) from **biobb_structure_utils.utils.extract_molecule**
- [CatPDB](https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.cat_pdb) from **biobb_structure_utils.utils.cat_pdb**
***


Expand Down Expand Up @@ -440,7 +444,7 @@ from biobb_gromacs.gromacs.genrestr import genrestr
output_restraints_top = ligandCode+'_posres.itp'
prop = {
'force_constants': "1000 1000 1000",
'restrained_group': "System"
'restrained_group': "System_&_!H*"
}

# Create and launch bb
Expand All @@ -461,6 +465,7 @@ This new structure is needed for **GROMACS** as it is **force field-compliant**,
***
**Building Blocks** used:
- [GMXTrjConvStr](https://biobb-analysis.readthedocs.io/en/latest/gromacs.html#module-gromacs.gmx_trjconv_str) from **biobb_analysis.gromacs.gmx_trjconv_str**
- [CatPDB](https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.cat_pdb) from **biobb_structure_utils.utils.cat_pdb**
***


Expand Down Expand Up @@ -513,7 +518,7 @@ Building new **protein-ligand complex** GROMACS topology file with:
NOTE: From this point on, the **protein-ligand complex structure and topology** generated can be used in a regular MD setup.
***
**Building Blocks** used:
- [AppendLigand](https://biobb-md.readthedocs.io/en/latest/modules.html) from **biobb_gromacs.gromacs_extra.append_ligand** (NOTE: link should be updated with the documentation)
- [AppendLigand](https://biobb-gromacs.readthedocs.io/en/latest/gromacs_extra.html#gromacs-extra-append-ligand-module) from **biobb_gromacs.gromacs_extra.append_ligand**
***


Expand Down Expand Up @@ -640,7 +645,7 @@ prop = {
'mdp':{
'nsteps':'5000'
},
'simulation_type':'minimization',
'simulation_type':'ions',
'maxwarn': 1
}
output_gppion_tpr = pdbCode+'_'+ligandCode+'_complex_gppion.tpr'
Expand All @@ -653,8 +658,8 @@ grompp(input_gro_path=output_solvate_gro,
```

<a id="ionsStep2"></a>
### Step 2: Adding ions to neutralize the system and reach a 0.05 molar concentration
Replace **solvent molecules** with **ions** to **neutralize** the system and reaching a **0.05 molar ionic concentration**
### Step 2: Adding ions to neutralize the system
Replace **solvent molecules** with **ions** to **neutralize** the system.


```python
Expand All @@ -664,7 +669,7 @@ from biobb_gromacs.gromacs.genion import genion
# Create prop dict and inputs/outputs
prop={
'neutral':True,
'concentration':0.05
'concentration':0
}
output_genion_gro = pdbCode+'_'+ligandCode+'_genion.gro'
output_genion_top_zip = pdbCode+'_'+ligandCode+'_genion_top.zip'
Expand Down Expand Up @@ -1356,16 +1361,16 @@ view
## Output files

Important **Output files** generated:
- {{output_md_gro}}: **Final structure** (snapshot) of the MD setup protocol.
- {{output_md_trr}}: **Final trajectory** of the MD setup protocol.
- {{output_md_cpt}}: **Final checkpoint file**, with information about the state of the simulation. It can be used to **restart** or **continue** a MD simulation.
- {{output_gppmd_tpr}}: **Final tpr file**, GROMACS portable binary run input file. This file contains the starting structure of the **MD setup free MD simulation step**, together with the molecular topology and all the simulation parameters. It can be used to **extend** the simulation.
- {{output_genion_top_zip}}: **Final topology** of the MD system. It is a compressed zip file including a **topology file** (.top) and a set of auxiliary **include topology** files (.itp).
- **output_md_gro** (3HTB_JZ4_md.gro): **Final structure** (snapshot) of the MD setup protocol.
- **output_md_trr** (3HTB_JZ4_md.trr): **Final trajectory** of the MD setup protocol.
- **output_md_cpt** (3HTB_JZ4_md.cpt): **Final checkpoint file**, with information about the state of the simulation. It can be used to **restart** or **continue** a MD simulation.
- **output_gppmd_tpr** (3HTB_JZ4_gppmd.tpr): **Final tpr file**, GROMACS portable binary run input file. This file contains the starting structure of the **MD setup free MD simulation step**, together with the molecular topology and all the simulation parameters. It can be used to **extend** the simulation.
- **output_genion_top_zip** (3HTB_JZ4_genion_top.zip): **Final topology** of the MD system. It is a compressed zip file including a **topology file** (.top) and a set of auxiliary **include topology** files (.itp).

**Analysis** (MD setup check) output files generated:
- {{output_rms_first}}: **Root Mean Square deviation (RMSd)** against **minimized and equilibrated structure** of the final **free MD run step**.
- {{output_rms_exp}}: **Root Mean Square deviation (RMSd)** against **experimental structure** of the final **free MD run step**.
- {{output_rgyr}}: **Radius of Gyration** of the final **free MD run step** of the **setup pipeline**.
- **output_rms_first** (3HTB_JZ4_rms_first.xvg): **Root Mean Square deviation (RMSd)** against **minimized and equilibrated structure** of the final **free MD run step**.
- **output_rms_exp** (3HTB_JZ4_rms_exp.xvg): **Root Mean Square deviation (RMSd)** against **experimental structure** of the final **free MD run step**.
- **output_rgyr** (3HTB_JZ4_rgyr.xvg): **Radius of Gyration** of the final **free MD run step** of the **setup pipeline**.


***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7666,6 +7666,7 @@ <h2 id="Input-parameters">Input parameters<a class="anchor-link" href="#Input-pa
<span class="kn">import</span> <span class="nn">ipywidgets</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">zipfile</span>
<span class="kn">import</span> <span class="nn">sys</span>

<span class="n">pdbCode</span> <span class="o">=</span> <span class="s2">"3HTB"</span>
<span class="n">ligandCode</span> <span class="o">=</span> <span class="s2">"JZ4"</span>
Expand Down Expand Up @@ -7696,6 +7697,9 @@ <h2 id="Fetching-PDB-structure">Fetching PDB structure<a class="anchor-link" hre
<p><strong>Building Blocks</strong> used:</p>
<ul>
<li><a href="https://biobb-io.readthedocs.io/en/latest/api.html#module-api.pdb">Pdb</a> from <strong>biobb_io.api.pdb</strong></li>
<li><a href="https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.extract_heteroatoms">ExtractHeteroAtoms</a> from <strong>biobb_structure_utils.utils.extract_heteroatoms</strong></li>
<li><a href="https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.extract_molecule">ExtractMolecule</a> from <strong>biobb_structure_utils.utils.extract_molecule</strong></li>
<li><a href="https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.cat_pdb">CatPDB</a> from <strong>biobb_structure_utils.utils.cat_pdb</strong></li>
</ul>
<hr/>
</div>
Expand Down Expand Up @@ -8233,7 +8237,7 @@ <h3 id="Step-2:-Generating-the-position-restraints-file">Step 2: Generating the
<span class="n">output_restraints_top</span> <span class="o">=</span> <span class="n">ligandCode</span><span class="o">+</span><span class="s1">'_posres.itp'</span>
<span class="n">prop</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">'force_constants'</span><span class="p">:</span> <span class="s2">"1000 1000 1000"</span><span class="p">,</span>
<span class="s1">'restrained_group'</span><span class="p">:</span> <span class="s2">"System"</span>
<span class="s1">'restrained_group'</span><span class="p">:</span> <span class="s2">"System_&_!H*"</span>
<span class="p">}</span>

<span class="c1"># Create and launch bb</span>
Expand Down Expand Up @@ -8265,6 +8269,7 @@ <h2 id="Create-new-protein-ligand-complex-structure-file">Create new protein-lig
<p><strong>Building Blocks</strong> used:</p>
<ul>
<li><a href="https://biobb-analysis.readthedocs.io/en/latest/gromacs.html#module-gromacs.gmx_trjconv_str">GMXTrjConvStr</a> from <strong>biobb_analysis.gromacs.gmx_trjconv_str</strong></li>
<li><a href="https://biobb-structure-utils.readthedocs.io/en/latest/utils.html#module-utils.cat_pdb">CatPDB</a> from <strong>biobb_structure_utils.utils.cat_pdb</strong></li>
</ul>
<hr/>
</div>
Expand Down Expand Up @@ -8337,7 +8342,7 @@ <h2 id="Create-new-protein-ligand-complex-topology-file">Create new protein-liga
<hr/>
<p><strong>Building Blocks</strong> used:</p>
<ul>
<li><a href="https://biobb-md.readthedocs.io/en/latest/modules.html">AppendLigand</a> from <strong>biobb_gromacs.gromacs_extra.append_ligand</strong> (NOTE: link should be updated with the documentation)</li>
<li><a href="(https://biobb-gromacs.readthedocs.io/en/latest/gromacs_extra.html#gromacs-extra-append-ligand-module">AppendLigand</a> from <strong>biobb_gromacs.gromacs_extra.append_ligand</strong> </li>
</ul>
<hr/>
</div>
Expand Down Expand Up @@ -8565,7 +8570,7 @@ <h3 id="Step-1:-Creating-portable-binary-run-file-for-ion-generation">Step 1: Cr
<span class="s1">'mdp'</span><span class="p">:{</span>
<span class="s1">'nsteps'</span><span class="p">:</span><span class="s1">'5000'</span>
<span class="p">},</span>
<span class="s1">'simulation_type'</span><span class="p">:</span><span class="s1">'minimization'</span><span class="p">,</span>
<span class="s1">'simulation_type'</span><span class="p">:</span><span class="s1">'ions'</span><span class="p">,</span>
<span class="s1">'maxwarn'</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
<span class="n">output_gppion_tpr</span> <span class="o">=</span> <span class="n">pdbCode</span><span class="o">+</span><span class="s1">'_'</span><span class="o">+</span><span class="n">ligandCode</span><span class="o">+</span><span class="s1">'_complex_gppion.tpr'</span>
Expand All @@ -8588,7 +8593,7 @@ <h3 id="Step-1:-Creating-portable-binary-run-file-for-ion-generation">Step 1: Cr
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
<p><a id="ionsStep2"></a></p>
<h3 id="Step-2:-Adding-ions-to-neutralize-the-system-and-reach-a-0.05-molar-concentration">Step 2: Adding ions to neutralize the system and reach a 0.05 molar concentration<a class="anchor-link" href="#Step-2:-Adding-ions-to-neutralize-the-system-and-reach-a-0.05-molar-concentration"></a></h3><p>Replace <strong>solvent molecules</strong> with <strong>ions</strong> to <strong>neutralize</strong> the system and reaching a <strong>0.05 molar ionic concentration</strong></p>
<h3 id="Step-2:-Adding-ions-to-neutralize-the-system-and-reach-a-0.05-molar-concentration">Step 2: Adding ions to neutralize the system<a class="anchor-link" href="#Step-2:-Adding-ions-to-neutralize-the-system-and-reach-a-0.05-molar-concentration"></a></h3><p>Replace <strong>solvent molecules</strong> with <strong>ions</strong> to <strong>neutralize</strong> the system.</p>
</div>
</div>
</div>
Expand All @@ -8606,7 +8611,7 @@ <h3 id="Step-2:-Adding-ions-to-neutralize-the-system-and-reach-a-0.05-molar-conc
<span class="c1"># Create prop dict and inputs/outputs</span>
<span class="n">prop</span><span class="o">=</span><span class="p">{</span>
<span class="s1">'neutral'</span><span class="p">:</span><span class="kc">True</span><span class="p">,</span>
<span class="s1">'concentration'</span><span class="p">:</span><span class="mf">0.05</span>
<span class="s1">'concentration'</span><span class="p">:</span><span class="mf">0</span>
<span class="p">}</span>
<span class="n">output_genion_gro</span> <span class="o">=</span> <span class="n">pdbCode</span><span class="o">+</span><span class="s1">'_'</span><span class="o">+</span><span class="n">ligandCode</span><span class="o">+</span><span class="s1">'_genion.gro'</span>
<span class="n">output_genion_top_zip</span> <span class="o">=</span> <span class="n">pdbCode</span><span class="o">+</span><span class="s1">'_'</span><span class="o">+</span><span class="n">ligandCode</span><span class="o">+</span><span class="s1">'_genion_top.zip'</span>
Expand Down Expand Up @@ -9787,17 +9792,17 @@ <h3 id="Step-3:-Visualizing-the-generated-dehydrated-trajectory.">Step 3: Visual
<p><a id="output"></a></p>
<h2 id="Output-files">Output files<a class="anchor-link" href="#Output-files"></a></h2><p>Important <strong>Output files</strong> generated:</p>
<ul>
<li>3HTB_JZ4_md.gro: <strong>Final structure</strong> (snapshot) of the MD setup protocol.</li>
<li>3HTB_JZ4_md.trr: <strong>Final trajectory</strong> of the MD setup protocol.</li>
<li>3HTB_JZ4_md.cpt: <strong>Final checkpoint file</strong>, with information about the state of the simulation. It can be used to <strong>restart</strong> or <strong>continue</strong> a MD simulation.</li>
<li>3HTB_JZ4_gppmd.tpr: <strong>Final tpr file</strong>, GROMACS portable binary run input file. This file contains the starting structure of the <strong>MD setup free MD simulation step</strong>, together with the molecular topology and all the simulation parameters. It can be used to <strong>extend</strong> the simulation.</li>
<li>3HTB_JZ4_genion_top.zip: <strong>Final topology</strong> of the MD system. It is a compressed zip file including a <strong>topology file</strong> (.top) and a set of auxiliar <strong>include topology</strong> files (.itp).</li>
<li><strong>output_md_gro</strong> (3HTB_JZ4_md.gro): <strong>Final structure</strong> (snapshot) of the MD setup protocol.</li>
<li><strong>output_md_trr</strong> (3HTB_JZ4_md.trr): <strong>Final trajectory</strong> of the MD setup protocol.</li>
<li><strong>output_md_cpt</strong> (3HTB_JZ4_md.cpt): <strong>Final checkpoint file</strong>, with information about the state of the simulation. It can be used to <strong>restart</strong> or <strong>continue</strong> a MD simulation.</li>
<li><strong>output_gppmd_tpr</strong> (3HTB_JZ4_gppmd.tpr): <strong>Final tpr file</strong>, GROMACS portable binary run input file. This file contains the starting structure of the <strong>MD setup free MD simulation step</strong>, together with the molecular topology and all the simulation parameters. It can be used to <strong>extend</strong> the simulation.</li>
<li><strong>output_genion_top_zip</strong> (3HTB_JZ4_genion_top.zip): <strong>Final topology</strong> of the MD system. It is a compressed zip file including a <strong>topology file</strong> (.top) and a set of auxiliar <strong>include topology</strong> files (.itp).</li>
</ul>
<p><strong>Analysis</strong> (MD setup check) output files generated:</p>
<ul>
<li>3HTB_JZ4_rms_first.xvg: <strong>Root Mean Square deviation (RMSd)</strong> against <strong>minimized and equilibrated structure</strong> of the final <strong>free MD run step</strong>.</li>
<li>3HTB_JZ4_rms_exp.xvg: <strong>Root Mean Square deviation (RMSd)</strong> against <strong>experimental structure</strong> of the final <strong>free MD run step</strong>.</li>
<li>3HTB_JZ4_rgyr.xvg: <strong>Radius of Gyration</strong> of the final <strong>free MD run step</strong> of the <strong>setup pipeline</strong>.</li>
<li><strong>output_rms_first</strong> (3HTB_JZ4_rms_first.xvg): <strong>Root Mean Square deviation (RMSd)</strong> against <strong>minimized and equilibrated structure</strong> of the final <strong>free MD run step</strong>.</li>
<li><strong>output_rms_exp</strong> (3HTB_JZ4_rms_exp.xvg): <strong>Root Mean Square deviation (RMSd)</strong> against <strong>experimental structure</strong> of the final <strong>free MD run step</strong>.</li>
<li><strong>output_rgyr</strong> (3HTB_JZ4_rgyr.xvg): <strong>Radius of Gyration</strong> of the final <strong>free MD run step</strong> of the <strong>setup pipeline</strong>.</li>
</ul>
</div>
</div>
Expand Down
Loading

0 comments on commit 7361334

Please sign in to comment.