Commit 4360a543 authored by smorabit's avatar smorabit
Browse files

network vis vignette

parent 48aa9266
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -165,6 +165,21 @@
<p>As in the previous network plot, each node represents a gene and each edge represents a co-expression relationship. In this network, we color intramodular edges with the module’s color, and intermodular edges gray. The opacity of edges in this network is scaled by the strength of the co-expression relationship. Additional network layout settings can be passed to the <a href="https://www.rdocumentation.org/packages/igraph/versions/1.2.11/topics/layout_with_fr" class="external-link"><code>layout_with_fr</code></a> function in igraph. The user can also specify <code>return_graph = TRUE</code> to return the igraph object to plot using their own custom code.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">g</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/HubGeneNetworkPlot.html">HubGeneNetworkPlot</a></span><span class="op">(</span><span class="va">seurat_obj</span>,  return_graph<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></code></pre></div>
</div>
<div class="section level2">
<h2 id="moduleumapplot">
<code>ModuleUMAPPlot</code><a class="anchor" aria-label="anchor" href="#moduleumapplot"></a>
</h2>
<p>Previously we visualized a subset of the co-expression network with an emphasis on the hub genes. Here, we use an alternative approach to visualize all genes in the co-expression network simultaneously. <a href="https://arxiv.org/abs/1802.03426" class="external-link">UMAP</a> is a suitable method for visualizing high-dimensional data in two dimensions.</p>
<p>scWGCNA includes the function <code>RunModuleUMAP</code> to run the UMAP algorithm on the scWGCNA <a href="https://doi.org/10.1186/1471-2105-8-22" class="external-link">topological overlap matrix (TOM)</a>. For the UMAP analysis, we subset the columns in the TOM to only contain the top <em>n</em> hub genes by kME for each module, as specified by the user. Therefore, the organization of each gene in UMAP space is dependent on that gene’s connectivity with the network’s hub genes.</p>
<p>The following code demonstrates using the <code>RunModuleUMAP</code> function with 10 hub genes per module:</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">seurat_obj</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/RunModuleUMAP.html">RunModuleUMAP</a></span><span class="op">(</span>
  <span class="va">seurat_obj</span>,
  n_hubs <span class="op">=</span> <span class="fl">10</span>, <span class="co"># number of hub genes to include for the UMAP embedding</span>
  n_neighbors<span class="op">=</span><span class="fl">15</span>, <span class="co"># neighbors parameter for UMAP</span>
  min_dist<span class="op">=</span><span class="fl">0.1</span> <span class="co"># min distance between points in UMAP space</span>
<span class="op">)</span></code></pre></div>
</div>
  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside>
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ articles:
  motif_analysis: motif_analysis.html
  network_visualizations: network_visualizations.html
  projecting_modules: projecting_modules.html
last_built: 2022-02-12T20:54Z
last_built: 2022-02-12T21:08Z
urls:
  reference: https://smorabit.github.io/scWGCNA/reference
  article: https://smorabit.github.io/scWGCNA/articles
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     out</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7fe6ccbaea58&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7f8935133d28&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: namespace:scWGCNA&gt;</span>
</code></pre></div>
    </div>
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ using Seurat's DoHeatmap, and then assembles them all into one big heatmap.</p>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     out</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7fe6cc6ab290&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7f89358688a0&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: namespace:scWGCNA&gt;</span>
</code></pre></div>
    </div>
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@
<span class="r-out co"><span class="r-pr">#&gt;</span>         dev.off()</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7fe6cc482ae8&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x7f89343a5808&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: namespace:scWGCNA&gt;</span>
</code></pre></div>
    </div>
Loading