Commit e97a8222 authored by Tauriello Gerardo's avatar Tauriello Gerardo
Browse files

Updated compiled doc.

parent 5f77436a
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &mdash; ProMod3 1.3.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.3.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="top" title="ProMod3 1.3.0 documentation" href="../index.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>All modules for which code is available</h1>
<ul><li><a href="AllAtomClashScorer.html">AllAtomClashScorer</a></li>
<li><a href="AllAtomEnv.html">AllAtomEnv</a></li>
<li><a href="AllAtomInteractionScorer.html">AllAtomInteractionScorer</a></li>
<li><a href="AllAtomOverallScorer.html">AllAtomOverallScorer</a></li>
<li><a href="AllAtomPackingScorer.html">AllAtomPackingScorer</a></li>
<li><a href="AllAtomPositions.html">AllAtomPositions</a></li>
<li><a href="AllAtomRelaxer.html">AllAtomRelaxer</a></li>
<li><a href="AllAtomScorer.html">AllAtomScorer</a></li>
<li><a href="AminoAcidLookup.html">AminoAcidLookup</a></li>
<li><a href="BBDepRotamerLib.html">BBDepRotamerLib</a></li>
<li><a href="BackboneList.html">BackboneList</a></li>
<li><a href="BackboneOverallScorer.html">BackboneOverallScorer</a></li>
<li><a href="BackboneRelaxer.html">BackboneRelaxer</a></li>
<li><a href="BackboneScoreEnv.html">BackboneScoreEnv</a></li>
<li><a href="BackboneScorer.html">BackboneScorer</a></li>
<li><a href="CBPackingScorer.html">CBPackingScorer</a></li>
<li><a href="CBetaScorer.html">CBetaScorer</a></li>
<li><a href="CCD.html">CCD</a></li>
<li><a href="CCDCloser.html">CCDCloser</a></li>
<li><a href="CTerminalCloser.html">CTerminalCloser</a></li>
<li><a href="ClashScorer.html">ClashScorer</a></li>
<li><a href="DeNovoCloser.html">DeNovoCloser</a></li>
<li><a href="DirtyCCDCloser.html">DirtyCCDCloser</a></li>
<li><a href="DiscoContainer.html">DiscoContainer</a></li>
<li><a href="ExponentialCooler.html">ExponentialCooler</a></li>
<li><a href="FRMRotamer.html">FRMRotamer</a></li>
<li><a href="FRMRotamerGroup.html">FRMRotamerGroup</a></li>
<li><a href="ForcefieldLookup.html">ForcefieldLookup</a></li>
<li><a href="FragDB.html">FragDB</a></li>
<li><a href="Fragger.html">Fragger</a></li>
<li><a href="FraggerMap.html">FraggerMap</a></li>
<li><a href="FragmentSampler.html">FragmentSampler</a></li>
<li><a href="FrameResidue.html">FrameResidue</a></li>
<li><a href="FullGapExtender.html">FullGapExtender</a></li>
<li><a href="GapExtender.html">GapExtender</a></li>
<li><a href="GraphMinimizer.html">GraphMinimizer</a></li>
<li><a href="HBondScorer.html">HBondScorer</a></li>
<li><a href="KIC.html">KIC</a></li>
<li><a href="KICCloser.html">KICCloser</a></li>
<li><a href="LinearScorer.html">LinearScorer</a></li>
<li><a href="LoopCandidates.html">LoopCandidates</a></li>
<li><a href="MmSystemCreator.html">MmSystemCreator</a></li>
<li><a href="ModellingHandle.html">ModellingHandle</a></li>
<li><a href="NTerminalCloser.html">NTerminalCloser</a></li>
<li><a href="PairwiseScorer.html">PairwiseScorer</a></li>
<li><a href="Particle.html">Particle</a></li>
<li><a href="PhiPsiSampler.html">PhiPsiSampler</a></li>
<li><a href="PsipredPrediction.html">PsipredPrediction</a></li>
<li><a href="RRMRotamer.html">RRMRotamer</a></li>
<li><a href="RRMRotamerGroup.html">RRMRotamerGroup</a></li>
<li><a href="ReducedScorer.html">ReducedScorer</a></li>
<li><a href="RotamerGraph.html">RotamerGraph</a></li>
<li><a href="RotamerLib.html">RotamerLib</a></li>
<li><a href="RotamerLibEntry.html">RotamerLibEntry</a></li>
<li><a href="SCWRLRotamerConstructor.html">SCWRLRotamerConstructor</a></li>
<li><a href="SSAgreementScorer.html">SSAgreementScorer</a></li>
<li><a href="ScoreContainer.html">ScoreContainer</a></li>
<li><a href="ScoringGapExtender.html">ScoringGapExtender</a></li>
<li><a href="ScoringWeights.html">ScoringWeights</a></li>
<li><a href="ShiftExtension.html">ShiftExtension</a></li>
<li><a href="SidechainReconstructor.html">SidechainReconstructor</a></li>
<li><a href="SoftSampler.html">SoftSampler</a></li>
<li><a href="StaticRuntimeProfiler.html">StaticRuntimeProfiler</a></li>
<li><a href="StructuralGap.html">StructuralGap</a></li>
<li><a href="StructureDB.html">StructureDB</a></li>
<li><a href="TorsionSampler.html">TorsionSampler</a></li>
<li><a href="TorsionScorer.html">TorsionScorer</a></li>
<li><a href="promod3.html">promod3</a></li>
<ul><li><a href="promod3/core/_core.html">promod3.core._core</a></li>
<li><a href="promod3/core/helper.html">promod3.core.helper</a></li>
<li><a href="promod3/core/pm3argparse.html">promod3.core.pm3argparse</a></li>
<li><a href="promod3/loop/_loop.html">promod3.loop._loop</a></li>
<li><a href="promod3/modelling/_closegaps.html">promod3.modelling._closegaps</a></li>
<li><a href="promod3/modelling/_denovo.html">promod3.modelling._denovo</a></li>
<li><a href="promod3/modelling/_fragger_handle.html">promod3.modelling._fragger_handle</a></li>
<li><a href="promod3/modelling/_modelling.html">promod3.modelling._modelling</a></li>
<li><a href="promod3/modelling/_molprobity.html">promod3.modelling._molprobity</a></li>
<li><a href="promod3/modelling/_monte_carlo.html">promod3.modelling._monte_carlo</a></li>
<li><a href="promod3/modelling/_pipeline.html">promod3.modelling._pipeline</a></li>
<li><a href="promod3/modelling/_reconstruct_sidechains.html">promod3.modelling._reconstruct_sidechains</a></li>
<li><a href="promod3/modelling/_ring_punches.html">promod3.modelling._ring_punches</a></li>
<li><a href="promod3/scoring/_scoring.html">promod3.scoring._scoring</a></li>
<li><a href="promod3/sidechain/_sidechain.html">promod3.sidechain._sidechain</a></li>
</ul><li><a href="test_actions.html">test_actions</a></li>
</ul>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2013-2018, SIB - Swiss Institute of Bioinformatics and Biozentrum - University of Basel.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>promod3 &mdash; ProMod3 1.3.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.3.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="top" title="ProMod3 1.3.0 documentation" href="../index.html" />
<link rel="up" title="Module code" href="index.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for promod3</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (c) 2013-2018, SIB - Swiss Institute of Bioinformatics and </span>
<span class="c1"># Biozentrum - University of Basel</span>
<span class="c1"># </span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at</span>
<span class="c1"># </span>
<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1"># </span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>
<span class="c1"># enable access to loop and modelling via &quot;import promod3&quot;</span>
<span class="kn">import</span> <span class="nn">promod3.core</span>
<span class="kn">import</span> <span class="nn">promod3.sidechain</span>
<span class="kn">import</span> <span class="nn">promod3.loop</span>
<span class="kn">import</span> <span class="nn">promod3.scoring</span>
<span class="kn">import</span> <span class="nn">promod3.modelling</span>
<span class="c1"># load compounds library</span>
<span class="c1"># That way we do not need to call our scripts with the OST starter and are more</span>
<span class="c1"># flexible.</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">ost</span>
<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">conop</span>
<span class="kn">from</span> <span class="nn">ost</span> <span class="kn">import</span> <span class="n">io</span>
<div class="viewcode-block" id="SetCompoundsChemlib"><a class="viewcode-back" href="../core/setcompoundschemlib.html#promod3.SetCompoundsChemlib">[docs]</a><span class="k">def</span> <span class="nf">SetCompoundsChemlib</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="o">=</span><span class="s2">&quot;/home/taurielg/GT/Code/ost/build/stage/share/openstructure/compounds.chemlib&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;SetCompoundsChemlib(path_to_chemlib)</span>
<span class="sd"> Load a compounds library. Does not return anything, the library is just</span>
<span class="sd"> enabled globally.</span>
<span class="sd"> :param path_to_chemlib: Points to the file to be loaded.</span>
<span class="sd"> :type path_to_chemlib: :class:`str`</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">path_to_chemlib</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Invalid path to chemlib &#39;&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">path_to_chemlib</span><span class="p">)</span>
<span class="o">+</span> <span class="s2">&quot;&#39; specified!</span><span class="se">\n</span><span class="s2">A compounds library must either be &quot;</span>
<span class="o">+</span> <span class="s2">&quot;set at compile-time (&#39;compounds.chemlib&#39; file in &quot;</span>
<span class="o">+</span> <span class="s2">&quot;$OST_ROOT/share or below) or set in OST with &quot;</span>
<span class="o">+</span> <span class="s2">&quot;ost.conop.SetDefaultLib before importing any &quot;</span>
<span class="o">+</span> <span class="s2">&quot;promod3 module!&quot;</span><span class="p">)</span>
<span class="n">compound_lib_path</span> <span class="o">=</span> <span class="n">path_to_chemlib</span>
<span class="n">compound_lib</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">CompoundLib</span><span class="o">.</span><span class="n">Load</span><span class="p">(</span><span class="n">compound_lib_path</span><span class="p">)</span>
<span class="n">conop</span><span class="o">.</span><span class="n">SetDefaultLib</span><span class="p">(</span><span class="n">compound_lib</span><span class="p">)</span>
<span class="n">io</span><span class="o">.</span><span class="n">profiles</span><span class="p">[</span><span class="s1">&#39;DEFAULT&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">processor</span> <span class="o">=</span> <span class="n">conop</span><span class="o">.</span><span class="n">RuleBasedProcessor</span><span class="p">(</span><span class="n">compound_lib</span><span class="p">)</span></div>
<span class="k">def</span> <span class="nf">GetProMod3SharedDataPath</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Get path to the shared data folder. Used for binaries.</span>
<span class="sd"> Returns None if not set.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">SetProMod3SharedDataPath</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Set path to the shared data folder. Used for binaries.&quot;&quot;&quot;</span>
<span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;PROMOD3_SHARED_DATA_PATH&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">path</span>
<span class="c1"># check if we already have an OST PrefixPath</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">ost</span><span class="o">.</span><span class="n">GetSharedDataPath</span><span class="p">()</span>
<span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">,</span> <span class="n">rt_err</span><span class="p">:</span>
<span class="n">ost</span><span class="o">.</span><span class="n">SetPrefixPath</span><span class="p">(</span><span class="s2">&quot;/home/taurielg/GT/Code/ost/build/stage&quot;</span><span class="p">)</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">raise</span>
<span class="c1"># check if we do have a compounds library</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">conop</span><span class="o">.</span><span class="n">GetDefaultLib</span><span class="p">():</span>
<span class="n">SetCompoundsChemlib</span><span class="p">()</span>
<span class="c1"># ensure that PROMOD3_SHARED_DATA_PATH env. var. set and override if needed</span>
<span class="k">if</span> <span class="n">GetProMod3SharedDataPath</span><span class="p">()</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="c1"># module_path = PROMOD3_ROOT/lib64/python2.7/site-packages/promod3</span>
<span class="n">module_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">__file__</span><span class="p">))</span>
<span class="c1"># get PROMOD3_ROOT</span>
<span class="n">promod3_lib</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">module_path</span><span class="p">)))</span>
<span class="n">promod3_root</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">promod3_lib</span><span class="p">)</span>
<span class="n">SetProMod3SharedDataPath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">promod3_root</span><span class="p">,</span> <span class="s2">&quot;share&quot;</span><span class="p">,</span> <span class="s2">&quot;promod3&quot;</span><span class="p">))</span>
<span class="c1"># set version</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;1.3.0&quot;</span>
<span class="n">__version_extended__</span> <span class="o">=</span> <span class="s2">&quot;1.3.0 (release-1.3.0|01e00a8)&quot;</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;SetCompoundsChemlib&#39;</span><span class="p">,</span> <span class="s1">&#39;GetProMod3SharedDataPath&#39;</span><span class="p">,</span>
<span class="s1">&#39;SetProMod3SharedDataPath&#39;</span><span class="p">)</span>
<span class="c1"># LocalWords: OST os ost conop io SetCompoundsChemlib CHEMLIB param chemlib</span>
<span class="c1"># LocalWords: str SetDefaultLib RuleBasedProcessor PrefixPath RuntimeError</span>
<span class="c1"># LocalWords: GetSharedDataPath SetPrefixPath GetDefaultLib</span>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li><a href="index.html">Module code</a><ul>
</ul></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2013-2018, SIB - Swiss Institute of Bioinformatics and Biozentrum - University of Basel.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>promod3.modelling._denovo &mdash; ProMod3 1.3.0 documentation</title>
<link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.3.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="top" title="ProMod3 1.3.0 documentation" href="../../../index.html" />
<link rel="up" title="promod3" href="../../promod3.html" />
<link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for promod3.modelling._denovo</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (c) 2013-2018, SIB - Swiss Institute of Bioinformatics and </span>
<span class="c1"># Biozentrum - University of Basel</span>
<span class="c1"># </span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at</span>
<span class="c1"># </span>
<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1"># </span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>
<span class="kn">from</span> <span class="nn">promod3</span> <span class="kn">import</span> <span class="n">scoring</span><span class="p">,</span> <span class="n">loop</span>
<span class="kn">from</span> <span class="nn">_modelling</span> <span class="kn">import</span> <span class="o">*</span>
<div class="viewcode-block" id="GenerateDeNovoTrajectories"><a class="viewcode-back" href="../../../modelling/algorithms.html#promod3.modelling.GenerateDeNovoTrajectories">[docs]</a><span class="k">def</span> <span class="nf">GenerateDeNovoTrajectories</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span>
<span class="n">num_trajectories</span> <span class="o">=</span> <span class="mi">200</span><span class="p">,</span>
<span class="n">avg_sampling_per_position</span> <span class="o">=</span> <span class="mi">600</span><span class="p">,</span>
<span class="n">profile</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
<span class="n">psipred_prediction</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
<span class="n">fragment_handler</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
<span class="n">scorer</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
<span class="n">scorer_env</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
<span class="n">scoring_weights</span> <span class="o">=</span> <span class="bp">None</span><span class="p">):</span>
<span class="sd">&#39;&#39;&#39;Example de novo modelling pipeline based on Fragment sampling and</span>
<span class="sd"> backbone scoring. Take this as a starting point for more advanced</span>
<span class="sd"> de novo procedures.</span>
<span class="sd"> :param sequence: The sequence you want to sample</span>
<span class="sd"> :type sequence: :class:`str`</span>
<span class="sd"> :param num_trajectories: The number of sampling trajectories you</span>
<span class="sd"> want to generate </span>
<span class="sd"> :type num_trajectories: :class:`int`</span>
<span class="sd"> </span>
<span class="sd"> :param avg_sampling_per_position: Number of Monte Carlo sampling steps</span>
<span class="sd"> the total number is: </span>
<span class="sd"> len(**sequence**) * **avg_sampling_per_position** </span>
<span class="sd"> :param profile: The sequence profile for **sequence**. This increases the </span>
<span class="sd"> fragment search performance.</span>
<span class="sd"> :type profile: :class:`ost.seq.ProfileHandle`</span>
<span class="sd"> :param psipred_prediction: The psipred prediction for **sequence**. This</span>
<span class="sd"> increases the fragment search performance</span>
<span class="sd"> :type psipred_prediction: :class:`promod3.loop.PsipredPrediction`</span>
<span class="sd"> :param fragment_handler: You can provide already initialized fragments.</span>
<span class="sd"> If you pass this parameter, **profile** and</span>
<span class="sd"> **psipred_prediction** get neglected and do</span>
<span class="sd"> not influence the fragment search, the</span>
<span class="sd"> ones you initialized **fragment_handler** with</span>
<span class="sd"> get used instead.</span>
<span class="sd"> :type fragment_handler: :class:`promod3.modelling.FraggerHandle`</span>
<span class="sd"> :param scorer: Scorer doing the backbone scoring. If not provided, a </span>
<span class="sd"> default one gets loaded with default objects with</span>
<span class="sd"> following keys: clash, reduced, cb_packing, hbond, cbeta, </span>
<span class="sd"> torsion and pairwise </span>
<span class="sd"> :type scorer: :class:`promod3.scoring.BackboneOverallScorer`</span>
<span class="sd"> :param scorer_env: The scoring env that relates to **scorer**</span>
<span class="sd"> This environment will be changed! </span>
<span class="sd"> :type scorer_env: :class:`promod3.scoring.BackboneScoreEnv`</span>
<span class="sd"> :param scoring_weights: Linear weights for different scores. If not provided,</span>
<span class="sd"> the output of ScoringWeights.GetWeights() is used.</span>
<span class="sd"> Please note, that the weights must be consistent</span>
<span class="sd"> with the keys of the scores in **scorer**</span>
<span class="sd"> :type scoring_weights: :class:`dict`</span>
<span class="sd"> :returns: A :class:`promod3.loop.LoopCandidates` object containing</span>
<span class="sd"> **num_trajectories** elements for further processing</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Seq too short for Denovo sampling (min length 9)&quot;</span><span class="p">)</span>
<span class="c1"># check whether profile / psipred_prediction are consistent if present</span>
<span class="k">if</span> <span class="n">profile</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">profile</span><span class="o">.</span><span class="n">sequence</span> <span class="o">!=</span> <span class="n">sequence</span><span class="p">:</span>
<span class="n">err</span> <span class="o">=</span> <span class="s2">&quot;Sequence of profile must match input sequence!&quot;</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
<span class="k">if</span> <span class="n">psipred_prediction</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="n">psipred_prediction</span><span class="p">):</span>
<span class="n">err</span> <span class="o">=</span> <span class="s2">&quot;psipred_prediction must be consistent with the input sequence!&quot;</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
<span class="k">if</span> <span class="n">scorer</span> <span class="o">!=</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">scorer_env</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Must provide an environment when you provide a scorer!&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">fragment_handler</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
<span class="c1"># we first have to build our own handler</span>
<span class="n">fragment_handler</span> <span class="o">=</span> <span class="n">modelling</span><span class="o">.</span><span class="n">FraggerHandle</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span>
<span class="n">profile</span> <span class="o">=</span> <span class="n">profile</span><span class="p">,</span>
<span class="n">psipred_pred</span> <span class="o">=</span> <span class="n">psipred_prediction</span><span class="p">)</span>
<span class="n">fragger_list</span> <span class="o">=</span> <span class="n">fragment_handler</span><span class="o">.</span><span class="n">GetList</span><span class="p">()</span>
<span class="k">if</span> <span class="n">scorer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
<span class="c1"># Lets setup a scorer with empty environment</span>
<span class="n">scorer</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneOverallScorer</span><span class="p">()</span>
<span class="n">scorer_env</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">BackboneScoreEnv</span><span class="p">(</span><span class="n">sequence</span><span class="p">)</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;clash&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">ClashScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;reduced&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadReducedScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cb_packing&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBPackingScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;hbond&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadHBondScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;cbeta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadCBetaScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;torsion&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">LoadTorsionScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="p">[</span><span class="s2">&quot;pairwise&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">scoring</span><span class="o">.</span><span class="n">PairwiseScorer</span><span class="p">()</span>
<span class="n">scorer</span><span class="o">.</span><span class="n">AttachEnvironment</span><span class="p">(</span><span class="n">scorer_env</span><span class="p">)</span>
<span class="k">if</span> <span class="n">scoring_weights</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">scoring_weights</span> <span class="o">=</span> <span class="n">ScoringWeights</span><span class="o">.</span><span class="n">GetWeights</span><span class="p">()</span>
<span class="c1"># the number of 109 is roughly the number of times we have to apply</span>
<span class="c1"># a factor of 0.9 to 100 until it reaches a value of 0.001</span>
<span class="n">start_temperature</span> <span class="o">=</span> <span class="mi">100</span>
<span class="n">cooling_factor</span> <span class="o">=</span> <span class="mf">0.9</span>
<span class="n">sampling_steps</span> <span class="o">=</span> <span class="n">avg_sampling_per_position</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">fragger_list</span><span class="p">)</span>
<span class="n">cooling_interval</span> <span class="o">=</span> <span class="n">sampling_steps</span> <span class="o">/</span> <span class="mi">109</span>
<span class="n">mc_sampler</span> <span class="o">=</span> <span class="n">FragmentSampler</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span> <span class="n">fragger_list</span><span class="p">,</span>
<span class="n">init_fragments</span> <span class="o">=</span> <span class="mi">5</span><span class="p">)</span>
<span class="n">mc_closer</span> <span class="o">=</span> <span class="n">DeNovoCloser</span><span class="p">()</span>
<span class="n">mc_scorer</span> <span class="o">=</span> <span class="n">LinearScorer</span><span class="p">(</span><span class="n">scorer</span><span class="p">,</span> <span class="n">scorer_env</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">sequence</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
<span class="n">scoring_weights</span><span class="p">)</span>
<span class="n">mc_cooler</span> <span class="o">=</span> <span class="n">ExponentialCooler</span><span class="p">(</span><span class="n">start_temperature</span><span class="p">,</span>
<span class="n">cooling_interval</span><span class="p">,</span>
<span class="n">cooling_factor</span><span class="p">)</span>
<span class="n">candidates</span> <span class="o">=</span> <span class="n">LoopCandidates</span><span class="o">.</span><span class="n">FillFromMonteCarloSampler</span><span class="p">(</span><span class="n">sequence</span><span class="p">,</span>
<span class="n">num_trajectories</span><span class="p">,</span>
<span class="n">sampling_steps</span><span class="p">,</span>
<span class="n">mc_sampler</span><span class="p">,</span>
<span class="n">mc_closer</span><span class="p">,</span>
<span class="n">mc_scorer</span><span class="p">,</span>
<span class="n">mc_cooler</span><span class="p">)</span>
<span class="k">return</span> <span class="n">candidates</span></div>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../../../index.html">Documentation overview</a><ul>
<li><a href="../../index.html">Module code</a><ul>
<li><a href="../../promod3.html">promod3</a><ul>
</ul></li>
</ul></li>
</ul></li>
</ul>