Skip to content

Commit

Permalink
deploy: 25b57c6
Browse files Browse the repository at this point in the history
  • Loading branch information
haozhu233 committed May 11, 2024
1 parent 4c8ee3b commit cde0f4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions _sources/quick_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,9 @@ You can also apply the clustering information to your visual.

```python
>>> gene_group_dict = dict()
>>> gene_group_dict = {g:[
>>> 'red', 'blue', 'yellow', 'green'
>>> ][c] for g, c in zip(nxg.nodes(), node_labels)}
>>> gene_group_dict = {g:str(c) for g, c in zip(nxg.nodes(), node_labels)}
>>> g = grn.visualize_local_neighborhood(
>>> 'HIST1H1D', k=40, node_color_dict=gene_group_dict
>>> 'HIST1H1D', k=40, node_group_dict=gene_group_dict
>>> )
>>> g.show('view.html')
```
Expand Down
6 changes: 2 additions & 4 deletions quick_tour.html
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,9 @@ <h3>(Optional) Step 3. Node clustering<a class="headerlink" href="#optional-step
</div>
<p>You can also apply the clustering information to your visual.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gene_group_dict</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gene_group_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">g</span><span class="p">:[</span>
<span class="gp">&gt;&gt;&gt; </span> <span class="s1">&#39;red&#39;</span><span class="p">,</span> <span class="s1">&#39;blue&#39;</span><span class="p">,</span> <span class="s1">&#39;yellow&#39;</span><span class="p">,</span> <span class="s1">&#39;green&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">][</span><span class="n">c</span><span class="p">]</span> <span class="k">for</span> <span class="n">g</span><span class="p">,</span> <span class="n">c</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">nxg</span><span class="o">.</span><span class="n">nodes</span><span class="p">(),</span> <span class="n">node_labels</span><span class="p">)}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gene_group_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">g</span><span class="p">:</span><span class="nb">str</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="k">for</span> <span class="n">g</span><span class="p">,</span> <span class="n">c</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">nxg</span><span class="o">.</span><span class="n">nodes</span><span class="p">(),</span> <span class="n">node_labels</span><span class="p">)}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">grn</span><span class="o">.</span><span class="n">visualize_local_neighborhood</span><span class="p">(</span>
<span class="gp">&gt;&gt;&gt; </span> <span class="s1">&#39;HIST1H1D&#39;</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span> <span class="n">node_color_dict</span><span class="o">=</span><span class="n">gene_group_dict</span>
<span class="gp">&gt;&gt;&gt; </span> <span class="s1">&#39;HIST1H1D&#39;</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span> <span class="n">node_group_dict</span><span class="o">=</span><span class="n">gene_group_dict</span>
<span class="gp">&gt;&gt;&gt; </span> <span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">show</span><span class="p">(</span><span class="s1">&#39;view.html&#39;</span><span class="p">)</span>
</pre></div>
Expand Down
Loading

0 comments on commit cde0f4a

Please sign in to comment.