Skip to content

Commit

Permalink
Disable numpydoc to solve conflicts with napoleon
Browse files Browse the repository at this point in the history
  • Loading branch information
breimanntools committed Sep 19, 2023
1 parent cc58884 commit 736f0d5
Show file tree
Hide file tree
Showing 28 changed files with 697 additions and 798 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.AAclust.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.CPP.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.CPPPlot.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.SequenceFeature.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.dPULearn.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.load_scales.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_gcfs.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_get_cdict.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_get_cmap.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_set_legend.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_settings.doctree
Binary file not shown.
283 changes: 161 additions & 122 deletions docs/build/html/generated/aaanalysis.AAclust.html

Large diffs are not rendered by default.

103 changes: 43 additions & 60 deletions docs/build/html/generated/aaanalysis.CPP.html

Large diffs are not rendered by default.

305 changes: 117 additions & 188 deletions docs/build/html/generated/aaanalysis.CPPPlot.html

Large diffs are not rendered by default.

404 changes: 185 additions & 219 deletions docs/build/html/generated/aaanalysis.SequenceFeature.html

Large diffs are not rendered by default.

86 changes: 42 additions & 44 deletions docs/build/html/generated/aaanalysis.dPULearn.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,28 @@ <h1>aaanalysis.dPULearn<a class="headerlink" href="#aaanalysis-dpulearn" title="
Euclidean, Manhattan, or Cosine distance if specified.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>verbose</strong><span class="classifier">bool, default=False</span></dt><dd><p>Enable verbose output.</p>
</dd>
<dt><strong>n_components</strong><span class="classifier">float or int, default=0.80</span></dt><dd><p>Number of components to cover a maximum percentage of total variance when PCA is applied.</p>
</dd>
<dt><strong>pca_kwargs</strong><span class="classifier">dict, default=None</span></dt><dd><p>Additional keyword arguments to pass to PCA.</p>
</dd>
<dt><strong>metric</strong><span class="classifier">{‘euclidean’, ‘manhattan’, ‘cosine’} or None, default=None</span></dt><dd><p>The distance metric to use. If None, PCA-based identification is used.
If a metric is specified, distance-based identification is performed.</p>
<dd class="field-odd"><ul class="simple">
<li><p><strong>verbose</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><em>bool</em></a><em>, </em><em>default=False</em>) – Enable verbose output.</p></li>
<li><p><strong>n_components</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><em>int</em></a><em>, </em><em>default=0.80</em>) – Number of components to cover a maximum percentage of total variance when PCA is applied.</p></li>
<li><p><strong>pca_kwargs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)"><em>dict</em></a><em>, </em><em>default=None</em>) – Additional keyword arguments to pass to PCA.</p></li>
<li><p><strong>metric</strong> (<em>{'euclidean'</em><em>, </em><em>'manhattan'</em><em>, </em><em>'cosine'}</em><em> or </em><em>None</em><em>, </em><em>default=None</em>) – The distance metric to use. If None, PCA-based identification is used.
If a metric is specified, distance-based identification is performed.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="aaanalysis.dPULearn.labels_">
<span class="sig-name descname"><span class="pre">labels_</span></span><a class="headerlink" href="#aaanalysis.dPULearn.labels_" title="Permalink to this definition"></a></dt>
<dd><p>Labels of each datapoint.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>array-like, shape (n_samples,)</p>
</dd>
</dl>
<p class="rubric">Notes</p>
</dd></dl>

