Skip to content

Commit

Permalink
Update Docs #5
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-Hades committed May 27, 2024
1 parent 5465e0e commit 4e3fb57
Show file tree
Hide file tree
Showing 74 changed files with 9,045 additions and 184 deletions.
Binary file modified docs/build/doctrees/dev-notes.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/help.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/about-pipeline.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/hqtb-config.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/run-pipeline.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/analysis.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/bidirect_blast.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/gen_draft.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/refine-parts/annot.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/refine-parts/cleanup.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/refine-parts/extension.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/refine-parts/smooth.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/refinement.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/hqtb/step-desc/validation.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/classes.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/cmd.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/cmpb.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/core.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/hqtb.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules/util.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/overview-pipes.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/specimen.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: e6df1f6e9c96870d3ba9c601c63df629
config: 0fb85034dd4ee52eca935a0038112cc8
tags: 645f666f9bcd5a90fca523b33c5a78b7
16 changes: 14 additions & 2 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=8d563738"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=7859de39"></script>
Expand Down Expand Up @@ -81,7 +81,19 @@
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="specimen/util/util.html">specimen.util.util</a></li>
<ul><li><a href="specimen/classes/reports.html">specimen.classes.reports</a></li>
<li><a href="specimen/cmpb/workflow.html">specimen.cmpb.workflow</a></li>
<li><a href="specimen/hqtb/core/analysis.html">specimen.hqtb.core.analysis</a></li>
<li><a href="specimen/hqtb/core/bidirectional_blast.html">specimen.hqtb.core.bidirectional_blast</a></li>
<li><a href="specimen/hqtb/core/generate_draft_model.html">specimen.hqtb.core.generate_draft_model</a></li>
<li><a href="specimen/hqtb/core/refinement/annotation.html">specimen.hqtb.core.refinement.annotation</a></li>
<li><a href="specimen/hqtb/core/refinement/cleanup.html">specimen.hqtb.core.refinement.cleanup</a></li>
<li><a href="specimen/hqtb/core/refinement/extension.html">specimen.hqtb.core.refinement.extension</a></li>
<li><a href="specimen/hqtb/core/refinement/smoothing.html">specimen.hqtb.core.refinement.smoothing</a></li>
<li><a href="specimen/hqtb/core/validation.html">specimen.hqtb.core.validation</a></li>
<li><a href="specimen/hqtb/workflow.html">specimen.hqtb.workflow</a></li>
<li><a href="specimen/util/set_up.html">specimen.util.set_up</a></li>
<li><a href="specimen/util/util.html">specimen.util.util</a></li>
</ul>

</div>
Expand Down
270 changes: 270 additions & 0 deletions docs/build/html/_modules/specimen/classes/reports.html

Large diffs are not rendered by default.

533 changes: 533 additions & 0 deletions docs/build/html/_modules/specimen/cmpb/workflow.html

Large diffs are not rendered by default.

250 changes: 250 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/analysis.html

Large diffs are not rendered by default.

552 changes: 552 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/bidirectional_blast.html

Large diffs are not rendered by default.

578 changes: 578 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/generate_draft_model.html

Large diffs are not rendered by default.

349 changes: 349 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/refinement/annotation.html

Large diffs are not rendered by default.

632 changes: 632 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/refinement/cleanup.html

Large diffs are not rendered by default.

1,672 changes: 1,672 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/refinement/extension.html

Large diffs are not rendered by default.

308 changes: 308 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/refinement/smoothing.html

Large diffs are not rendered by default.

190 changes: 190 additions & 0 deletions docs/build/html/_modules/specimen/hqtb/core/validation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>specimen.hqtb.core.validation &mdash; SPECIMEN 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=559046d4" />
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../../_static/custom_theme.css?v=ef5873f9" />


<link rel="shortcut icon" href="../../../../_static/LogoSPECIMEN.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../../../_static/documentation_options.js?v=8d563738"></script>
<script src="../../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../../_static/copybutton.js?v=7859de39"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="../../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../../../index.html">

<img src="../../../../_static/LogoSPECIMEN.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Content</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../overview-pipes.html">Overview of the Pipelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../specimen.html">Contents of SPECIMEN</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../help.html">Help &amp; FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../dev-notes.html">Notes for Developers</a></li>
</ul>

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

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../index.html">SPECIMEN</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../../index.html">Module code</a></li>
<li class="breadcrumb-item active">specimen.hqtb.core.validation</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for specimen.hqtb.core.validation</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Validate a model (part 4 of the workflow).</span>

