Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nargesr committed Jan 9, 2024
1 parent c23901c commit c6b19d2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
Binary file modified docs/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/html/_images/PyWGCNA_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 15 additions & 11 deletions docs/html/_modules/PyWGCNA/wgcna.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,12 @@ <h1>Source code for PyWGCNA.wgcna</h1><div class="highlight"><pre>

<span class="bp">self</span><span class="o">.</span><span class="n">figureType</span> <span class="o">=</span> <span class="n">figureType</span>

<div class="viewcode-block" id="WGCNA.preprocess"><a class="viewcode-back" href="../../api.html#PyWGCNA.wgcna.WGCNA.preprocess">[docs]</a> <span class="k">def</span> <span class="nf">preprocess</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="WGCNA.preprocess"><a class="viewcode-back" href="../../api.html#PyWGCNA.wgcna.WGCNA.preprocess">[docs]</a> <span class="k">def</span> <span class="nf">preprocess</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">show</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Preprocessing PyWGCNA object including removing obvious outlier on genes and samples</span>

<span class="sd"> :param show: indicate if you want to show your plot or not (if you put this to False it will not either show and save the plot)</span>
<span class="sd"> :type show: bool</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">BOLD</span><span class="si">}{</span><span class="n">OKBLUE</span><span class="si">}</span><span class="s2">Pre-processing...</span><span class="si">{</span><span class="n">ENDC</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

Expand All @@ -339,16 +342,17 @@ <h1>Source code for PyWGCNA.wgcna</h1><div class="highlight"><pre>
<span class="c1"># Clustering</span>
<span class="n">sampleTree</span> <span class="o">=</span> <span class="n">WGCNA</span><span class="o">.</span><span class="n">hclust</span><span class="p">(</span><span class="n">pdist</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">datExpr</span><span class="o">.</span><span class="n">to_df</span><span class="p">()),</span> <span class="n">method</span><span class="o">=</span><span class="s2">&quot;average&quot;</span><span class="p">)</span>

<span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="mi">25</span><span class="p">,</span> <span class="nb">round</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">datExpr</span><span class="o">.</span><span class="n">X</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">/</span> <span class="mi">20</span><span class="p">)),</span> <span class="mi">10</span><span class="p">),</span> <span class="n">facecolor</span><span class="o">=</span><span class="s1">&#39;white&#39;</span><span class="p">)</span>
<span class="n">dendrogram</span><span class="p">(</span><span class="n">sampleTree</span><span class="p">,</span> <span class="n">color_threshold</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cut</span><span class="p">,</span> <span class="n">labels</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">datExpr</span><span class="o">.</span><span class="n">to_df</span><span class="p">()</span><span class="o">.</span><span class="n">index</span><span class="p">,</span> <span class="n">leaf_rotation</span><span class="o">=</span><span class="mi">90</span><span class="p">,</span>
<span class="n">leaf_font_size</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">axhline</span><span class="p">(</span><span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cut</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="s1">&#39;grey&#39;</span><span class="p">,</span> <span class="n">lw</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">linestyle</span><span class="o">=</span><span class="s1">&#39;dashed&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s1">&#39;Sample clustering to detect outliers&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s1">&#39;Samples&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s1">&#39;Distances&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight_layout</span><span class="p">()</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">save</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">outputPath</span><span class="si">}</span><span class="s2">figures/sample_clustering_cleaning.</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">figureType</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">show</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="mi">25</span><span class="p">,</span> <span class="nb">round</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">datExpr</span><span class="o">.</span><span class="n">X</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">/</span> <span class="mi">20</span><span class="p">)),</span> <span class="mi">10</span><span class="p">),</span> <span class="n">facecolor</span><span class="o">=</span><span class="s1">&#39;white&#39;</span><span class="p">)</span>
<span class="n">dendrogram</span><span class="p">(</span><span class="n">sampleTree</span><span class="p">,</span> <span class="n">color_threshold</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cut</span><span class="p">,</span> <span class="n">labels</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">datExpr</span><span class="o">.</span><span class="n">to_df</span><span class="p">()</span><span class="o">.</span><span class="n">index</span><span class="p">,</span> <span class="n">leaf_rotation</span><span class="o">=</span><span class="mi">90</span><span class="p">,</span>
<span class="n">leaf_font_size</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">axhline</span><span class="p">(</span><span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cut</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="s1">&#39;grey&#39;</span><span class="p">,</span> <span class="n">lw</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">linestyle</span><span class="o">=</span><span class="s1">&#39;dashed&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s1">&#39;Sample clustering to detect outliers&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s1">&#39;Samples&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s1">&#39;Distances&#39;</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight_layout</span><span class="p">()</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">save</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">outputPath</span><span class="si">}</span><span class="s2">figures/sample_clustering_cleaning.</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">figureType</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="c1"># Determine cluster under the line</span>
<span class="n">clust</span> <span class="o">=</span> <span class="n">WGCNA</span><span class="o">.</span><span class="n">cutree</span><span class="p">(</span><span class="n">sampleTree</span><span class="p">,</span> <span class="n">cutHeight</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cut</span><span class="p">)</span>
Expand Down
7 changes: 6 additions & 1 deletion docs/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,13 @@

<dl class="py method">
<dt class="sig sig-object py" id="PyWGCNA.wgcna.WGCNA.preprocess">
<span class="sig-name descname"><span class="pre">preprocess</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PyWGCNA/wgcna.html#WGCNA.preprocess"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#PyWGCNA.wgcna.WGCNA.preprocess" title="Permalink to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">preprocess</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">show</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PyWGCNA/wgcna.html#WGCNA.preprocess"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#PyWGCNA.wgcna.WGCNA.preprocess" title="Permalink to this definition"></a></dt>
<dd><p>Preprocessing PyWGCNA object including removing obvious outlier on genes and samples</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>show</strong> (<em>bool</em>) – indicate if you want to show your plot or not (if you put this to False it will not either show and save the plot)</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
setup(
name='PyWGCNA', # the name of your package
packages=['PyWGCNA'], # same as above
version='2.0.0', # version number
version='2.0.1', # version number
license='MIT', # license type
description='PyWGCNA is a Python package designed to do Weighted correlation network analysis (WGCNA)',
# short description
author='Narges Rezaie', # your name
author_email='[email protected]', # your email
url='https://github.com/mortazavilab/PyWGCNA', # url to your git repo
download_url='https://github.com/mortazavilab/PyWGCNA/archive/refs/tags/v2.0.0.zip', # link to the tar.gz file associated with this release
download_url='https://github.com/mortazavilab/PyWGCNA/archive/refs/tags/v2.0.1.zip', # link to the tar.gz file associated with this release
keywords=['PyWGCNA', 'WGCNA', 'bulk', 'gene clustering', 'network analysis'], #
install_requires=[ # these can also include >, <, == to enforce version compatibility
'pandas>=2.1.0', # make sure the packages you put here are those NOT included in the
Expand Down

0 comments on commit c6b19d2

Please sign in to comment.