Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nargesr committed Dec 14, 2023
1 parent fa8debf commit 5b71f78
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 84 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/TopicModels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 16 additions & 12 deletions docs/html/_modules/Topyfic/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,7 @@ <h1>Source code for Topyfic.analysis</h1><div class="highlight"><pre>
<span class="n">order_cell</span> <span class="o">=</span> <span class="n">order_cells</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">tissue</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span><span class="n">by</span><span class="o">=</span><span class="n">order_cell</span><span class="p">,</span> <span class="n">ascending</span><span class="o">=</span><span class="n">ascending</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">tmp</span><span class="o">.</span><span class="n">reindex</span><span class="p">(</span><span class="n">tissue</span><span class="o">.</span><span class="n">index</span><span class="p">)</span>
<span class="n">tissue</span><span class="p">[</span><span class="s1">&#39;count&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">tissue</span> <span class="o">=</span> <span class="n">tissue</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="nb">object</span><span class="p">)</span>
<span class="n">groups</span> <span class="o">=</span> <span class="n">tissue</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="n">order_cell</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span><span class="o">.</span><span class="n">reset_index</span><span class="p">()[</span><span class="n">order_cell</span> <span class="o">+</span> <span class="p">[</span><span class="s1">&#39;count&#39;</span><span class="p">]]</span>
<span class="n">groups</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span><span class="n">by</span><span class="o">=</span><span class="n">order_cell</span><span class="p">,</span> <span class="n">ascending</span><span class="o">=</span><span class="n">ascending</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">groups</span> <span class="o">=</span> <span class="n">tissue</span><span class="p">[</span><span class="n">order_cell</span><span class="p">]</span><span class="o">.</span><span class="n">value_counts</span><span class="p">(</span><span class="n">sort</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span><span class="o">.</span><span class="n">reset_index</span><span class="p">()</span>
<span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">index</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">groups</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
Expand Down Expand Up @@ -447,15 +444,22 @@ <h1>Source code for Topyfic.analysis</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">metaData</span><span class="p">)):</span>
<span class="n">color</span> <span class="o">=</span> <span class="n">tissue</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]]</span><span class="o">.</span><span class="n">values</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]])</span> <span class="o">==</span> <span class="nb">dict</span><span class="p">:</span>
<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">scatter</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]],</span>
<span class="n">c</span><span class="o">=</span><span class="n">color</span><span class="p">,</span> <span class="n">s</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s2">&quot;|&quot;</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
<span class="n">linewidths</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">scatter</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]],</span>
<span class="n">c</span><span class="o">=</span><span class="n">color</span><span class="p">,</span>
<span class="n">s</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span>
<span class="n">marker</span><span class="o">=</span><span class="s2">&quot;|&quot;</span><span class="p">,</span>
<span class="n">alpha</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
<span class="n">edgecolor</span><span class="o">=</span><span class="s1">&#39;none&#39;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">scatter</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]],</span>
<span class="n">c</span><span class="o">=</span><span class="n">color</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]]</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(),</span> <span class="n">s</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span>
<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">scatter</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]],</span>
<span class="n">c</span><span class="o">=</span><span class="n">color</span><span class="p">,</span>
<span class="n">cmap</span><span class="o">=</span><span class="n">metaData_palette</span><span class="p">[</span><span class="n">metaData</span><span class="p">[</span><span class="n">j</span><span class="p">]]</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(),</span>
<span class="n">s</span><span class="o">=</span><span class="mi">1000</span><span class="p">,</span>
<span class="n">marker</span><span class="o">=</span><span class="s2">&quot;|&quot;</span><span class="p">,</span>
<span class="n">alpha</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
<span class="n">linewidths</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">edgecolor</span><span class="o">=</span><span class="s1">&#39;none&#39;</span><span class="p">)</span>

<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">axis</span><span class="p">(</span><span class="s1">&#39;off&#39;</span><span class="p">)</span>
<span class="n">axs</span><span class="p">[</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
Expand Down Expand Up @@ -765,8 +769,8 @@ <h1>Source code for Topyfic.analysis</h1><div class="highlight"><pre>
<span class="sd"> :type topic: str</span>
<span class="sd"> :param color: name of the feature you want to have one line per group of that (it should be column name of cell_participation.obs)</span>
<span class="sd"> :type color:str</span>
<span class="sd"> :type color_pallet: color of each category of color (if it None color assign randomly)</span>
<span class="sd"> :param color_pallet: dict</span>
<span class="sd"> :param color_pallet: color of each category of color (if it None color assign randomly)</span>
<span class="sd"> :type color_pallet: dict</span>
<span class="sd"> :param category: name of the feature you want to have on x axis (it should be column name of cell_participation.obs)</span>
<span class="sd"> :type category: str</span>
<span class="sd"> :param save: indicate if you want to save the plot or not (default: True)</span>
Expand Down
Loading

0 comments on commit 5b71f78

Please sign in to comment.