Skip to content

Commit

Permalink
biobb_dna updated to 4.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayarri committed Jun 17, 2024
1 parent 2bd5568 commit 361a353
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ log*.*
.ipynb_checkpoints/
biobb_wf_dna_helparms/notebooks/*/
!biobb_wf_dna_helparms/notebooks/TRAJ/
!biobb_wf_dna_helparms/notebooks/.curvesplus/
biobb_wf_dna_helparms/notebooks/*.jpg
biobb_wf_dna_helparms/notebooks/*.gif
biobb_wf_dna_helparms/notebooks/*.web.ipynb
Expand Down
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ channels:
- conda-forge
- bioconda
dependencies:
- biobb_dna==4.2.1
- biobb_dna==4.2.2
- matplotlib
65 changes: 54 additions & 11 deletions biobb_wf_dna_helparms/docs/source/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,58 @@ jupyter-notebook biobb_wf_dna_helparms/notebooks/biobb_wf_dna_helparms.ipynb
title="Bioexcel2 logo" width="400" />
***

***

## Initializing colab
The two cells below are used only in case this notebook is executed via **Google Colab**. Take into account that, for running conda on **Google Colab**, the **condacolab** library must be installed. As [explained here](https://pypi.org/project/condacolab/), the installation requires a **kernel restart**, so when running this notebook in **Google Colab**, don't run all cells until this **installation** is properly **finished** and the **kernel** has **restarted**.


```python
# Only executed when using google colab
import sys
if 'google.colab' in sys.modules:
import subprocess
from pathlib import Path
try:
subprocess.run(["conda", "-V"], check=True)
except FileNotFoundError:
subprocess.run([sys.executable, "-m", "pip", "install", "condacolab"], check=True)
import condacolab
condacolab.install()
# Clone repository
repo_URL = "https://github.com/bioexcel/biobb_wf_dna_helparms.git"
repo_name = Path(repo_URL).name.split('.')[0]
if not Path(repo_name).exists():
subprocess.run(["mamba", "install", "-y", "git"], check=True)
subprocess.run(["git", "clone", repo_URL], check=True)
print("⏬ Repository properly cloned.")
# Install environment
print("⏳ Creating environment...")
env_file_path = f"{repo_name}/conda_env/environment.yml"
subprocess.run(["mamba", "env", "update", "-n", "base", "-f", env_file_path], check=True)
print("👍 Conda environment successfully created and updated.")
```


```python
# Enable widgets for colab
if 'google.colab' in sys.modules:
from google.colab import output
output.enable_custom_widget_manager()
# Change working dir
import os
os.chdir("biobb_wf_dna_helparms/biobb_wf_dna_helparms/notebooks/abc_setup")
print(f"📂 New working directory: {os.getcwd()}")
```

<a id="input"></a>
## Input parameters
**Input parameters** needed:
- **seq**: Sequence of the DNA structure (e.g. CGCGAATTCGCG)
- **seq_comp**: Complementary sequence of the given DNA structure (e.g. CGCGAATTCGCG)

- **traj**: Trajectory for a 500ns Drew Dickerson Dodecamer MD simulation (taken from [BigNASim](https://mmb.irbbarcelona.org/BIGNASim/))
- **top**: Associated topology for the MD trajectory

```python
# Auxiliary libraries
Expand All @@ -71,16 +122,6 @@ import ipywidgets

```

<a id="input"></a>
## Input parameters
**Input parameters** needed:
- **seq**: Sequence of the DNA structure (e.g. CGCGAATTCGCG)
- **seq_comp**: Complementary sequence of the given DNA structure (e.g. CGCGAATTCGCG)

- **traj**: Trajectory for a 500ns Drew Dickerson Dodecamer MD simulation (taken from [BigNASim](https://mmb.irbbarcelona.org/BIGNASim/))
- **top**: Associated topology for the MD trajectory


```python
# Input parameters
seq = "CGCGAATTCGCG"
Expand Down Expand Up @@ -146,7 +187,9 @@ curves_out_cda = "curves.out.cda"

prop = {
's1range' : '1:12',
's2range' : '24:13'
's2range' : '24:13',
# uncomment when running in google colab
# 'stdlib_path': '.curvesplus/standard'
}

biobb_curves(
Expand Down
126 changes: 100 additions & 26 deletions biobb_wf_dna_helparms/html/biobb_wf_dna_helparms.web.html
Original file line number Diff line number Diff line change
Expand Up @@ -14564,33 +14564,78 @@ <h2 id="Pipeline-steps">Pipeline steps<a class="anchor-link" href="#Pipeline-ste
title="Bioexcel2 logo" width="400" /></p>
<hr>

</div>
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
<div class="jp-Cell-inputWrapper">
<div class="jp-InputArea jp-Cell-inputArea">
<div class="jp-InputPrompt jp-InputArea-prompt">In&nbsp;[1]:</div>
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
<div class="CodeMirror cm-s-jupyter">
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># Auxiliary libraries</span>

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span><span class="p">,</span> <span class="n">PurePath</span>
<span class="kn">import</span> <span class="nn">zipfile</span>
<span class="kn">import</span> <span class="nn">matplotlib.image</span> <span class="k">as</span> <span class="nn">mpimg</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">from</span> <span class="nn">IPython.display</span> <span class="kn">import</span> <span class="n">Image</span>
<span class="kn">import</span> <span class="nn">ipywidgets</span>
</pre></div>

</div>
</div>
</div>
</div>

</div>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
<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">
<h2 id="Initializing-colab">Initializing colab<a class="anchor-link" href="#Initializing-colab">¶</a></h2><p>The two cells below are used only in case this notebook is executed via <strong>Google Colab</strong>. Take into account that, for running conda on <strong>Google Colab</strong>, the <strong>condacolab</strong> library must be installed. As <a href="https://pypi.org/project/condacolab/">explained here</a>, the installation requires a <strong>kernel restart</strong>, so when running this notebook in <strong>Google Colab</strong>, don't run all cells until this <strong>installation</strong> is properly <strong>finished</strong> and the <strong>kernel</strong> has <strong>restarted</strong>.</p>
</div>
</div>
</div>
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
<div class="jp-InputArea jp-Cell-inputArea">
<div class="jp-InputPrompt jp-InputArea-prompt">In [ ]:</div>
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
<div class="cm-editor cm-s-jupyter">
<div class="highlight hl-ipython3"><pre><span></span><span class="c1"># Only executed when using google colab</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="k">if</span> <span class="s1">'google.colab'</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">run</span><span class="p">([</span><span class="s2">"conda"</span><span class="p">,</span> <span class="s2">"-V"</span><span class="p">],</span> <span class="n">check</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">run</span><span class="p">([</span><span class="n">sys</span><span class="o">.</span><span class="n">executable</span><span class="p">,</span> <span class="s2">"-m"</span><span class="p">,</span> <span class="s2">"pip"</span><span class="p">,</span> <span class="s2">"install"</span><span class="p">,</span> <span class="s2">"condacolab"</span><span class="p">],</span> <span class="n">check</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">condacolab</span>
<span class="n">condacolab</span><span class="o">.</span><span class="n">install</span><span class="p">()</span>
<span class="c1"># Clone repository</span>
<span class="n">repo_URL</span> <span class="o">=</span> <span class="s2">"https://github.com/bioexcel/biobb_wf_dna_helparms.git"</span>
<span class="n">repo_name</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="n">repo_URL</span><span class="p">)</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'.'</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">Path</span><span class="p">(</span><span class="n">repo_name</span><span class="p">)</span><span class="o">.</span><span class="n">exists</span><span class="p">():</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">run</span><span class="p">([</span><span class="s2">"mamba"</span><span class="p">,</span> <span class="s2">"install"</span><span class="p">,</span> <span class="s2">"-y"</span><span class="p">,</span> <span class="s2">"git"</span><span class="p">],</span> <span class="n">check</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">run</span><span class="p">([</span><span class="s2">"git"</span><span class="p">,</span> <span class="s2">"clone"</span><span class="p">,</span> <span class="n">repo_URL</span><span class="p">],</span> <span class="n">check</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"⏬ Repository properly cloned."</span><span class="p">)</span>
<span class="c1"># Install environment</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"⏳ Creating environment..."</span><span class="p">)</span>
<span class="n">env_file_path</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">repo_name</span><span class="si">}</span><span class="s2">/conda_env/environment.yml"</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">run</span><span class="p">([</span><span class="s2">"mamba"</span><span class="p">,</span> <span class="s2">"env"</span><span class="p">,</span> <span class="s2">"update"</span><span class="p">,</span> <span class="s2">"-n"</span><span class="p">,</span> <span class="s2">"base"</span><span class="p">,</span> <span class="s2">"-f"</span><span class="p">,</span> <span class="n">env_file_path</span><span class="p">],</span> <span class="n">check</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"👍 Conda environment successfully created and updated."</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
<div class="jp-InputArea jp-Cell-inputArea">
<div class="jp-InputPrompt jp-InputArea-prompt">In [ ]:</div>
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
<div class="cm-editor cm-s-jupyter">
<div class="highlight hl-ipython3"><pre><span></span><span class="c1"># Enable widgets for colab</span>
<span class="k">if</span> <span class="s1">'google.colab'</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">google.colab</span> <span class="kn">import</span> <span class="n">output</span>
<span class="n">output</span><span class="o">.</span><span class="n">enable_custom_widget_manager</span><span class="p">()</span>
<span class="c1"># Change working dir</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="s2">"biobb_wf_dna_helparms/biobb_wf_dna_helparms/notebooks"</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"📂 New working directory: </span><span class="si">{</span><span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">()</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>

<div class="jp-Cell-inputWrapper"><div class="jp-InputPrompt jp-InputArea-prompt">
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput " data-mime-type="text/markdown">
<p><a id="input"></a></p>
Expand All @@ -14605,7 +14650,34 @@ <h2 id="Input-parameters">Input parameters<a class="anchor-link" href="#Input-pa
</ul>

</div>
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
</div>
<div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
<div class="jp-Cell-inputWrapper">
<div class="jp-InputArea jp-Cell-inputArea">
<div class="jp-InputPrompt jp-InputArea-prompt">In&nbsp;[1]:</div>
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
<div class="CodeMirror cm-s-jupyter">
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># Auxiliary libraries</span>

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span><span class="p">,</span> <span class="n">PurePath</span>
<span class="kn">import</span> <span class="nn">zipfile</span>
<span class="kn">import</span> <span class="nn">matplotlib.image</span> <span class="k">as</span> <span class="nn">mpimg</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">from</span> <span class="nn">IPython.display</span> <span class="kn">import</span> <span class="n">Image</span>
<span class="kn">import</span> <span class="nn">ipywidgets</span>
</pre></div>

</div>
</div>
</div>
</div>

</div>
<div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
<div class="jp-Cell-inputWrapper">
<div class="jp-InputArea jp-Cell-inputArea">
<div class="jp-InputPrompt jp-InputArea-prompt">In&nbsp;[2]:</div>
Expand Down Expand Up @@ -14685,7 +14757,9 @@ <h3 id="Step-1:-Curves+">Step 1: Curves+<a class="anchor-link" href="#Step-1:-Cu

<span class="n">prop</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;s1range&#39;</span> <span class="p">:</span> <span class="s1">&#39;1:12&#39;</span><span class="p">,</span>
<span class="s1">&#39;s2range&#39;</span> <span class="p">:</span> <span class="s1">&#39;24:13&#39;</span>
<span class="s1">&#39;s2range&#39;</span> <span class="p">:</span> <span class="s1">&#39;24:13&#39;</span><span class="p">,</span>
<span class="c1"># uncomment when running in google colab</span>
<span class="c1"># 'stdlib_path': '.curvesplus/standard'</span>
<span class="p">}</span>

<span class="n">biobb_curves</span><span class="p">(</span>
Expand Down
91 changes: 91 additions & 0 deletions biobb_wf_dna_helparms/notebooks/.curvesplus/standard_b.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This file defines the bases recognized by Cur+ and gives the coordinates
# of the standard bases used for least squres fitting
#
# Each base begins with a one letter name code in col.1 and R (purine)
# or Y (pyrimidine) in col.3, followed by number of atoms in the base and
# the full base name (<= 8 chars)
#
# Each atom line gives x,y,z coordinates followed by the atom name (<= 4 chars)
#
# The first 2 atoms should define the bond from the backbone to the base
# The third atom defines the standard base normal as a cross product (1-2)x(3-2)
#
# The fourth atom is used for defining groove depth, C8 for purines and C6 for pyrimidines.
# It should be the atom that defines the center of the base pair for Watson-Crick pairing
#
G R 10 'Guanine'
1.58195 -2.39594 -0.12320 'C1*'
0.37714 -1.52785 -0.00520 'N9'
0.37551 -0.14975 -0.04020 'C4'
-0.94239 -1.88689 0.15880 'C8'
-0.10165 2.41153 -0.05020 'N1'
1.18367 1.92662 -0.18720 'C2'
1.47916 0.62851 -0.18920 'N3'
-0.93480 0.24071 0.10280 'C5'
-1.25149 1.62390 0.10480 'C6'
-1.76708 -0.87080 0.22880 'N7'
I R 10 'Inosine'
1.58195 -2.39594 -0.12320 'C1*'
0.37714 -1.52785 -0.00520 'N9'
0.37551 -0.14975 -0.04020 'C4'
-0.94239 -1.88689 0.15880 'C8'
-0.10165 2.41153 -0.05020 'N1'
1.18367 1.92662 -0.18720 'C2'
1.47916 0.62851 -0.18920 'N3'
-0.93480 0.24071 0.10280 'C5'
-1.25149 1.62390 0.10480 'C6'
-1.76708 -0.87080 0.22880 'N7'
Y R 10 'Y-base'
1.58195 -2.39594 -0.12320 'C1*'
0.37714 -1.52785 -0.00520 'N9'
0.37551 -0.14975 -0.04020 'C4'
-0.94239 -1.88689 0.15880 'C8'
-0.10165 2.41153 -0.05020 'N1'
1.18367 1.92662 -0.18720 'C2'
1.47916 0.62851 -0.18920 'N3'
-0.93480 0.24071 0.10280 'C5'
-1.25149 1.62390 0.10480 'C6'
-1.76708 -0.87080 0.22880 'N7'
A R 10 'Adenine'
1.57340 -2.41044 -0.12190 'C1*'
0.37786 -1.52945 -0.00531 'N9'
0.38110 -0.16006 -0.04011 'C4'
-0.94428 -1.87750 0.15888 'C8'
-0.11123 2.43959 -0.04964 'N1'
1.10298 1.90641 -0.17768 'C2'
1.45731 0.64079 -0.18694 'N3'
-0.91754 0.23706 0.10110 'C5'
-1.16848 1.61858 0.09523 'C6'
-1.75109 -0.86494 0.22638 'N7'
C Y 7 'Cytosine'
1.94866 -1.45161 -0.19029 'C1*'
0.74385 -0.58352 -0.07229 'N1'
0.93020 0.79520 -0.12929 'C2'
-0.49500 -1.12092 0.08671 'C6'
-0.15547 1.60399 -0.02329 'N3'
-1.37969 1.08626 0.13371 'C4'
-1.59254 -0.32937 0.19471 'C5'
T Y 7 'Thymine'
1.95363 -1.45659 -0.19073 'C1*'
0.75787 -0.57587 -0.07419 'N1'
0.97215 0.78019 -0.13405 'C2'
-0.49400 -1.10811 0.08633 'C6'
-0.15841 1.56515 -0.02137 'N3'
-1.45350 1.11665 0.14102 'C4'
-1.57773 -0.32139 0.19302 'C5'
U Y 7 'Uracil'
1.95363 -1.45659 -0.19073 'C1*'
0.75787 -0.57587 -0.07419 'N1'
0.97215 0.78019 -0.13405 'C2'
-0.49400 -1.10811 0.08633 'C6'
-0.15841 1.56515 -0.02137 'N3'
-1.45350 1.11665 0.14102 'C4'
-1.57773 -0.32139 0.19302 'C5'
P Y 7 'Pseudo-U'
-1.24071 -2.10001 -0.01015 'C1*'
-0.48272 -0.82819 -0.00729 'C5'
-1.20770 0.33858 0.00979 'C4'
0.89420 -0.82819 -0.00729 'C6'
1.59022 0.32075 -0.00729 'N1'
0.91535 1.59602 0.00679 'C2'
-0.46861 1.50106 0.01545 'N3'
14 changes: 14 additions & 0 deletions biobb_wf_dna_helparms/notebooks/.curvesplus/standard_i.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ion library
# Each line gives the ion/atom name (in signle quotes) and its formal charge
# Up to 40 ion type are allowed in this library file
'Na+' 1
'K+' 1
'K' 1
'Cl' -1
'Cl-' -1
'CL' -1
'P' -1
'C1*' 0
'NH1' 1
'NH2' 1
'NZ' 1
Loading

0 comments on commit 361a353

Please sign in to comment.