<div class="admonition-notes admonition">
<p class="admonition-title">Notes</p>
<ul class="simple">
<li><dl class="simple">
<dt>The method is inspired by deterministic PU learning techniques and follows</dt><dd><p>an information-theoretic PU learning approach.</p>
Expand All @@ -157,14 +165,7 @@ <h1>aaanalysis.dPULearn<a class="headerlink" href="#aaanalysis-dpulearn" title="
</li>
<li><p>Cosine metric is recommended in high-dimensional spaces.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Attributes</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>labels_</strong><span class="classifier">array-like, shape (n_samples,)</span></dt><dd><p>Labels of each datapoint.</p>
</dd>
</dl>
</dd>
</dl>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="aaanalysis.dPULearn.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_components</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.8</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pca_kwargs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metric</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/aaanalysis/dpulearn/dpulearn.html#dPULearn.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/dpulearn/dpulearn.py#L222-L233"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.dPULearn.__init__" title="Permalink to this definition"></a></dt>
Expand All @@ -188,45 +189,36 @@ <h1>aaanalysis.dPULearn<a class="headerlink" href="#aaanalysis-dpulearn" title="
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="aaanalysis.dPULearn.eval">
<span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/aaanalysis/dpulearn/dpulearn.html#dPULearn.eval"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/dpulearn/dpulearn.py#L306-L307"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.dPULearn.eval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="aaanalysis.dPULearn.fit">
<span class="sig-name descname"><span class="pre">fit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">X</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">labels</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_neg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name_neg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'REL_NEG'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">df_seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">col_class</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'class'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/aaanalysis/dpulearn/dpulearn.html#dPULearn.fit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/dpulearn/dpulearn.py#L236-L304"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.dPULearn.fit" title="Permalink to this definition"></a></dt>
<dd><p>Fit the dPULearn model to identify reliable negative samples
from the provided feature matrix and labels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>X</strong><span class="classifier">array-like, shape (n_samples, n_features)</span></dt><dd><p>Feature matrix where <cite>n_samples</cite> is the number of samples and <cite>n_features</cite> is the number of features.</p>
</dd>
<dt><strong>labels</strong><span class="classifier">array-like, shape (n_samples,), default=None</span></dt><dd><p>Array of labels; positive samples should be indicated by <cite>label_pos</cite>.</p>
</dd>
<dt><strong>n_neg</strong><span class="classifier">int, default=0</span></dt><dd><p>Number of negative samples to identify.</p>
</dd>
<dt><strong>label_pos</strong><span class="classifier">int or str, default=1</span></dt><dd><p>Label indicating positive samples in the <cite>labels</cite> array.</p>
</dd>
<dt><strong>name_neg</strong><span class="classifier">str, default=”REL_NEG”</span></dt><dd><p>Name to assign to the newly identified negative samples.</p>
</dd>
<dt><strong>df_seq</strong><span class="classifier">DataFrame, default=None, optional</span></dt><dd><p>DataFrame containing sequences; will be updated with new negative samples.</p>
</dd>
<dt><strong>col_class</strong><span class="classifier">str, default=”class”</span></dt><dd><p>Column name in <cite>df_seq</cite> where the class labels are stored.</p>
</dd>
</dl>
<dd class="field-odd"><ul class="simple">
<li><p><strong>X</strong> (<em>array-like</em><em>, </em><em>shape</em><em> (</em><em>n_samples</em><em>, </em><em>n_features</em><em>)</em>) – Feature matrix where <cite>n_samples</cite> is the number of samples and <cite>n_features</cite> is the number of features.</p></li>
<li><p><strong>labels</strong> (<em>array-like</em><em>, </em><em>shape</em><em> (</em><em>n_samples</em><em>,</em><em>)</em><em>, </em><em>default=None</em>) – Array of labels; positive samples should be indicated by <cite>label_pos</cite>.</p></li>
<li><p><strong>n_neg</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><em>int</em></a><em>, </em><em>default=0</em>) – Number of negative samples to identify.</p></li>
<li><p><strong>label_pos</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><em>str</em></a><em>, </em><em>default=1</em>) – Label indicating positive samples in the <cite>labels</cite> array.</p></li>
<li><p><strong>name_neg</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><em>str</em></a><em>, </em><em>default=&quot;REL_NEG&quot;</em>) – Name to assign to the newly identified negative samples.</p></li>
<li><p><strong>df_seq</strong> (<em>DataFrame</em><em>, </em><em>default=None</em><em>, </em><em>optional</em>) – DataFrame containing sequences; will be updated with new negative samples.</p></li>
<li><p><strong>col_class</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><em>str</em></a><em>, </em><em>default=&quot;class&quot;</em>) – Column name in <cite>df_seq</cite> where the class labels are stored.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>df_seq</strong><span class="classifier">DataFrame</span></dt><dd><p>DataFrame with the newly identified reliable negatives. Will be None if not provided.</p>
<dd class="field-even"><p><strong>df_seq</strong> – DataFrame with the newly identified reliable negatives. Will be None if not provided.</p>
</dd>
</dl>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>DataFrame</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<div class="admonition-notes admonition">
<p class="admonition-title">Notes</p>
<p>Distance-based identification is used if <cite>metric</cite> is specified during class initialization.</p>
<p class="rubric">Examples</p>
</div>
<div class="admonition-examples admonition">
<p class="admonition-title">Examples</p>
<p>Create small example datafor dPUlearn containg positive (‘pos’, 1) and unlabeled (‘unl’, 2) data</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">aaanalysis</span> <span class="k">as</span> <span class="nn">aa</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
Expand All @@ -245,8 +237,14 @@ <h1>aaanalysis.dPULearn<a class="headerlink" href="#aaanalysis-dpulearn" title="
<span class="gp">&gt;&gt;&gt; </span><span class="n">labels</span> <span class="o">=</span> <span class="n">dpul</span><span class="o">.</span><span class="n">labels_</span> <span class="c1"># Updated labels</span>
</pre></div>
</div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="aaanalysis.dPULearn.eval">
<span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/aaanalysis/dpulearn/dpulearn.html#dPULearn.eval"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/dpulearn/dpulearn.py#L306-L307"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.dPULearn.eval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

