Select Git revision
compound.sdf
gap_handling.html 46.24 KiB
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Handling Gaps — ProMod3 3.2.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" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></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="../_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Handling Loop Candidates" href="loop_candidates.html" />
<link rel="prev" title="Model Checking" href="model_checking.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>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="handling-gaps">
<h1>Handling Gaps<a class="headerlink" href="#handling-gaps" title="Permalink to this headline">¶</a></h1>
<p>This chapter describes the gap classes and functionality attached to them. These
classes / functions are used within the modelling pipeline.</p>
<div class="section" id="gap-classes">
<h2>Gap classes<a class="headerlink" href="#gap-classes" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="promod3.modelling.StructuralGap">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">StructuralGap</code><span class="sig-paren">(</span><em class="sig-param">before</em>, <em class="sig-param">after</em>, <em class="sig-param">seq</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap" title="Permalink to this definition">¶</a></dt>
<dd><p>Describes a structural gap, i.e. a loop to be modeled. The gap may either be
terminal or between two defined regions. The gap stores information of the
last residue before and the first residue after the gap as well as the
sequence of gap. Gaps at the N- and C-terminals can be defined by passing
invalid residue handles to <cite>before</cite> or <cite>after</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>before</strong> (<a class="reference external" href="https://www.openstructure.org/docs/2.2/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.mol.ResidueHandle</span></code></a>) – Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.before" title="promod3.modelling.StructuralGap.before"><code class="xref py py-attr docutils literal notranslate"><span class="pre">before</span></code></a></p></li>
<li><p><strong>after</strong> (<a class="reference external" href="https://www.openstructure.org/docs/2.2/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.mol.ResidueHandle</span></code></a>) – Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.after" title="promod3.modelling.StructuralGap.after"><code class="xref py py-attr docutils literal notranslate"><span class="pre">after</span></code></a></p></li>
<li><p><strong>seq</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>) – Fills <a class="reference internal" href="#promod3.modelling.StructuralGap.seq" title="promod3.modelling.StructuralGap.seq"><code class="xref py py-attr docutils literal notranslate"><span class="pre">seq</span></code></a></p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>A <a class="reference external" href="https://docs.python.org/3.7/library/exceptions.html#RuntimeError" title="(in Python v3.7)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> if both residues are invalid or when both
are valid and:</p>
<ul class="simple">
<li><p>residues are from different chains (if both valid)</p></li>
<li><p><cite>before</cite> is located after <cite>after</cite></p></li>
<li><p><cite>seq</cite> has a length which is inconsistent with the gap</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.GetChainIndex">
<code class="sig-name descname">GetChainIndex</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.GetChainIndex" title="Permalink to this definition">¶</a></dt><dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Index of chain, the gap is belonging to</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.GetChainName">
<code class="sig-name descname">GetChainName</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.GetChainName" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Name of chain, the gap is belonging to</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.GetChain">
<code class="sig-name descname">GetChain</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.GetChain" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Chain, the gap is belonging to</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://www.openstructure.org/docs/2.2/mol/base/entity/#ost.mol.ChainHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.mol.ChainHandle</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.IsNTerminal">
<code class="sig-name descname">IsNTerminal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.IsNTerminal" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff gap is N-terminal (i.e. <a class="reference internal" href="#promod3.modelling.StructuralGap.before" title="promod3.modelling.StructuralGap.before"><code class="xref py py-attr docutils literal notranslate"><span class="pre">before</span></code></a> is invalid
and <a class="reference internal" href="#promod3.modelling.StructuralGap.after" title="promod3.modelling.StructuralGap.after"><code class="xref py py-attr docutils literal notranslate"><span class="pre">after</span></code></a> is valid)</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.IsCTerminal">
<code class="sig-name descname">IsCTerminal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.IsCTerminal" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff gap is C-terminal (i.e. <a class="reference internal" href="#promod3.modelling.StructuralGap.before" title="promod3.modelling.StructuralGap.before"><code class="xref py py-attr docutils literal notranslate"><span class="pre">before</span></code></a> is valid
and <a class="reference internal" href="#promod3.modelling.StructuralGap.after" title="promod3.modelling.StructuralGap.after"><code class="xref py py-attr docutils literal notranslate"><span class="pre">after</span></code></a> is invalid)</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.IsTerminal">
<code class="sig-name descname">IsTerminal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.IsTerminal" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff gap is N- or C-terminal</p></dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.ShiftCTerminal">
<code class="sig-name descname">ShiftCTerminal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.ShiftCTerminal" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to shift gap by one position towards C-terminal. Only possible if new
gap is not terminal and it doesn’t try to shift the gap past another gap.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff shift succeeded (gap is only updated in that case)</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.ExtendAtNTerm">
<code class="sig-name descname">ExtendAtNTerm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.ExtendAtNTerm" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to extend gap at N-terminal end of gap.
Only possible if the gap is not at N-terminal and it doesn’t try to
extend the gap past another gap.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff extend succeeded (gap is only updated in that case)</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.ExtendAtCTerm">
<code class="sig-name descname">ExtendAtCTerm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.ExtendAtCTerm" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to extend gap at C-terminal end of gap.
Only possible if the gap is not at C-terminal and it doesn’t try to
extend the gap past another gap.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True, iff extend succeeded (gap is only updated in that case)</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.GetLength">
<code class="sig-name descname">GetLength</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.GetLength" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Length of the gap.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="promod3.modelling.StructuralGap.Copy">
<code class="sig-name descname">Copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.StructuralGap.Copy" title="Permalink to this definition">¶</a></dt><dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Copy of the gap.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="promod3.modelling.StructuralGap.length">
<code class="sig-name descname">length</code><a class="headerlink" href="#promod3.modelling.StructuralGap.length" title="Permalink to this definition">¶</a></dt>
<dd><p>Alias for <a class="reference internal" href="#promod3.modelling.StructuralGap.GetLength" title="promod3.modelling.StructuralGap.GetLength"><code class="xref py py-meth docutils literal notranslate"><span class="pre">GetLength()</span></code></a> (read-only, <a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>)</p>
</dd></dl>
<dl class="attribute">
<dt id="promod3.modelling.StructuralGap.seq">
<code class="sig-name descname">seq</code><a class="headerlink" href="#promod3.modelling.StructuralGap.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Sequence string for the gap (read-only, <a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>)</p>
</dd></dl>
<dl class="attribute">
<dt id="promod3.modelling.StructuralGap.before">
<code class="sig-name descname">before</code><a class="headerlink" href="#promod3.modelling.StructuralGap.before" title="Permalink to this definition">¶</a></dt>
<dd><p>Residue before the gap (read-only, <a class="reference external" href="https://www.openstructure.org/docs/2.2/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
</dd></dl>
<dl class="attribute">
<dt id="promod3.modelling.StructuralGap.after">
<code class="sig-name descname">after</code><a class="headerlink" href="#promod3.modelling.StructuralGap.after" title="Permalink to this definition">¶</a></dt>
<dd><p>Residue after the gap (read-only, <a class="reference external" href="https://www.openstructure.org/docs/2.2/mol/base/entity/#ost.mol.ResidueHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.mol.ResidueHandle</span></code></a>)</p>
</dd></dl>
<dl class="attribute">
<dt id="promod3.modelling.StructuralGap.full_seq">
<code class="sig-name descname">full_seq</code><a class="headerlink" href="#promod3.modelling.StructuralGap.full_seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Full sequence, including stem residues (read-only)</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="promod3.modelling.StructuralGapList">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">StructuralGapList</code><a class="headerlink" href="#promod3.modelling.StructuralGapList" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a <a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#list" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></a> of <a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>.</p>
</dd></dl>
</div>
<div class="section" id="gap-extender-classes">
<h2>Gap Extender classes<a class="headerlink" href="#gap-extender-classes" title="Permalink to this headline">¶</a></h2>
<p>The extender classes work on a given <a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a> and provide an
Extend() function to propose new gaps for loop modelling. The function returns
False if no new extension possible.</p>
<dl class="class">
<dt id="promod3.modelling.GapExtender">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">GapExtender</code><span class="sig-paren">(</span><em class="sig-param">gap</em>, <em class="sig-param">seqres</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.GapExtender" title="Permalink to this definition">¶</a></dt>
<dd><p>The extender cycles through the following steps:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> -
--
--
---
---
---
----
----
----
----
</pre></div>
</div><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – The gap which will be extended by <a class="reference internal" href="#promod3.modelling.GapExtender.Extend" title="promod3.modelling.GapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a>.</p></li>
<li><p><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/2.2/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.seq.SequenceHandle</span></code></a>) – The full sequence of the chain, the gap is associated with.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>An exception if a terminal gap is used to construct this.</p>
</dd>
</dl>
<dl class="method">
<dt id="promod3.modelling.GapExtender.Extend">
<code class="sig-name descname">Extend</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.GapExtender.Extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Tries to extend <em>gap</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>False, if the <em>gap</em> cannot be extended any further. This happens
if it reaches a terminal or another insertion gap.
Otherwise, the <em>gap</em> passed to the constructor is changed.
The gaps are extended with ascending length and will always have
valid termini.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="promod3.modelling.FullGapExtender">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">FullGapExtender</code><span class="sig-paren">(</span><em class="sig-param">gap</em>, <em class="sig-param">seqres</em>, <em class="sig-param">max_length=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.FullGapExtender" title="Permalink to this definition">¶</a></dt>
<dd><p>Cycles as GapExtender, but continues even if another gap was encountered.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – The gap which will be extended by <a class="reference internal" href="#promod3.modelling.FullGapExtender.Extend" title="promod3.modelling.FullGapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a>.</p></li>
<li><p><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/2.2/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.seq.SequenceHandle</span></code></a>) – The full sequence of the chain, the gap is associated with.</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – <ul>
<li><p>If -1, all possible non-terminal gaps are returned.</p></li>
<li><p>If >= 0, this restricts the max. gap-length
(w/o termini) producable by <a class="reference internal" href="#promod3.modelling.FullGapExtender.Extend" title="promod3.modelling.FullGapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a>.</p></li>
</ul>
</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>An exception if a terminal gap is used to construct this.</p>
</dd>
</dl>
<dl class="method">
<dt id="promod3.modelling.FullGapExtender.Extend">
<code class="sig-name descname">Extend</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.FullGapExtender.Extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Tries to extend <em>gap</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>False, if the <em>gap</em> cannot be extended without exceeding <em>max_length</em>.
Otherwise, the <em>gap</em> passed to the constructor is changed.
The gaps are extended with ascending length and will always have
valid termini.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="promod3.modelling.ScoringGapExtender">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">ScoringGapExtender</code><span class="sig-paren">(</span><em class="sig-param">gap</em>, <em class="sig-param">extension_penalty</em>, <em class="sig-param">penalties</em>, <em class="sig-param">seqres</em>, <em class="sig-param">max_length=-2</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringGapExtender" title="Permalink to this definition">¶</a></dt>
<dd><p>The extender scores possible gap extensions and returns them in order of
their score when <a class="reference internal" href="#promod3.modelling.ScoringGapExtender.Extend" title="promod3.modelling.ScoringGapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a> is called.
The score is penalized according to length and according to certain (well
conserved) regions in the structure as defined by <em>penalties</em>.
score = num_gap_extensions * <cite>extension_penalty</cite> + sum( <cite>penalties</cite> [i] )
(i = resnum - 1 of residues in extension)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – The gap which will be extended by <a class="reference internal" href="#promod3.modelling.ScoringGapExtender.Extend" title="promod3.modelling.ScoringGapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a>.</p></li>
<li><p><strong>extension_penalty</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#float" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code></a>) – Penalty for length of gap.</p></li>
<li><p><strong>penalties</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#list" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></a> of <a class="reference external" href="https://docs.python.org/3.7/library/functions.html#float" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code></a>) – Penalty for each residue added to gap.</p></li>
<li><p><strong>seqres</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#str" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> / <a class="reference external" href="https://www.openstructure.org/docs/2.2/seq/base/seq/#ost.seq.SequenceHandle" title="(in OpenStructure v2.2.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">ost.seq.SequenceHandle</span></code></a>) – The full sequence of the chain, the gap is associated with.</p></li>
<li><p><strong>max_length</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – <ul>
<li><p>If -2, <a class="reference internal" href="#promod3.modelling.GapExtender" title="promod3.modelling.GapExtender"><code class="xref py py-class docutils literal notranslate"><span class="pre">GapExtender</span></code></a> is used instead of <a class="reference internal" href="#promod3.modelling.FullGapExtender" title="promod3.modelling.FullGapExtender"><code class="xref py py-class docutils literal notranslate"><span class="pre">FullGapExtender</span></code></a>
(i.e. it stops at gaps and termini).</p></li>
<li><p>If -1, all possible non-terminal gaps are returned.</p></li>
<li><p>If >= 0, this restricts the max. gap-length (w/o termini)
producable by <a class="reference internal" href="#promod3.modelling.ScoringGapExtender.Extend" title="promod3.modelling.ScoringGapExtender.Extend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Extend()</span></code></a>.</p></li>
</ul>
</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>An exception if a terminal gap is used to construct this.</p>
</dd>
</dl>
<dl class="method">
<dt id="promod3.modelling.ScoringGapExtender.Extend">
<code class="sig-name descname">Extend</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ScoringGapExtender.Extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Tries to extend <em>gap</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>False, if the gap cannot be extended any further.
Otherwise, <em>gap</em> is changed and returned in ascending score.
The updated <em>gap</em> will always have valid termini.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#bool" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a></p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="promod3.modelling.ShiftExtension">
<em class="property">class </em><code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">ShiftExtension</code><span class="sig-paren">(</span><em class="sig-param">n_num</em>, <em class="sig-param">c_num</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ShiftExtension" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements the underlying extension scheme of the <a class="reference internal" href="#promod3.modelling.GapExtender" title="promod3.modelling.GapExtender"><code class="xref py py-class docutils literal notranslate"><span class="pre">GapExtender</span></code></a>.
It is not associated to any structural data, it just spits out the
residue numbers according to the extension scheme described above.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_num</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – N residue number to start with</p></li>
<li><p><strong>c_num</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – C residue number to start with</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="promod3.modelling.ShiftExtension.Extend">
<code class="sig-name descname">Extend</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ShiftExtension.Extend" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The next residue numbers for n_stem and c_stem</p>
</dd><dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.7/library/stdtypes.html#tuple" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></a></p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="gap-handling-functions">
<h2>Gap Handling Functions<a class="headerlink" href="#gap-handling-functions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="promod3.modelling.CountEnclosedGaps">
<code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">CountEnclosedGaps</code><span class="sig-paren">(</span><em class="sig-param">mhandle</em>, <em class="sig-param">gap</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.CountEnclosedGaps" title="Permalink to this definition">¶</a></dt>
<dt id="promod3.modelling.CountEnclosedInsertions">
<code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">CountEnclosedInsertions</code><span class="sig-paren">(</span><em class="sig-param">mhandle</em>, <em class="sig-param">gap</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.CountEnclosedInsertions" title="Permalink to this definition">¶</a></dt>
<dd><p>Counts all gaps from <cite>mhandle</cite> which are fully enclosed by given <cite>gap</cite>.
This is either all gaps or only insertions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModellingHandle</span></code></a>) – Modelling handle on which to apply change.</p></li>
<li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – Gap defining range in which gaps are to be removed.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Number of gaps.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="promod3.modelling.ClearGaps">
<code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">ClearGaps</code><span class="sig-paren">(</span><em class="sig-param">mhandle</em>, <em class="sig-param">gap</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.ClearGaps" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes all gaps from <cite>mhandle</cite> which are fully enclosed by given <cite>gap</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModellingHandle</span></code></a>) – Modelling handle on which to apply change.</p></li>
<li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – Gap defining range in which gaps are to be removed.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Index of next gap in mhandle.gaps after removal.
Returns -1 if last gap was removed or no gaps in <em>mhandle</em>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>A <a class="reference external" href="https://docs.python.org/3.7/library/exceptions.html#RuntimeError" title="(in Python v3.7)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> if any gap in mhandle.gaps is only partially
enclosed by given gap.</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="promod3.modelling.InsertLoopClearGaps">
<code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">InsertLoopClearGaps</code><span class="sig-paren">(</span><em class="sig-param">mhandle</em>, <em class="sig-param">bb_list</em>, <em class="sig-param">gap</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.InsertLoopClearGaps" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert loop into model, update scoring environments and remove all gaps from
<em>mhandle</em> which are fully enclosed by given <em>gap</em> (see <a class="reference internal" href="pipeline.html#promod3.modelling.InsertLoop" title="promod3.modelling.InsertLoop"><code class="xref py py-meth docutils literal notranslate"><span class="pre">InsertLoop()</span></code></a> and
<a class="reference internal" href="#promod3.modelling.ClearGaps" title="promod3.modelling.ClearGaps"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ClearGaps()</span></code></a>).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModellingHandle</span></code></a>) – Modelling handle on which to apply change.</p></li>
<li><p><strong>bb_list</strong> (<a class="reference internal" href="../loop/backbone.html#promod3.loop.BackboneList" title="promod3.loop.BackboneList"><code class="xref py py-class docutils literal notranslate"><span class="pre">BackboneList</span></code></a>) – Loop to insert (backbone only).</p></li><li><p><strong>gap</strong> (<a class="reference internal" href="#promod3.modelling.StructuralGap" title="promod3.modelling.StructuralGap"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructuralGap</span></code></a>) – Gap defining range of loop to insert (must be consistent!).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Index of next gap in mhandle.gaps after removal.
Returns -1 if last gap was removed or no gaps in <em>mhandle</em>.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>A <a class="reference external" href="https://docs.python.org/3.7/library/exceptions.html#RuntimeError" title="(in Python v3.7)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> if <em>bb_list</em> and <em>gap</em> are inconsistent or
if any gap in mhandle.gaps is only partially enclosed by <em>gap</em>.</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="promod3.modelling.MergeGaps">
<code class="sig-prename descclassname">promod3.modelling.</code><code class="sig-name descname">MergeGaps</code><span class="sig-paren">(</span><em class="sig-param">mhandle</em>, <em class="sig-param">index</em><span class="sig-paren">)</span><a class="headerlink" href="#promod3.modelling.MergeGaps" title="Permalink to this definition">¶</a></dt>
<dd><p>Merges two gaps <cite>mhandle.gaps[index]</cite> and <cite>mhandle.gaps[index+1]</cite>.
The residues in between the gaps are removed from <cite>mhandle.model</cite> and added
to the new <cite>mhandle.gaps[index]</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mhandle</strong> (<a class="reference internal" href="pipeline.html#promod3.modelling.ModellingHandle" title="promod3.modelling.ModellingHandle"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModellingHandle</span></code></a>) – Modelling handle on which to apply change.</p></li>
<li><p><strong>index</strong> (<a class="reference external" href="https://docs.python.org/3.7/library/functions.html#int" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>) – Index of gap to merge with next one.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>A <a class="reference external" href="https://docs.python.org/3.7/library/exceptions.html#RuntimeError" title="(in Python v3.7)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> if indices out of range or if trying to merge
gaps of different chains or an N-terminal gap with a C-terminal gap.</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../index.html">ProMod3</a></h1>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../users.html">Users</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../gettingstarted.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../actions/index.html">ProMod3 Actions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../buildsystem.html">Building ProMod3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../container/index.html">ProMod3 and Containers</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">modelling</span></code> - Protein Modelling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sidechain/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sidechain</span></code> - Sidechain Modelling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../scoring/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">scoring</span></code> - Loop Scoring</a></li>
<li class="toctree-l2"><a class="reference internal" href="../loop/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">loop</span></code> - Loop Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../core/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">core</span></code> - ProMod3 Core Functionality</a></li>
<li class="toctree-l2"><a class="reference internal" href="../core/setcompoundschemlib.html"><code class="xref py py-func docutils literal notranslate"><span class="pre">SetCompoundsChemlib()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../user_contributions.html">Contributing</a></li></ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../developers.html">Developers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../references.html">References</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li><a href="../users.html">Documentation For Users</a><ul>
<li><a href="index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">modelling</span></code> - Protein Modelling</a><ul>
<li>Previous: <a href="model_checking.html" title="previous chapter">Model Checking</a></li>
<li>Next: <a href="loop_candidates.html" title="next chapter">Handling Loop Candidates</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2013-2020, SIB - Swiss Institute of Bioinformatics and Biozentrum - University of Basel.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/modelling/gap_handling.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>