Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4263bca 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ielis committed Nov 13, 2024
1 parent 3114db0 commit fc85726
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 24 deletions.
44 changes: 24 additions & 20 deletions latest/_modules/gpsea/model/_protein.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,32 @@ <h1>Source code for gpsea.model._protein</h1><div class="highlight"><pre>
<span class="n">REGION</span> <span class="o">=</span> <span class="n">enum</span><span class="o">.</span><span class="n">auto</span><span class="p">()</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A region of interest that cannot be described in other subsections.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">ZINC_FINGER</span> <span class="o">=</span> <span class="n">enum</span><span class="o">.</span><span class="n">auto</span><span class="p">()</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A zinc finger is a small, functional, independently folded domain that coordinates one or more zinc ions to stabilize its structure through cysteine and/or histidine residues.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<div class="viewcode-block" id="FeatureType.from_string">
<a class="viewcode-back" href="../../../apidocs/gpsea.model.html#gpsea.model.FeatureType.from_string">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">from_string</span><span class="p">(</span><span class="n">category</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s2">&quot;FeatureType&quot;</span><span class="p">:</span>
<span class="n">cat_lover</span> <span class="o">=</span> <span class="n">category</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">if</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;repeat&quot;</span><span class="p">:</span>
<span class="n">cat_lower</span> <span class="o">=</span> <span class="n">category</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">if</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;repeat&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">REGION</span>
<span class="k">elif</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;motif&quot;</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;motif&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">MOTIF</span>
<span class="k">elif</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;domain&quot;</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;domain&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">DOMAIN</span>
<span class="k">elif</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;region&quot;</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;region&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">REGION</span>
<span class="k">elif</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;coiled coil&quot;</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;coiled coil&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">REGION</span>
<span class="k">elif</span> <span class="n">cat_lover</span> <span class="o">==</span> <span class="s2">&quot;compositional bias&quot;</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;compositional bias&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">COMPOSITIONAL_BIAS</span>
<span class="k">elif</span> <span class="n">cat_lower</span> <span class="o">==</span> <span class="s2">&quot;zinc finger&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">ZINC_FINGER</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Unrecognized protein feature type: &quot;</span><span class="si">{</span><span class="n">category</span><span class="si">}</span><span class="s1">&quot;&#39;</span><span class="p">)</span></div>
</div>
Expand Down Expand Up @@ -467,19 +474,16 @@ <h1>Source code for gpsea.model._protein</h1><div class="highlight"><pre>

<span class="n">regions</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
<span class="k">for</span> <span class="n">feature</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s2">&quot;features&quot;</span><span class="p">]:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">region_name</span> <span class="o">=</span> <span class="n">feature</span><span class="p">[</span><span class="s2">&quot;description&quot;</span><span class="p">]</span>
<span class="n">locus</span> <span class="o">=</span> <span class="n">feature</span><span class="p">[</span><span class="s2">&quot;location&quot;</span><span class="p">]</span>
<span class="n">region_start</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">locus</span><span class="p">[</span><span class="s2">&quot;start&quot;</span><span class="p">][</span><span class="s2">&quot;value&quot;</span><span class="p">])</span> <span class="o">-</span> <span class="mi">1</span> <span class="c1"># convert to 0-based coordinates</span>
<span class="n">region_end</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">locus</span><span class="p">[</span><span class="s2">&quot;end&quot;</span><span class="p">][</span><span class="s2">&quot;value&quot;</span><span class="p">])</span>
<span class="n">feature_type</span> <span class="o">=</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">from_string</span><span class="p">(</span><span class="n">feature</span><span class="p">[</span><span class="s2">&quot;type&quot;</span><span class="p">])</span>
<span class="n">finfo</span> <span class="o">=</span> <span class="n">FeatureInfo</span><span class="p">(</span>
<span class="n">name</span><span class="o">=</span><span class="n">region_name</span><span class="p">,</span> <span class="n">region</span><span class="o">=</span><span class="n">Region</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">region_start</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="n">region_end</span><span class="p">)</span>
<span class="p">)</span>
<span class="n">pfeature</span> <span class="o">=</span> <span class="n">ProteinFeature</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">info</span><span class="o">=</span><span class="n">finfo</span><span class="p">,</span> <span class="n">feature_type</span><span class="o">=</span><span class="n">feature_type</span><span class="p">)</span>
<span class="n">regions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">pfeature</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">feature_exception</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Could not parse feature: </span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="n">feature_exception</span><span class="p">)</span><span class="si">}</span><span class="s2"> (skipping)&quot;</span><span class="p">)</span>
<span class="n">region_name</span> <span class="o">=</span> <span class="n">feature</span><span class="p">[</span><span class="s2">&quot;description&quot;</span><span class="p">]</span>
<span class="n">locus</span> <span class="o">=</span> <span class="n">feature</span><span class="p">[</span><span class="s2">&quot;location&quot;</span><span class="p">]</span>
<span class="n">region_start</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">locus</span><span class="p">[</span><span class="s2">&quot;start&quot;</span><span class="p">][</span><span class="s2">&quot;value&quot;</span><span class="p">])</span> <span class="o">-</span> <span class="mi">1</span> <span class="c1"># convert to 0-based coordinates</span>
<span class="n">region_end</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">locus</span><span class="p">[</span><span class="s2">&quot;end&quot;</span><span class="p">][</span><span class="s2">&quot;value&quot;</span><span class="p">])</span>
<span class="n">feature_type</span> <span class="o">=</span> <span class="n">FeatureType</span><span class="o">.</span><span class="n">from_string</span><span class="p">(</span><span class="n">feature</span><span class="p">[</span><span class="s2">&quot;type&quot;</span><span class="p">])</span>
<span class="n">finfo</span> <span class="o">=</span> <span class="n">FeatureInfo</span><span class="p">(</span>
<span class="n">name</span><span class="o">=</span><span class="n">region_name</span><span class="p">,</span> <span class="n">region</span><span class="o">=</span><span class="n">Region</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="n">region_start</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="n">region_end</span><span class="p">)</span>
<span class="p">)</span>
<span class="n">pfeature</span> <span class="o">=</span> <span class="n">ProteinFeature</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">info</span><span class="o">=</span><span class="n">finfo</span><span class="p">,</span> <span class="n">feature_type</span><span class="o">=</span><span class="n">feature_type</span><span class="p">)</span>
<span class="n">regions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">pfeature</span><span class="p">)</span>

