-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
9,045 additions
and
184 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-16 Bytes
(100%)
docs/build/doctrees/hqtb/step-desc/refine-parts/annot.doctree
Binary file not shown.
Binary file modified
BIN
-16 Bytes
(100%)
docs/build/doctrees/hqtb/step-desc/refine-parts/cleanup.doctree
Binary file not shown.
Binary file modified
BIN
-16 Bytes
(100%)
docs/build/doctrees/hqtb/step-desc/refine-parts/extension.doctree
Binary file not shown.
Binary file modified
BIN
-16 Bytes
(100%)
docs/build/doctrees/hqtb/step-desc/refine-parts/smooth.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
250 changes: 250 additions & 0 deletions
250
docs/build/html/_modules/specimen/hqtb/core/analysis.html
Large diffs are not rendered by default.
Oops, something went wrong.
552 changes: 552 additions & 0 deletions
552
docs/build/html/_modules/specimen/hqtb/core/bidirectional_blast.html
Large diffs are not rendered by default.
Oops, something went wrong.
578 changes: 578 additions & 0 deletions
578
docs/build/html/_modules/specimen/hqtb/core/generate_draft_model.html
Large diffs are not rendered by default.
Oops, something went wrong.
349 changes: 349 additions & 0 deletions
349
docs/build/html/_modules/specimen/hqtb/core/refinement/annotation.html
Large diffs are not rendered by default.
Oops, something went wrong.
632 changes: 632 additions & 0 deletions
632
docs/build/html/_modules/specimen/hqtb/core/refinement/cleanup.html
Large diffs are not rendered by default.
Oops, something went wrong.
1,672 changes: 1,672 additions & 0 deletions
1,672
docs/build/html/_modules/specimen/hqtb/core/refinement/extension.html
Large diffs are not rendered by default.
Oops, something went wrong.
308 changes: 308 additions & 0 deletions
308
docs/build/html/_modules/specimen/hqtb/core/refinement/smoothing.html
Large diffs are not rendered by default.
Oops, something went wrong.
190 changes: 190 additions & 0 deletions
190
docs/build/html/_modules/specimen/hqtb/core/validation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 — 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 & 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">"""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">"""</span> | ||
|
||
<span class="n">__author__</span> <span class="o">=</span> <span class="s1">'Carolin Brune'</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">'cobra'</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">"""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['cobra'], 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"> """</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">'</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">'</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">"04_validation"</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">'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">"04_validation"</span><span class="p">))</span><span class="si">}</span><span class="s1">'</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">'Given directory already has required structure.'</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">'cobra'</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">'</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"># ---------------------------------'</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">'</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'</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">'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">'</span><span class="p">)</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© 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> |
Oops, something went wrong.