</div>
Expand Down
43 changes: 18 additions & 25 deletions docs/build/html/generated/aaanalysis.load_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,38 +127,31 @@ <h1>aaanalysis.load_dataset<a class="headerlink" href="#aaanalysis-load-dataset"
the residue and sequence datasets can be found in [Breimann23a].</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>name</strong></dt><dd><p>Name of the dataset. See ‘Dataset’ column in overview table.</p>
</dd>
<dt><strong>n</strong></dt><dd><p>Number of proteins per class. If None, the whole dataset will be returned.</p>
</dd>
<dt><strong>non_canonical_aa</strong></dt><dd><p>Options for modifying non-canonical amino acids:</p>
<ul class="simple">
<li><p>‘remove’: Sequences containing non-canonical amino acids are removed.</p></li>
<li><p>‘keep’: Sequences containing non-canonical amino acids are not removed.</p></li>
<li><p>‘gap’: Sequences are kept and modified by replacing non-canonical amino acids by gap symbol (‘X’).</p></li>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>) – Name of the dataset. See ‘Dataset’ column in overview table.</p></li>
<li><p><strong>n</strong> (<a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Optional" title="(in Python v3.11)"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>]) – Number of proteins per class. If None, the whole dataset will be returned.</p></li>
<li><p><strong>non_canonical_aa</strong> (<a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Literal" title="(in Python v3.11)"><code class="xref py py-data docutils literal notranslate"><span class="pre">Literal</span></code></a>[‘remove’, ‘keep’, ‘gap’]) – <p>Options for modifying non-canonical amino acids:</p>
<ul>
<li><p>’remove’: Sequences containing non-canonical amino acids are removed.</p></li>
<li><p>’keep’: Sequences containing non-canonical amino acids are not removed.</p></li>
<li><p>’gap’: Sequences are kept and modified by replacing non-canonical amino acids by gap symbol (‘X’).</p></li>
</ul>
</p></li>
<li><p><strong>min_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Optional" title="(in Python v3.11)"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>]) – Minimum length of sequences for filtering. None to disable</p></li>
<li><p><strong>max_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Optional" title="(in Python v3.11)"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>]) – Maximum length of sequences for filtering. None to disable</p></li>
</ul>
</dd>
<dt><strong>min_len</strong></dt><dd><p>Minimum length of sequences for filtering. None to disable</p>
</dd>
<dt><strong>max_len</strong></dt><dd><p>Maximum length of sequences for filtering. None to disable</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>df_seq</dt><dd><p>Dataframe with the selected sequence dataset.</p>
<dd class="field-even"><p>Dataframe with the selected sequence dataset.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>See further information on the benchmark datasets in</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame" title="(in pandas v2.1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">DataFrame</span></code></a></p>
<dd class="field-odd"><p>df_seq</p>
</dd>
</dl>
<div class="admonition-notes admonition">
<p class="admonition-title">Notes</p>
<p>See further information on the benchmark datasets in</p>
</div>
</dd></dl>

</div>
Expand Down
Loading

0 comments on commit 736f0d5

Please sign in to comment.