Skip to content

Commit

Permalink
WGCNA.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
yeroslaviz committed Nov 28, 2024
1 parent 8e9bc21 commit c47dbd6
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 76 deletions.
12 changes: 8 additions & 4 deletions WGCNA.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ This package is provided through the R-language integration into Perseus and the
* Check that R is installed correctly by opening `cmd.exe` from the start menu and entering `R` An R session should start.
* Inside the running R session, install the [WGCNA](https://cran.r-project.org/web/packages/WGCNA/index.html) and [PerseusR](https://github.com/jdrudolph/PerseusR) libraries by entering/pasting the following code **line-by-line**.
When prompted for local install, type ‘yes’ twice and select a close-by server for the package download.
```{r}
# | eval: false

```
install.packages("BiocManager")
BiocManager::install(c("WGCNA", "devtools"))
library(devtools)
install_github('jdrudolph/PerseusR')
```
* You should now be able to load the `WGCNA` and `PerseusR` libraries by entering the following code. Upon loading, `WGCNA` will print some output, while `PerseusR` will not print any.
```{r}
# | eval: false

```
library(WGCNA)
library(PerseusR)
```

You are now ready to perform co-expression analysis from within Perseus.
Expand Down
185 changes: 114 additions & 71 deletions docs/WGCNA.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.315">
<meta name="generator" content="quarto-1.5.57">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

<meta name="author" content="Cox Lab">
<meta name="dcterms.date" content="2023-11-15">
<meta name="dcterms.date" content="2024-11-28">

<title>WGCNA</title>
<style>
Expand All @@ -22,40 +22,6 @@
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


Expand All @@ -81,12 +47,13 @@
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 20,
"limit": 50,
"keyboard-shortcut": [
"f",
"/",
"s"
],
"show-item-context": false,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
Expand All @@ -95,6 +62,7 @@
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit",
"search-label": "Search"
Expand All @@ -109,15 +77,15 @@

<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark ">
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
<div class="navbar-container container-fluid">
<div class="navbar-brand-container mx-auto">
<a href="./index.html" class="navbar-brand navbar-brand-logo">
<img src="./Figures/coxlab_logo2.png" alt="" class="navbar-logo">
</a>
</div>
<div id="quarto-search" class="" title="Search"></div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
Expand Down Expand Up @@ -162,7 +130,7 @@
</li>
</ul>
</div> <!-- /navcollapse -->
<div class="quarto-navbar-tools">
<div class="quarto-navbar-tools">
</div>
</div> <!-- /container-fluid -->
</nav>
Expand Down Expand Up @@ -204,7 +172,7 @@ <h1 class="title">WGCNA</h1>
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">November 15, 2023</p>
<p class="date">November 28, 2024</p>
</div>
</div>

Expand All @@ -215,6 +183,7 @@ <h1 class="title">WGCNA</h1>

</header>


<section id="weighted-gene-co-expression-network-analysis" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="weighted-gene-co-expression-network-analysis"><span class="header-section-number">1</span> Weighted Gene Co-expression Network Analysis</h2>
<p>This package is provided through the R-language integration into Perseus and therefore requires R as well as the package itself to be installed in order to be used. Visit the <a href="https://github.com/jdrudolph/PluginInterop">PluginInterop</a> and <a href="https://github.com/jdrudolph/PerseusR">PerseusR</a> for additional technical information on the integration of R and Perseus.</p>
Expand All @@ -231,21 +200,19 @@ <h2 data-number="2" class="anchored" data-anchor-id="installation"><span class="
<li>Check that R is installed correctly by opening <code>cmd.exe</code> from the start menu and entering <code>R</code> An R session should start.</li>
<li>Inside the running R session, install the <a href="https://cran.r-project.org/web/packages/WGCNA/index.html">WGCNA</a> and <a href="https://github.com/jdrudolph/PerseusR">PerseusR</a> libraries by entering/pasting the following code <strong>line-by-line</strong>. When prompted for local install, type ‘yes’ twice and select a close-by server for the package download.</li>
</ul>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># | eval: false</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">install.packages</span>(<span class="st">"BiocManager"</span>)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>BiocManager<span class="sc">::</span><span class="fu">install</span>(<span class="fu">c</span>(<span class="st">"WGCNA"</span>, <span class="st">"devtools"</span>))</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(devtools)</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="fu">install_github</span>(<span class="st">'jdrudolph/PerseusR'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<pre><code>
install.packages("BiocManager")
BiocManager::install(c("WGCNA", "devtools"))
library(devtools)
install_github('jdrudolph/PerseusR')
</code></pre>
<ul>
<li>You should now be able to load the <code>WGCNA</code> and <code>PerseusR</code> libraries by entering the following code. Upon loading, <code>WGCNA</code> will print some output, while <code>PerseusR</code> will not print any.</li>
</ul>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># | eval: false</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(WGCNA)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(PerseusR)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<pre><code>
library(WGCNA)
library(PerseusR)
</code></pre>
<p>You are now ready to perform co-expression analysis from within Perseus.</p>
</section>
<section id="wgcna-functions" class="level2" data-number="3">
Expand Down Expand Up @@ -294,18 +261,7 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
}
return false;
}
const clipboard = new window.ClipboardJS('.code-copy-button', {
text: function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
});
clipboard.on('success', function(e) {
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
Expand Down Expand Up @@ -337,7 +293,47 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
// For code content inside modals, clipBoardJS needs to be initialized with a container option
// TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860)
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// undo the damage that might have been done by quarto-nav.js in the case of
// links that we want to consider external
if (link.dataset.originalHref !== undefined) {
link.href = link.dataset.originalHref;
}
}
}
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
Expand Down Expand Up @@ -372,7 +368,11 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
if (note) {
return note.innerHTML;
} else {
return "";
}
});
}
const xrefs = window.document.querySelectorAll('a.quarto-xref');
Expand All @@ -387,15 +387,28 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
}
}
stripColumnClz(note)
if (id.startsWith('sec-')) {
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
for (let i = 0; i < 2; i++) {
container.appendChild(note.children[i].cloneNode(true));
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
Expand All @@ -404,7 +417,15 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
if (anchorLink) {
anchorLink.remove();
}
return note.innerHTML;
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
// TODO in 1.5, we should make sure this works without a callout special case
if (note.classList.contains("callout")) {
return note.outerHTML;
} else {
return note.innerHTML;
}
}
}
for (var i=0; i<xrefs.length; i++) {
Expand Down Expand Up @@ -446,6 +467,29 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
instance.show();
});
}
} else {
// See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.querySelector('main.content');
if (note !== null) {
// This should only happen for chapter cross references
// (since there is no id in the URL)
// remove the first header
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
note.children[0].remove();
}
const html = processXRef(null, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
}, function(instance) {
});
Expand Down Expand Up @@ -521,7 +565,6 @@ <h2 data-number="3" class="anchored" data-anchor-id="wgcna-functions"><span clas
window.addEventListener(
"resize",
throttle(() => {
console.log("RESIZE");
elRect = undefined;
if (selectedAnnoteEl) {
selectCodeLines(selectedAnnoteEl);
Expand Down
3 changes: 2 additions & 1 deletion docs/ngsupload.html
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ <h1 data-number="7"><span class="header-section-number">7</span> Comparison with
has_icon = TRUE,
icon = "fa fa-save",
self_contained = FALSE
)</code></pre>
)
</code></pre>
<!-- ==== Parameters specific for "Chromatin IP" experiment ====
The most popular way to deal with Chromatin IP experiment is sequence relatively small part of a read - enough for unique alignment - and already in silico extend such read until expected length.
{{ :user:activities:matrixupload:chipseqextend.png?500 |}}
Expand Down
1 change: 1 addition & 0 deletions ngsupload.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ download_file(
icon = "fa fa-save",
self_contained = FALSE
)
```


Expand Down

0 comments on commit c47dbd6

Please sign in to comment.