<span class="sd">Implemented tests in include:</span>
<span class="sd">- cobra/sbml check using cobrapy</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="n">__author__</span> <span class="o">=</span> <span class="s1">&#39;Carolin Brune&#39;</span>

<span class="c1">################################################################################</span>
<span class="c1"># requirements</span>
<span class="c1">################################################################################</span>

<span class="kn">import</span> <span class="nn">cobra</span>
<span class="kn">import</span> <span class="nn">pprint</span>
<span class="kn">import</span> <span class="nn">time</span>

<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Literal</span>

<span class="c1">################################################################################</span>
<span class="c1"># functions</span>
<span class="c1">################################################################################</span>

<span class="c1"># @TODO: add more validation options.´</span>

<div class="viewcode-block" id="run">
<a class="viewcode-back" href="../../../../modules/core.html#specimen.hqtb.core.validation.run">[docs]</a>
<span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="nb">dir</span><span class="p">:</span><span class="nb">str</span><span class="p">,</span> <span class="n">model_path</span><span class="p">:</span><span class="nb">str</span><span class="p">,</span> <span class="n">tests</span><span class="p">:</span><span class="kc">None</span><span class="o">|</span><span class="n">Literal</span><span class="p">[</span><span class="s1">&#39;cobra&#39;</span><span class="p">]</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">run_all</span><span class="p">:</span><span class="nb">bool</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;SPECIMEN Step 4: Validate the model.</span>

<span class="sd"> Args:</span>
<span class="sd"> - dir (str): </span>
<span class="sd"> Path to the output directory.</span>
<span class="sd"> - model_path (str): </span>
<span class="sd"> Path to the model to be validated</span>
<span class="sd"> - tests (None | Literal[&#39;cobra&#39;], optional): </span>
<span class="sd"> Tests to perform. </span>
<span class="sd"> Defaults to None.</span>
<span class="sd"> - run_all (bool, optional): </span>
<span class="sd"> Run al available tests. If True, overwrites</span>
<span class="sd"> the previous parameter.</span>
<span class="sd"> Defaults to True.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">total_time_s</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">validation</span><span class="se">\n</span><span class="s1">################################################################################</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span>

<span class="c1"># -----------------------</span>
<span class="c1"># create output directory</span>
<span class="c1"># -----------------------</span>

<span class="k">try</span><span class="p">:</span>
<span class="n">Path</span><span class="p">(</span><span class="nb">dir</span><span class="p">,</span><span class="s2">&quot;04_validation&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">parents</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">F</span><span class="s1">&#39;Creating new directory </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="nb">dir</span><span class="p">,</span><span class="s2">&quot;04_validation&quot;</span><span class="p">))</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">FileExistsError</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Given directory already has required structure.&#39;</span><span class="p">)</span>

<span class="c1"># --------------</span>
<span class="c1"># validate model</span>
<span class="c1"># --------------</span>

<span class="k">if</span> <span class="n">run_all</span> <span class="ow">or</span> <span class="p">(</span><span class="n">tests</span> <span class="ow">and</span> <span class="s1">&#39;cobra&#39;</span> <span class="ow">in</span> <span class="n">tests</span><span class="p">):</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1"># ---------------------------------</span><span class="se">\n</span><span class="s1"># validate model - cobra validation</span><span class="se">\n</span><span class="s1"># ---------------------------------&#39;</span><span class="p">)</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

<span class="c1"># validate using cobra</span>
<span class="n">cobra_report</span> <span class="o">=</span> <span class="n">cobra</span><span class="o">.</span><span class="n">io</span><span class="o">.</span><span class="n">validate_sbml_model</span><span class="p">(</span><span class="n">model_path</span><span class="p">)</span>
<span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">cobra_report</span><span class="p">)</span>

<span class="n">end</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">F</span><span class="s1">&#39;</span><span class="se">\t</span><span class="s1">time: </span><span class="si">{</span><span class="n">end</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">start</span><span class="si">}</span><span class="s1">s&#39;</span><span class="p">)</span>

<span class="n">total_time_e</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">F</span><span class="s1">&#39;total runtime: </span><span class="si">{</span><span class="n">total_time_e</span><span class="o">-</span><span class="n">total_time_s</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span></div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, Carolin Brune.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 4e3fb57

Please sign in to comment.