<span class="k">return</span> <span class="n">ProteinMetadata</span><span class="p">(</span>
<span class="n">protein_id</span><span class="o">=</span><span class="n">protein_id</span><span class="p">,</span>
Expand Down
4 changes: 3 additions & 1 deletion latest/_modules/gpsea/preprocessing/_uniprot.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ <h1>Source code for gpsea.preprocessing._uniprot</h1><div class="highlight"><pre
<span class="sd"> Args:</span>
<span class="sd"> protein_id (str): A protein ID</span>
<span class="sd"> Returns:</span>
<span class="sd"> Sequence[ProteinMetadata]: A sequence of ProteinMetadata objects, or an empty sequence if no data was found.</span>
<span class="sd"> ProteinMetadata: A :class:`~gpsea.model.ProteinMetadata` corresponding to the input `protein_id`.</span>
<span class="sd"> Raises:</span>
<span class="sd"> ValueError: in case of issues with `protein_id`, I/O issues, or parsing the REST response.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">protein_id</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Protein ID must be a str but it was </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">protein_id</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
Expand Down
6 changes: 6 additions & 0 deletions latest/apidocs/gpsea.model.html
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,12 @@
<dd><p>A region of interest that cannot be described in other subsections.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="gpsea.model.FeatureType.ZINC_FINGER">
<span class="sig-name descname"><span class="pre">ZINC_FINGER</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">7</span></em><a class="headerlink" href="#gpsea.model.FeatureType.ZINC_FINGER" title="Link to this definition"></a></dt>
<dd><p>A zinc finger is a small, functional, independently folded domain that coordinates one or more zinc ions to stabilize its structure through cysteine and/or histidine residues.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="gpsea.model.FeatureType.from_string">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">category</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#gpsea.model.FeatureType" title="gpsea.model._protein.FeatureType"><span class="pre">FeatureType</span></a></span></span><a class="reference internal" href="../_modules/gpsea/model/_protein.html#FeatureType.from_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gpsea.model.FeatureType.from_string" title="Link to this definition"></a></dt>
Expand Down
7 changes: 5 additions & 2 deletions latest/apidocs/gpsea.preprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,13 @@
<dd class="field-odd"><p><strong>protein_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – A protein ID</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A sequence of ProteinMetadata objects, or an empty sequence if no data was found.</p>
<dd class="field-even"><p>A <a class="reference internal" href="gpsea.model.html#gpsea.model.ProteinMetadata" title="gpsea.model.ProteinMetadata"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProteinMetadata</span></code></a> corresponding to the input <cite>protein_id</cite>.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>Sequence[<a class="reference internal" href="gpsea.model.html#gpsea.model.ProteinMetadata" title="gpsea.model.ProteinMetadata">ProteinMetadata</a>]</p>
<dd class="field-odd"><p><a class="reference internal" href="gpsea.model.html#gpsea.model.ProteinMetadata" title="gpsea.model.ProteinMetadata">ProteinMetadata</a></p>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.13)"><strong>ValueError</strong></a> – in case of issues with <cite>protein_id</cite>, I/O issues, or parsing the REST response.</p>
</dd>
</dl>
</dd></dl>
Expand Down
9 changes: 9 additions & 0 deletions latest/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ <h1 id="index">Index</h1>
| <a href="#U"><strong>U</strong></a>
| <a href="#V"><strong>V</strong></a>
| <a href="#W"><strong>W</strong></a>
| <a href="#Z"><strong>Z</strong></a>

</div>
<h2 id="A">A</h2>
Expand Down Expand Up @@ -1825,6 +1826,14 @@ <h2 id="W">W</h2>
</ul></td>
</tr></table>

<h2 id="Z">Z</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="apidocs/gpsea.model.html#gpsea.model.FeatureType.ZINC_FINGER">ZINC_FINGER (gpsea.model.FeatureType attribute)</a>
</li>
</ul></td>
</tr></table>



</div>
Expand Down
Binary file modified latest/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion latest/searchindex.js

Large diffs are not rendered by default.

0 comments on commit fc85726

Please sign in to comment.