<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Sam&#39;s Notebook</title>
<link>https://robertslab.github.io/sams-notebook/</link>
<atom:link href="https://robertslab.github.io/sams-notebook/index.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.6.42</generator>
<lastBuildDate>Wed, 15 Apr 2026 07:00:00 GMT</lastBuildDate>
<item>
  <title>Resazurin Assays - USDA M.gigas Families in Response to Temperature Stress</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Quick notebook post to review the resazurin assay data from the USDA M.gigas families in response to temperature stress. This is a work in progress, but I wanted to share some preliminary findings and visualizations. Notebook will be updated later with more details on the methods and results.</p>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<section id="plots" class="level2">
<h2 class="anchored" data-anchor-id="plots">Plots</h2>
<section id="normalized-fluorescence-over-time---line-plots" class="level3">
<h3 class="anchored" data-anchor-id="normalized-fluorescence-over-time---line-plots">Normalized Fluorescence Over Time - Line Plots</h3>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_by_family-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence by family over time.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-1-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 1.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-2-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 2.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-3-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 3.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-5-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 5.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-6-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 6.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-7-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 7.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-8-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 8.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-9-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 9.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-mean_fluorescence_fam-10-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Mean normalized fluorescence over time for Family 10.</figcaption>
</figure>
</div>
</section>
<section id="normalized-fluorescence-over-time---box-plots" class="level3">
<h3 class="anchored" data-anchor-id="normalized-fluorescence-over-time---box-plots">Normalized Fluorescence Over Time - Box Plots</h3>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_by_family-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence by family.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-1-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 1.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-2-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 2.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-3-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 3.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-5-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 5.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-6-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 6.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-7-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 7.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-8-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 8.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-9-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 9.</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-box_plots-fluorescence_fam-10-normalized.png" class="img-fluid figure-img"></p>
<figcaption>Normalized fluorescence for Family 10.</figcaption>
</figure>
</div>
</section>
<section id="delta-fluorescence-raw-over-time" class="level3">
<h3 class="anchored" data-anchor-id="delta-fluorescence-raw-over-time">Delta Fluorescence (Raw) Over Time</h3>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_mean_fluorescence_by_family-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta mean fluorescence by family over time (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-1-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 1 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-2-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 2 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-3-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 3 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-5-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 5 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-6-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 6 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-7-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 7 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-8-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 8 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-9-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 9 (raw).</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/plot-line_plots-delta_fluorescence_fam-10-raw.png" class="img-fluid figure-img"></p>
<figcaption>Delta fluorescence over time for Family 10 (raw).</figcaption>
</figure>
</div>


</section>
</section>
</section>

 ]]></description>
  <category>2026</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-15-Resazurin-Assays---USDA-M.gigas-Families-in-Response-to-Temperature-Stress/</guid>
  <pubDate>Wed, 15 Apr 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Samples Submitted - Geoduck Gonad Histology</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-14-Samples-Submitted---Geoduck-Gonad-Histology/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Submitted 10 geoduck gonad samples for histological processing. These samples were collected in lab on 20260401 by Steven and people from Washington Fish &amp; Wildlife. Gonad tissue was sample, placed in histology cassettes, and fixed in 10% formalin in filtered seawater for 24hrs. After fixation, samples were transferred to 70% ethanol for storage until processing.</p>
<p>Cassettes were submitted to the University of Washington Pathology Research Services Laboratory in Health Sciences Building C411 for processing and histological sectioning. The lab will embed the samples in paraffin, section them, and stain with hematoxylin and eosin (H&amp;E) for microscopic examination. The goal of this histological analysis is to assess the reproductive status and gonadal development of the geoducks, which will provide insights into their reproductive biology and potential impacts of environmental factors on their reproduction.</p>
<p>Here’s the list of samples submitted:</p>
<ul>
<li>4-M-IN</li>
<li>3-M-X</li>
<li>4-A-X</li>
<li>2-A-X</li>
<li>1-A-X</li>
<li>2-P-IN</li>
<li>4-P-IN</li>
<li>3-M-IN</li>
<li>1-P-IN</li>
<li>3-P-IN</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-14-Samples-Submitted---Geoduck-Gonad-Histology/20260414-pgen-histo-submission.jpg" class="img-fluid figure-img"></p>
<figcaption>Sample submission on lab bench.</figcaption>
</figure>
</div>


</section>

 ]]></description>
  <category>2026</category>
  <category>Pacific geoduck</category>
  <category>Panopea generosa</category>
  <category>histology</category>
  <category>gonad</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-14-Samples-Submitted---Geoduck-Gonad-Histology/</guid>
  <pubDate>Tue, 14 Apr 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Genome Comparisons - Lake Trout PacBio Assemblies Flye vs hifiasm Using QUAST</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-10-Genome-Comparisons---Lake-Trout-PacBio-Assemblies-Flye-vs-hifiasm-Using-QUAST/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>I previously assembled the Lake Trout <a href="https://github.com/RobertsLab/resources/issues/2409">genomes for the lean and siscowet ecotypes using both Flye and hifiasm with PacBio data</a> (GitHub Issue). I wanted to compare the two assemblies to see which one was better. I used <a href="https://quast.sourceforge.net/docs/manual.html">QUAST</a> to compare the assemblies for some basic stats.</p>
<p>Notebook links to assemblies:</p>
<ul>
<li><p><a href="../../../posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/index.html">Flye - Lean Ecotype</a></p></li>
<li><p><a href="../../../posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/index.html">Flye - Siscowet Ecotype</a></p></li>
<li><p><a href="../../../posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/index.html">hifiasm - Lean Ecotype</a></p></li>
<li><p><a href="../../../posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/index.html">hifiasm - Siscowet Ecotype</a></p></li>
</ul>
<p>Below is the rendered markdown from <code>13.2-genome-assembly-comparisons.Rmd</code>.</p>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>This will use <a href="https://quast.sourceforge.net/docs/manual.html">QUAST</a> (Mikheenko et al.&nbsp;2018, 2023) to evaluate the two sets of PacBio genome assemblies produced with <a href="https://github.com/mikolmogorov/Flye">Flye</a>(GitHub) and <a href="https://github.com/chhylp123/hifiasm">hifiasm</a> (GitHub) for both ecotypes.</p>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries" class="level2">
<h2 class="anchored" data-anchor-id="libraries">2.1 Libraries</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tidyverse)</span></code></pre></div>
<pre><code>## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.4     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (&lt;http://conflicted.r-lib.org/&gt;) to force all conflicts to become errors</code></pre>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reticulate)</span>
<span id="cb3-2"></span>
<span id="cb3-3">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">results =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hold"</span>,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hold outputs and show them after the full code chunk</span></span>
<span id="cb3-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb3-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Keep code and output in separate blocks</span></span>
<span id="cb3-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb3-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb3-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"##"</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prefix output lines with '##' so output is visually distinct</span></span>
<span id="cb3-12">)</span></code></pre></div>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">2.2 Set R variables</h2>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTPUT DIRECTORY</span></span>
<span id="cb4-2">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.2-genome-assembly-comparisons"</span></span>
<span id="cb4-3"></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># INPUT FILES</span></span>
<span id="cb4-5">flye_lean_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta"</span></span>
<span id="cb4-6">flye_siscowet_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta"</span></span>
<span id="cb4-7">hifiasm_lean_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa"</span></span>
<span id="cb4-8">hifiasm_siscowet_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa"</span></span>
<span id="cb4-9"></span>
<span id="cb4-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SETTINGS</span></span>
<span id="cb4-11">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"40"</span></span>
<span id="cb4-12"></span>
<span id="cb4-13"></span>
<span id="cb4-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb4-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb4-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">flye_lean_fasta =</span> flye_lean_fasta,</span>
<span id="cb4-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">flye_siscowet_fasta =</span> flye_siscowet_fasta,</span>
<span id="cb4-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hifiasm_lean_fasta =</span> hifiasm_lean_fasta,</span>
<span id="cb4-19">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hifiasm_siscowet_fasta =</span> hifiasm_siscowet_fasta,</span>
<span id="cb4-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb4-21">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads</span>
<span id="cb4-22">)</span></code></pre></div>
</section>
</section>
<section id="run-quast" class="level1">
<h1>3 Run QUAST</h1>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directory, if it doesn't exist</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-3"></span>
<span id="cb5-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">quast.py</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${flye_lean_fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${hifiasm_lean_fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${flye_siscowet_fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${hifiasm_siscowet_fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-9">--output-dir <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-10">--threads <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-11">--labels <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lean_flye, lean_hifiasm, siscowet_flye, siscowet_hifiasm"</span></span></code></pre></div>
<pre><code>## /srlab/programs/miniforge3-24.7.1-0/bin/quast.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
##   __import__('pkg_resources').run_script('quast==5.3.0', 'quast.py')
## /srlab/programs/miniforge3-24.7.1-0/lib/python3.12/site-packages/quast-5.3.0-py3.12.egg/EGG-INFO/scripts/quast.py ../output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta ../output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa ../output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta ../output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa --output-dir ../output/13.2-genome-assembly-comparisons --threads 40 --labels lean_flye, lean_hifiasm, siscowet_flye, siscowet_hifiasm
## 
## Version: 5.3.0
## 
## System information:
##   OS: Linux-4.18.0-513.18.1.el8_9.x86_64-x86_64-with-glibc2.39 (linux_64)
##   Python version: 3.12.5
##   CPUs number: 192
## 
## Started: 2026-04-10 12:49:08
## 
## Logging to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/quast.log
## 
## CWD: /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/code
## Main parameters: 
##   MODE: default, threads: 40, min contig length: 500, min alignment length: 65, min alignment IDY: 95.0, \
##   ambiguity: one, min local misassembly length: 200, min extensive misassembly length: 1000
## 
## WARNING: Can't draw plots: python-matplotlib is missing or corrupted.
## 
## Contigs:
##   Pre-processing...
##   1  ../output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta ==&gt; lean_flye
##   2  ../output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa ==&gt; lean_hifiasm
##   3  ../output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta ==&gt; siscowet_flye
##   4  ../output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa ==&gt; siscowet_hifiasm
## 
## 2026-04-10 12:51:06
## Running Basic statistics processor...
##   Contig files: 
##     1  lean_flye
##     2  lean_hifiasm
##     3  siscowet_flye
##     4  siscowet_hifiasm
##   Calculating N50 and L50...
##     1  lean_flye, N50 = 74514, L50 = 10897, auN = 172736.7, Total length = 4046355081, GC % = 42.89, # N's per 100 kbp =  0.00
##     2  lean_hifiasm, N50 = 325701, L50 = 2542, auN = 608980.5, Total length = 3733314870, GC % = 42.57, # N's per 100 kbp =  0.00
##     3  siscowet_flye, N50 = 78564, L50 = 10934, auN = 189833.9, Total length = 4336770215, GC % = 43.17, # N's per 100 kbp =  0.00
##     4  siscowet_hifiasm, N50 = 514031, L50 = 1844, auN = 874464.1, Total length = 4008351139, GC % = 42.84, # N's per 100 kbp =  0.00
## Done.
## 
## NOTICE: Genes are not predicted by default. Use --gene-finding or --glimmer option to enable it.
## 
## 2026-04-10 12:56:51
## Creating large visual summaries...
## This may take a while: press Ctrl-C to skip this step..
##   1 of 1: Creating Icarus viewers...
## Done
## 
## 2026-04-10 12:58:19
## RESULTS:
##   Text versions of total report are saved to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/report.txt, report.tsv, and report.tex
##   Text versions of transposed total report are saved to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/transposed_report.txt, transposed_report.tsv, and transposed_report.tex
##   HTML version (interactive tables and plots) is saved to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/report.html
##   Icarus (contig browser) is saved to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/icarus.html
##   Log is saved to /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.2-genome-assembly-comparisons/quast.log
## 
## Finished: 2026-04-10 12:58:19
## Elapsed time: 0:09:10.519647
## NOTICEs: 1; WARNINGs: 1; non-fatal ERRORs: 0
## 
## Thank you for using QUAST!</code></pre>
<hr>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<p>All output files are here:</p>
<ul>
<li><a href="https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.2-genome-assembly-comparisons/">https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.2-genome-assembly-comparisons/</a></li>
</ul>
<p>QUAST Report (HTML):</p>
<ul>
<li><a href="https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.2-genome-assembly-comparisons/report.html">13.2-genome-assembly-comparisons/report.html</a></li>
</ul>
<table class="caption-top table">
<colgroup>
<col style="width: 31%">
<col style="width: 15%">
<col style="width: 15%">
<col style="width: 16%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Assembly</th>
<th>lean_flye</th>
<th>lean_hifiasm</th>
<th>siscowet_flye</th>
<th>siscowet_hifiasm</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td># contigs (&gt;= 0 bp)</td>
<td>112562</td>
<td>33035</td>
<td>110158</td>
<td>24184</td>
</tr>
<tr class="even">
<td># contigs (&gt;= 1000 bp)</td>
<td>112160</td>
<td>33035</td>
<td>109812</td>
<td>24184</td>
</tr>
<tr class="odd">
<td># contigs (&gt;= 5000 bp)</td>
<td>106095</td>
<td>33002</td>
<td>104705</td>
<td>24177</td>
</tr>
<tr class="even">
<td># contigs (&gt;= 10000 bp)</td>
<td>81886</td>
<td>31353</td>
<td>84765</td>
<td>23609</td>
</tr>
<tr class="odd">
<td># contigs (&gt;= 25000 bp)</td>
<td>37973</td>
<td>21447</td>
<td>41932</td>
<td>17566</td>
</tr>
<tr class="even">
<td># contigs (&gt;= 50000 bp)</td>
<td>17083</td>
<td>13735</td>
<td>18607</td>
<td>12107</td>
</tr>
<tr class="odd">
<td>Total length (&gt;= 0 bp)</td>
<td>4046369763</td>
<td>3733314870</td>
<td>4336778941</td>
<td>4008351139</td>
</tr>
<tr class="even">
<td>Total length (&gt;= 1000 bp)</td>
<td>4046083421</td>
<td>3733314870</td>
<td>4336539268</td>
<td>4008351139</td>
</tr>
<tr class="odd">
<td>Total length (&gt;= 5000 bp)</td>
<td>4023676535</td>
<td>3733170075</td>
<td>4318011635</td>
<td>4008320038</td>
</tr>
<tr class="even">
<td>Total length (&gt;= 10000 bp)</td>
<td>3840245419</td>
<td>3719588210</td>
<td>4166152008</td>
<td>4003479664</td>
</tr>
<tr class="odd">
<td>Total length (&gt;= 25000 bp)</td>
<td>3119711632</td>
<td>3550261715</td>
<td>3452967778</td>
<td>3897289116</td>
</tr>
<tr class="even">
<td>Total length (&gt;= 50000 bp)</td>
<td>2400080225</td>
<td>3275969678</td>
<td>2647693108</td>
<td>3704640383</td>
</tr>
<tr class="odd">
<td># contigs</td>
<td><strong>112527</strong></td>
<td>33035</td>
<td><strong>110135</strong></td>
<td>24184</td>
</tr>
<tr class="even">
<td>Largest contig</td>
<td>2170611</td>
<td><strong>5276269</strong></td>
<td>2753427</td>
<td><strong>8967193</strong></td>
</tr>
<tr class="odd">
<td>Total length</td>
<td><strong>4046355081</strong></td>
<td>3733314870</td>
<td><strong>4336770215</strong></td>
<td>4008351139</td>
</tr>
<tr class="even">
<td>GC (%)</td>
<td>42.89</td>
<td>42.57</td>
<td>43.17</td>
<td>42.84</td>
</tr>
<tr class="odd">
<td>N50</td>
<td>74514</td>
<td><strong>325701</strong></td>
<td>78564</td>
<td><strong>514031</strong></td>
</tr>
<tr class="even">
<td>N90</td>
<td>14295</td>
<td>41727</td>
<td>15962</td>
<td>65625</td>
</tr>
<tr class="odd">
<td>auN</td>
<td>172736.7</td>
<td>608980.5</td>
<td>189833.9</td>
<td>874464.1</td>
</tr>
<tr class="even">
<td>L50</td>
<td>10897</td>
<td>2542</td>
<td>10934</td>
<td>1844</td>
</tr>
<tr class="odd">
<td>L90</td>
<td>65455</td>
<td>15577</td>
<td>64363</td>
<td>10408</td>
</tr>
<tr class="even">
<td># N’s per 100 kbp</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-10-Genome-Comparisons---Lake-Trout-PacBio-Assemblies-Flye-vs-hifiasm-Using-QUAST/20260410-quast-stats-table.png" class="img-fluid figure-img"></p>
<figcaption>QUAST Report</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-04-10-Genome-Comparisons---Lake-Trout-PacBio-Assemblies-Flye-vs-hifiasm-Using-QUAST/20260410-quast-genome-size-plots.png" class="img-fluid figure-img"></p>
<figcaption>QUAST Genome Size Plots</figcaption>
</figure>
</div>
</section>
<section id="discussion" class="level1">
<h1>DISCUSSION</h1>
<p>In general, it appears that the hifiasm assemblies are better than the flye assemblies, with higher N50 and larger contigs. However, the Flye assemblies have a higher total length (~7% more).</p>
</section>
<section id="references" class="level1">
<h1>REFERENCES</h1>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-mikheenko2018" class="csl-entry">
Mikheenko, Alla, Andrey Prjibelski, Vladislav Saveliev, Dmitry Antipov, and Alexey Gurevich. 2018. “Versatile Genome Assembly Evaluation with QUAST-LG.” <em>Bioinformatics</em> 34 (13): i142–50. <a href="https://doi.org/10.1093/bioinformatics/bty266" class="uri">https://doi.org/10.1093/bioinformatics/bty266</a>.
</div>
<div id="ref-mikheenko2023" class="csl-entry">
Mikheenko, Alla, Vladislav Saveliev, Pascal Hirsch, and Alexey Gurevich. 2023. “WebQUAST: Online Evaluation of Genome Assemblies.” <em>Nucleic Acids Research</em> 51 (W1): W601–6. <a href="https://doi.org/10.1093/nar/gkad406" class="uri">https://doi.org/10.1093/nar/gkad406</a>.
</div>
</div>


</section>

 ]]></description>
  <category>2026</category>
  <category>QUAST</category>
  <category>flye</category>
  <category>hifiasm</category>
  <category>lake trout</category>
  <category>genome assembly</category>
  <category>PacBio</category>
  <category>Salvelinus namaycush</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-10-Genome-Comparisons---Lake-Trout-PacBio-Assemblies-Flye-vs-hifiasm-Using-QUAST/</guid>
  <pubDate>Fri, 10 Apr 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Resazurin Assays - Selected Juvenile Ruditapes philippinarum Exposed to 36C Acute Heat Stress Day 1</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-01-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-1/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>This is the second day of a two day experiment. Day 0 corresponds to the first day of measurements, and Day 1 corresponds to the second day of measurements. The same clams were measured on both days. Day 0 notebook entry is available here:</p>
<ul>
<li><a href="../../../posts/2026/2026-03-31-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-0/index.html">Day 0 Notebook Entry</a></li>
</ul>
</section>
<section id="materials-methods" class="level1">
<h1>MATERIALS &amp; METHODS</h1>
<p>Control clams (<code>C</code>) compared with selected clams (<code>S</code>) at 36<sup>o</sup>C.</p>
<p>Clams were processed in 12-well plates and submerged in <code>5.0mL</code> of resazurin working solution prepared today.</p>
<ul>
<li>986.66 mL filtered seawater (4<sup>o</sup>C filtered sea water from 11/19/2025 by AH)</li>
<li>2.22 mL resazurin stock solution (from step 1 above)</li>
<li>1.00 mL DMSO</li>
<li>10.00 mL antibiotic solution (100x Penn/Strep &amp; 100x Fungizone)</li>
</ul>
<p>Plates were measured every 30mins on a Synergy HTX (Agilent) plate reader over the course of 4hrs.</p>
<p>Plate layout was randomized; Steven is currently the only person who knows the treatment assignments.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>Low volumes were noted in the following plates/wells, which may have been due to clam spitting:</p>
<p>DA1 BA3 DB2 EC2</p>
</div>
</div>
<section id="plate-temps" class="level2">
<h2 class="anchored" data-anchor-id="plate-temps">Plate temps</h2>
<p>Wells were spot checked and range noted in table below.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>PLATE</th>
<th>TIME</th>
<th>TEMP</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>A</td>
<td>0</td>
<td>11-12</td>
</tr>
<tr class="even">
<td>A</td>
<td>1</td>
<td>29</td>
</tr>
<tr class="odd">
<td>A</td>
<td>2</td>
<td>31</td>
</tr>
<tr class="even">
<td>A</td>
<td>3</td>
<td>32-33</td>
</tr>
<tr class="odd">
<td>A</td>
<td>4</td>
<td>33-34</td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<p>Data are available here:</p>
<ul>
<li><a href="https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260401-clam-Day2-36C-C-vs-S">https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260401-clam-Day2-36C-C-vs-S</a></li>
</ul>
<p>At the time of this writing, there is no plate layout file available for this experiment, so it’s not possible to determine which wells correspond to which clams. Steven is working on creating a plate layout file, which will be added to the GitHub repository when it’s available.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>resazurin</category>
  <category>Ruditapes philippinarum</category>
  <category>Manila clam</category>
  <category>Synergy HTX</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-01-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-1/</guid>
  <pubDate>Wed, 01 Apr 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Resazurin Assays - Selected Juvenile Ruditapes philippinarum Exposed to 36C Acute Heat Stress</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-01-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Steven asked me to perform resazurin assays on “selected” juvenile <em>Ruditapes philippinarum</em> (Manila clam) exposed to 36<sup>o</sup>C acute heat stress. The goal of the experiment is to compare metabolic activity between the “selected” clams and control clams when exposed to heat stress. This is similar to the previous experiment at 36<sup>o</sup>C <a href="../../../posts/2026/2026-03-31-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-0/index.html">Day 0 Notebook Entry</a> and <a href="../../../posts/2026/2026-04-01-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-1/index.html">Day 1 Notebook Entry</a>, but with a set of larger clams.</p>
</section>
<section id="materials-methods" class="level1">
<h1>MATERIALS &amp; METHODS</h1>
<p>Clams were processed in 12-well plates and submerged in <code>5.0mL</code> of resazurin working solution stored at 4<sup>o</sup>C,prepared on <a href="../../../posts/2026/2026-03-30-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-40C-Acute-Heat-Stress/index.html">20260330</a> (notebook entry).</p>
<p>Plates were measured every 30mins on a Synergy HTX (Agilent) plate reader.</p>
<p>Plate layout was randomized; Steven is currently the only person who knows the treatment assignments.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>The following wells lost volume - possibly due to clam spitting?</p>
<ul>
<li>GA3</li>
<li>JB1</li>
<li>KA2</li>
<li>LA4</li>
</ul>
</div>
</div>
<section id="plate-temps" class="level2">
<h2 class="anchored" data-anchor-id="plate-temps">Plate Temps</h2>
<p>Wells were spot checked and range noted in table below.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>PLATE</th>
<th>TIME</th>
<th>TEMP</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>G</td>
<td>0</td>
<td>11-12</td>
</tr>
<tr class="even">
<td>G</td>
<td>0.5</td>
<td>14-16</td>
</tr>
<tr class="odd">
<td>G</td>
<td>1</td>
<td>24-30</td>
</tr>
<tr class="even">
<td>G</td>
<td>1.5</td>
<td>27-30</td>
</tr>
<tr class="odd">
<td>G</td>
<td>2</td>
<td>31-32</td>
</tr>
<tr class="even">
<td>G</td>
<td>2.5</td>
<td>31-32</td>
</tr>
<tr class="odd">
<td>G</td>
<td>3</td>
<td>31-32</td>
</tr>
<tr class="even">
<td>G</td>
<td>3.5</td>
<td>31-32</td>
</tr>
<tr class="odd">
<td>G</td>
<td>4</td>
<td>33</td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<p>Data are available here:</p>
<ul>
<li><a href="https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260401-clam-36C-C-vs-S">https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260401-clam-36C-C-vs-S</a></li>
</ul>
<p>At the time of this writing, there is no plate layout file available for this experiment, so it’s not possible to determine which wells correspond to which clams. Steven is working on creating a plate layout file, which will be added to the GitHub repository when it’s available.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>resazurin</category>
  <category>Ruditapes philippinarum</category>
  <category>Manila clam</category>
  <category>Synergy HTX</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-04-01-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress/</guid>
  <pubDate>Wed, 01 Apr 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Genome Assembly - S.namaycush Lean Ecotype with PacBio HiFi Reads Using hifiasm on Hyak</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>As part of <a href="https://github.com/RobertsLab/project-lake-trout"><code>project-lake-trout</code></a> (GitHub repo), Steven <a href="https://github.com/RobertsLab/resources/issues/2409">asked that I assemble the genome of a lean ecotype of lake trout</a> (GitHub Issue), <em>Salvelinus namaycush</em>, using PacBio HiFi reads. I previously assembled this genome <a href="../2023/2023-03-26-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/index.qmd">using Flye, on 20230326</a> (notebook entry), but <a href="https://github.com/RobertsLab/resources/issues/2409#issuecomment-4150948212">Steven asked me to also try hifiasm</a> (GitHub Issue)for the assembly.</p>
<p>I performed the assembly on Hyak (Klone), UW’s high-performance computing cluster. I used our Apptainer (Singularity) container to run the job (<code>srlab-R4.4-bioinformatics-container-e5bcfea.sif</code>), which includes hifiasm version 0.25.0.</p>
<p>Below is the rendered markdown from <code>13.1-hifiasm-genome-assembly-lean.Rmd</code>. The run was <em>very</em> fast; it only took a day and half, vs the ~7 days for the Flye assembly.</p>
</section>
<section id="primary-outputs" class="level1">
<h1>PRIMARY OUTPUTS</h1>
<p>hifiasm produces three assemblies: a primary assembly, and two haplotype-resolved assemblies. Below are the links to the FastA files. The outputs are only GFA graph files. I had to convert them to FastA using <a href="https://github.com/lh3/gfatools">gfatools</a>.</p>
<section id="primary-assembly" class="level2">
<h2 class="anchored" data-anchor-id="primary-assembly">Primary assembly:</h2>
<ul>
<li><p>FastA (3.5GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-assembly.fa.fai</p></li>
</ul>
</section>
<section id="haplotype-1" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-1">Haplotype 1:</h2>
<ul>
<li><p>FastA (3.2GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap1-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap1-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap1-assembly.fa.fai</p></li>
</ul>
</section>
<section id="haplotype-2" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-2">Haplotype 2:</h2>
<ul>
<li><p>FastA (2.7GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap2-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap2-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/pb-hifiasm-lean-hap2-assembly.fa.fai</p></li>
</ul>
<p>After this, I’ll compare the two assemblies (Flye vs.&nbsp;hifiasm) using <a href="https://github.com/ablab/quast">QUAST</a>, which will provide a more comprehensive set of assembly statistics and metrics.</p>
<hr>
</section>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>Use <a href="https://github.com/chhylp123/hifiasm">hifiasm</a> (GitHub) (Cheng et al.&nbsp;2021, 2022, 2024) to assemble PacBio reads for <em>S.namaycush</em> <code>lean</code> ecotype.</p>
<p>Due to large file sizes, the outputs will not be on GitHub. They may be found here instead:</p>
<ul>
<li><a href="https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/" class="uri">https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-lean/</a></li>
</ul>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries" class="level2">
<h2 class="anchored" data-anchor-id="libraries">2.1 Libraries</h2>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">2.2 Set R variables</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTPUT DIRECTORY</span></span>
<span id="cb1-2">data_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/data/pacbio-lean"</span></span>
<span id="cb1-3">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-hifiasm-genome-assembly-lean"</span></span>
<span id="cb1-4"></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROGRAMS</span></span>
<span id="cb1-6">gfatools <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/gfatools/gfatools"</span>)</span>
<span id="cb1-7">hifiasm <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/envs/hifiasm-0.25.0_env/bin/hifiasm"</span>)</span>
<span id="cb1-8"></span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SETTINGS</span></span>
<span id="cb1-11">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"40"</span></span>
<span id="cb1-12"></span>
<span id="cb1-13"></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb1-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb1-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data_dir =</span> data_dir,</span>
<span id="cb1-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gfatools =</span> gfatools,</span>
<span id="cb1-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hifiasm=</span>hifiasm,</span>
<span id="cb1-19">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb1-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads</span>
<span id="cb1-21">)</span></code></pre></div>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directory, if it doesn't exist</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb2-5"></span>
<span id="cb2-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create an array of .fastq.gz files</span></span>
<span id="cb2-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${data_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fastq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb2-8"></span>
<span id="cb2-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the result (optional, for verification)</span></span>
<span id="cb2-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## newline-delimited format</span></span>
<span id="cb2-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"List of FastQs used for assembly:"</span></span>
<span id="cb2-12"></span>
<span id="cb2-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> input_fastqs.txt</span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run hifiasm assembly</span></span>
<span id="cb2-17"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${hifiasm}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-18">-o pb-hifiasm-lean-assembly.asm <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-19">-t <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-20"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-21"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-lean-assembly.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
</section>
<section id="gfatools" class="level1">
<h1>3 GFATOOLS</h1>
<section id="primary-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="primary-contigs-to-fasta">3.1 Primary contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-4">pb-hifiasm-lean-assembly.asm.bp.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-lean-assembly.fa</span>
<span id="cb3-6"></span>
<span id="cb3-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-lean-assembly.fa</span></code></pre></div>
</section>
<section id="haplotype-1-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-1-contigs-to-fasta">3.2 Haplotype 1 contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-4">pb-hifiasm-lean-assembly.asm.bp.hap1.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-lean-hap1-assembly.fa</span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-lean-hap1-assembly.fa</span></code></pre></div>
</section>
<section id="haplotype-2-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-2-contigs-to-fasta">3.3 Haplotype 2 contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-2"></span>
<span id="cb5-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-4">pb-hifiasm-lean-assembly.asm.bp.hap2.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-lean-hap2-assembly.fa</span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-lean-hap2-assembly.fa</span></code></pre></div>
</section>
<section id="generate-checksums" class="level2">
<h2 class="anchored" data-anchor-id="generate-checksums">3.4 Generate checksums</h2>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb6-2"></span>
<span id="cb6-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fa</span>
<span id="cb6-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb6-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-6">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb6-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
<pre><code>## 4ba0c3cc7a7ab090d67047cb22f10bb2  pb-hifiasm-lean-assembly.fa
## 77d48fe452af73d751039245f1bd688e  pb-hifiasm-lean-hap1-assembly.fa
## 21b9cfeb83ec8ce522fcc624873b58eb  pb-hifiasm-lean-hap2-assembly.fa</code></pre>
</section>
</section>
<section id="references" class="level1">
<h1>4 REFERENCES</h1>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-cheng2024" class="csl-entry">
Cheng, Haoyu, Mobin Asri, Julian Lucas, Sergey Koren, and Heng Li. 2024. “Scalable Telomere-to-Telomere Assembly for Diploid and Polyploid Genomes with Double Graph.” <em>Nature Methods</em> 21 (6): 967–70. <a href="https://doi.org/10.1038/s41592-024-02269-8" class="uri">https://doi.org/10.1038/s41592-024-02269-8</a>.
</div>
<div id="ref-cheng2021" class="csl-entry">
Cheng, Haoyu, Gregory T. Concepcion, Xiaowen Feng, Haowen Zhang, and Heng Li. 2021. “Haplotype-Resolved de Novo Assembly Using Phased Assembly Graphs with Hifiasm.” <em>Nature Methods</em> 18 (2): 170–75. <a href="https://doi.org/10.1038/s41592-020-01056-5" class="uri">https://doi.org/10.1038/s41592-020-01056-5</a>.
</div>
<div id="ref-cheng2022" class="csl-entry">
Cheng, Haoyu, Erich D. Jarvis, Olivier Fedrigo, et al.&nbsp;2022. “Haplotype-Resolved Assembly of Diploid Genomes Without Parental Data.” <em>Nature Biotechnology</em> 40 (9): 1332–35. <a href="https://doi.org/10.1038/s41587-022-01261-x" class="uri">https://doi.org/10.1038/s41587-022-01261-x</a>.
</div>
</div>


</section>

 ]]></description>
  <category>2026</category>
  <category>Genome Assembly</category>
  <category>PacBio</category>
  <category>HiFi Reads</category>
  <category>hifiasm</category>
  <category>Salvelinus namaycush</category>
  <category>Lake Trout</category>
  <category>Lean</category>
  <category>Klone</category>
  <category>Hyak</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/</guid>
  <pubDate>Tue, 31 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Genome Assembly - S.namaycush Siscowet Ecotype with PacBio HiFi Reads Using hifiasm on Hyak</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>As part of <a href="https://github.com/RobertsLab/project-lake-trout"><code>project-lake-trout</code></a> (GitHub repo), Steven <a href="https://github.com/RobertsLab/resources/issues/2409">asked that I assemble the genome of a siscowet ecotype of lake trout</a> (GitHub Issue), <em>Salvelinus namaycush</em>, using PacBio HiFi reads. I previously assembled this genome using Flye, on 20260326 (notebook entry), but <a href="https://github.com/RobertsLab/resources/issues/2409#issuecomment-4150948212">Steven asked me to also try hifiasm</a> (GitHub Issue)for the assembly.</p>
<p>I performed the assembly on Hyak (Klone), UW’s high-performance computing cluster. I used our Apptainer (Singularity) container to run the job (<code>srlab-R4.4-bioinformatics-container-e5bcfea.sif</code>), which includes hifiasm version 0.25.0.</p>
<p>Below is the rendered markdown from <code>13.1-hifiasm-genome-assembly-siscowet.Rmd</code>. The run was <em>very</em> fast; it only took a day and half.</p>
</section>
<section id="primary-outputs" class="level1">
<h1>PRIMARY OUTPUTS</h1>
<p>hifiasm produces three assemblies: a primary assembly, and two haplotype-resolved assemblies. Below are the links to the FastA files. The outputs are only GFA graph files. I had to convert them to FastA using <a href="https://github.com/lh3/gfatools">gfatools</a>.</p>
<p>Primary assembly:</p>
<ul>
<li><p>FastA (3.8GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-assembly.fa.fai</p></li>
</ul>
<p>Haplotype 1:</p>
<ul>
<li><p>FastA (3.4GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap1-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap1-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap1-assembly.fa.fai</p></li>
</ul>
<p>Haplotype 2:</p>
<ul>
<li><p>FastA (3.2GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap2-assembly.fa</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap2-assembly.fa.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/pb-hifiasm-siscowet-hap2-assembly.fa.fai</p></li>
</ul>
<p>After this, I’ll compare the two assemblies (Flye vs.&nbsp;hifiasm) using <a href="https://github.com/ablab/quast">QUAST</a>, which will provide a more comprehensive set of assembly statistics and metrics.</p>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>Use <a href="https://github.com/chhylp123/hifiasm">hifiasm</a> (GitHub) (Cheng et al.&nbsp;2021, 2022, 2024) to assemble PacBio reads for <em>S.namaycush</em> <code>siscowet</code> ecotype.</p>
<p>Due to large file sizes, the outputs will not be on GitHub. They may be found here instead:</p>
<ul>
<li><a href="https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/" class="uri">https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-hifiasm-genome-assembly-siscowet/</a></li>
</ul>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries" class="level2">
<h2 class="anchored" data-anchor-id="libraries">2.1 Libraries</h2>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">2.2 Set R variables</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTPUT DIRECTORY</span></span>
<span id="cb1-2">data_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/data/pacbio-siscowet"</span></span>
<span id="cb1-3">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-hifiasm-genome-assembly-siscowet"</span></span>
<span id="cb1-4"></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROGRAMS</span></span>
<span id="cb1-6">gfatools <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/gfatools/gfatools"</span>)</span>
<span id="cb1-7">hifiasm <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/envs/hifiasm-0.25.0_env/bin/hifiasm"</span>)</span>
<span id="cb1-8"></span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SETTINGS</span></span>
<span id="cb1-11">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"40"</span></span>
<span id="cb1-12"></span>
<span id="cb1-13"></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb1-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb1-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data_dir =</span> data_dir,</span>
<span id="cb1-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gfatools =</span> gfatools,</span>
<span id="cb1-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hifiasm=</span>hifiasm,</span>
<span id="cb1-19">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb1-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads</span>
<span id="cb1-21">)</span></code></pre></div>
</section>
</section>
<section id="run-hifiasm" class="level1">
<h1>3 RUN HIFIASM</h1>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directory, if it doesn't exist</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb2-5"></span>
<span id="cb2-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create an array of .fastq.gz files</span></span>
<span id="cb2-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${data_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fastq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb2-8"></span>
<span id="cb2-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the result (optional, for verification)</span></span>
<span id="cb2-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## newline-delimited format</span></span>
<span id="cb2-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"List of FastQs used for assembly:"</span></span>
<span id="cb2-12"></span>
<span id="cb2-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> input_fastqs.txt</span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run hifiasm assembly</span></span>
<span id="cb2-17"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${hifiasm}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-18">-o pb-hifiasm-siscowet-assembly.asm <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-19">-t <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-20"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-21"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-siscowet-assembly.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
<section id="gfatools" class="level1">
<h1>4 GFATOOLS</h1>
<section id="primary-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="primary-contigs-to-fasta">4.1 Primary contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-4">pb-hifiasm-siscowet-assembly.asm.bp.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-siscowet-assembly.fa</span>
<span id="cb3-6"></span>
<span id="cb3-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-siscowet-assembly.fa</span></code></pre></div>
</section>
<section id="haplotype-1-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-1-contigs-to-fasta">4.2 Haplotype 1 contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-4">pb-hifiasm-siscowet-assembly.asm.bp.hap1.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-siscowet-hap1-assembly.fa</span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-siscowet-hap1-assembly.fa</span></code></pre></div>
</section>
<section id="haplotype-2-contigs-to-fasta" class="level2">
<h2 class="anchored" data-anchor-id="haplotype-2-contigs-to-fasta">4.3 Haplotype 2 contigs to FastA</h2>
<p>This will extract a FastA file from the graph files output by hifiasm.</p>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-2"></span>
<span id="cb5-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${gfatools}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> gfa2fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-4">pb-hifiasm-siscowet-assembly.asm.bp.hap2.p_ctg.gfa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> pb-hifiasm-siscowet-hap2-assembly.fa</span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx pb-hifiasm-siscowet-hap2-assembly.fa</span></code></pre></div>
</section>
<section id="generate-checksums" class="level2">
<h2 class="anchored" data-anchor-id="generate-checksums">4.4 Generate checksums</h2>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb6-2"></span>
<span id="cb6-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fa</span>
<span id="cb6-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb6-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-6">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fasta}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb6-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
<pre><code>## d41d8cd98f00b204e9800998ecf8427e  pb-hifiasm-lean-assembly.fa
## c5e88b1d81585383b3fb7354aa624f34  pb-hifiasm-siscowet-assembly.fa
## cb85945e4b07c42fba548865e3039d00  pb-hifiasm-siscowet-hap1-assembly.fa
## 5d813ba82405afef60628e3c8325306f  pb-hifiasm-siscowet-hap2-assembly.fa</code></pre>
</section>
</section>
<section id="references" class="level1">
<h1>5 REFERENCES</h1>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-cheng2024" class="csl-entry">
Cheng, Haoyu, Mobin Asri, Julian Lucas, Sergey Koren, and Heng Li. 2024. “Scalable Telomere-to-Telomere Assembly for Diploid and Polyploid Genomes with Double Graph.” <em>Nature Methods</em> 21 (6): 967–70. <a href="https://doi.org/10.1038/s41592-024-02269-8" class="uri">https://doi.org/10.1038/s41592-024-02269-8</a>.
</div>
<div id="ref-cheng2021" class="csl-entry">
Cheng, Haoyu, Gregory T. Concepcion, Xiaowen Feng, Haowen Zhang, and Heng Li. 2021. “Haplotype-Resolved de Novo Assembly Using Phased Assembly Graphs with Hifiasm.” <em>Nature Methods</em> 18 (2): 170–75. <a href="https://doi.org/10.1038/s41592-020-01056-5" class="uri">https://doi.org/10.1038/s41592-020-01056-5</a>.
</div>
<div id="ref-cheng2022" class="csl-entry">
Cheng, Haoyu, Erich D. Jarvis, Olivier Fedrigo, et al.&nbsp;2022. “Haplotype-Resolved Assembly of Diploid Genomes Without Parental Data.” <em>Nature Biotechnology</em> 40 (9): 1332–35. <a href="https://doi.org/10.1038/s41587-022-01261-x" class="uri">https://doi.org/10.1038/s41587-022-01261-x</a>.
</div>
</div>


</section>

 ]]></description>
  <category>2026</category>
  <category>Genome Assembly</category>
  <category>PacBio</category>
  <category>HiFi Reads</category>
  <category>hifiasm</category>
  <category>Salvelinus namaycush</category>
  <category>Lake Trout</category>
  <category>Siscowet</category>
  <category>Klone</category>
  <category>Hyak</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-hifiasm-on-Hyak/</guid>
  <pubDate>Tue, 31 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Resazurin Assays - Selected Juvenile Ruditapes philippinarum Exposed to 36C Acute Heat Stress Day 0</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-0/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Steven asked me to perform resazurin assays on “selected” juvenile <em>Ruditapes philippinarum</em> (Manila clam) exposed to 36<sup>o</sup>C acute heat stress. The goal of the experiment is to compare metabolic activity between the “selected” clams and control clams when exposed to heat stress.</p>
<p>This is the first day of a two day experiment. Day 0 corresponds to the first day of measurements, and Day 1 corresponds to the second day of measurements. The same clams were measured on both days. Day 1 notebook entry is available here:</p>
<ul>
<li>Day 1 Notebook Entry</li>
</ul>
</section>
<section id="materials-methods" class="level1">
<h1>MATERIALS &amp; METHODS</h1>
<p>Control clams (<code>C</code>) compared with selected clams (<code>S</code>) at 36<sup>o</sup>C.</p>
<p>Clams were processed in 12-well plates and submerged in <code>5.0mL</code> of resazurin working solution stored at 4<sup>o</sup>C,prepared on <a href="../../../posts/2026/2026-03-30-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-40C-Acute-Heat-Stress/index.html">20260330</a> (notebook entry).</p>
<p>Plates were measured every 30mins on a Synergy HTX (Agilent) plate reader.</p>
<p>Plate layout was randomized; Steven is currently the only person who knows the treatment assignments.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>Seemed to be inconsistent heating, with interior wells usually ~1.5<sup>o</sup>C lower than rest of wells.</li>
</ul>
<p>The following wells lost volume - possibly due to clam spitting?</p>
<ul>
<li>Plate A, C3</li>
<li>Plate C, C4</li>
<li>Plate B, A3</li>
<li>Plate D, B2</li>
</ul>
</div>
</div>
<p>After 3.5hrs, Steven removed the resazurin working solution from the wells and replaced it with 5.0mL of seawater. Plates were returned to the cold room and will be measured again tomorrow.</p>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<p>Data are available here:</p>
<ul>
<li><a href="https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260331-clam-36C-C-vs-S">https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260331-clam-36C-C-vs-S</a></li>
</ul>
<p>At the time of this writing, there is no plate layout file available for this experiment, so it’s not possible to determine which wells correspond to which clams. Steven is working on creating a plate layout file, which will be added to the GitHub repository when it’s available.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>resazurin</category>
  <category>Ruditapes philippinarum</category>
  <category>Manila clam</category>
  <category>Synergy HTX</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-31-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-36C-Acute-Heat-Stress-Day-0/</guid>
  <pubDate>Tue, 31 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Resazurin Assays - Selected Juvenile Ruditapes philippinarum Exposed to 40C Acute Heat Stress</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-30-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-40C-Acute-Heat-Stress/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Steven asked me to perform resazurin assays on “selected” juvenile <em>Ruditapes philippinarum</em> (Manila clam) exposed to 40<sup>o</sup>C acute heat stress. The goal of the experiment is to determine if the “selected” clams have higher metabolic activity than control clams when exposed to heat stress.</p>
<p>Data and results are available here:</p>
<ul>
<li><a href="https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260330-clam-40C-C-vs-S">https://github.com/RobertsLab/resazurin-assay-development/tree/main/data/clam/20260330-clam-40C-C-vs-S</a></li>
</ul>
</section>
<section id="materials-methods" class="level1">
<h1>MATERIALS &amp; METHODS</h1>
<p>Steven picked 48 clams from the “Selected” group and 48 clams from the “Control” group.</p>
<p>Two plates per treatment were measured: “blue” and “red”. The colors reflect the coloration of the clams.</p>
<p>Blanks were included on each plate, and consisted of wells with resazurin working solution, but no clams. Blanks were in Column 6 of each plate.</p>
<p>Plates were kept in a small, table-top, fan-powered incubator at 40<sup>o</sup>C.</p>
<section id="resazurin-working-solution" class="level2">
<h2 class="anchored" data-anchor-id="resazurin-working-solution">Resazurin Working Solution</h2>
<p>Clams were processed in 24-well plates and submerged in 2.2mL of resazurin working solution; prepared by Sam White 20260330:</p>
<ul>
<li>986.66 mL filtered seawater (4<sup>o</sup>C filtered sea water from 11/19/2025 by AH)</li>
<li>2.22 mL resazurin stock solution (from step 1 above)</li>
<li>1.00 mL DMSO</li>
<li>10.00 mL antibiotic solution (100x Penn/Strep &amp; 100x Fungizone)</li>
</ul>
</section>
<section id="measurements" class="level2">
<h2 class="anchored" data-anchor-id="measurements">Measurements</h2>
<p>Plates were measured every 30mins on a Synergy HTX (Agilent) plate reader. The plate reader was set to measure fluorescence with an excitation wavelength of 530nm and an emission wavelength of 590nm.</p>
</section>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<p>Here are line plots of raw fluorescence, by well, across all time points. Black lines correspond to the Blanks.</p>
<p>![Line plots of raw fluorescence, by well, across all time points. Black lines correspond to the Blanks.](https://github.com/RobertsLab/resazurin-assay-development/blob/main/data/clam/20260330-clam-40C-C-vs-S/plots/fluorescence-by-well_all-plates.png?raw=true()</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The <code>S-red</code> plate shows changes in fluorescence in the Blanks, suggesting contamination, or, more likely, accidental splashing/wicking of neighboring wells. The volume in the wells was extremely high, so it’s possible that the resazurin working solution was splashed/wicked into the Blank wells via the lid, which had visible resazurin dropletsduring handling.</p>
</div>
</div>
<p>The <code>S-blue</code> plate shows the overall highest levels of raw fluorescence. Since these plots do not take into account the size of the clams, it’s difficult to draw many conclusions from these data.</p>
<p>Additionally, since the “Control” and “Selected” clams were not randomly assigned to the “red” and “blue” plates, it’s possible that the differences in fluorescence between the plates are due to plate effects, rather than treatment effects.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>resazurin</category>
  <category>Ruditapes philippinarum</category>
  <category>Manila clam</category>
  <category>Synergy HTX</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-30-Resazurin-Assays---Selected-Juvenile-Ruditapes-philippinarum-Exposed-to-40C-Acute-Heat-Stress/</guid>
  <pubDate>Mon, 30 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Samples Submitted - Salmon Kidney Tissue to SolusCell for Cristian Gallardo</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-30-Samples-Submitted---Salmon-Kidney-Tissue-to-SolusCell-for-Cristian-Gallardo/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Steven <a href="https://github.com/RobertsLab/resources/issues/2410">asked me to submit some salmon kidney tissue samples to SolusCell for RNA-seq</a> (GitHub Issue). The samples are for Cristian Gallardo from the University of Concepción in Chile. Samples were shipped on dry ice via FedEx on 2026-03-30. The tracking number is: 870130241319.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>Samples Submitted</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-30-Samples-Submitted---Salmon-Kidney-Tissue-to-SolusCell-for-Cristian-Gallardo/</guid>
  <pubDate>Mon, 30 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Genome Assembly - S.namaycush Lean Ecotype with PacBio HiFi Reads Using Flye</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>As part of <a href="https://github.com/RobertsLab/project-lake-trout"><code>project-lake-trout</code></a> (GitHub repo), Steven <a href="https://github.com/RobertsLab/resources/issues/2409">asked that I assemble the genome of a lean ecotype of lake trout</a> (GitHub Issue), <em>Salvelinus namaycush</em>, using PacBio HiFi reads. I opted to use Flye for the assembly, as we’d previously used it for <a href="http://en.wikipedia.org/wiki/Chionoecetes_bairdi"><em>Chionoecetes bairdi</em> (Tanner crab)</a> (Wikipedia), and it performed well. The assembly process was straightforward and quick.</p>
<p>I performed the assembly on Hyak (Klone), UW’s high-performance computing cluster. I used our Apptainer (Singularity) container to run the job (<code>srlab-R4.4-bioinformatics-container-fca8ae6.sif</code>), which includes Flye version 2.9.6.</p>
<p>Below is the rendered markdown from <code>13.1-genome-assembly-lean.Rmd</code>. The run took ~7 days.</p>
</section>
<section id="primary-outputs" class="level1">
<h1>PRIMARY OUTPUTS</h1>
<ul>
<li><p>FastA (3.9GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-lean/snam-lean-pb-flye-assembly.fasta.fai</p></li>
</ul>
<p>Once I’ve also assembled this genome using <a href="https://github.com/CHPGenetics/hifiasm">hifiasm</a>, I’ll compare the two assemblies using <a href="https://github.com/ablab/quast">QUAST</a>, which will provide a more comprehensive set of assembly statistics and metrics.</p>
<hr>
</section>
<section id="genome-assembly-lean" class="level1">
<h1>13.1-genome-assembly-lean</h1>
<p>Sam White 2026-03-26</p>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>Use <a href="https://github.com/mikolmogorov/Flye">Flye</a>(GitHub) (Kolmogorov et al.&nbsp;2019) to assemble PacBio reads for <em>S.namaycush</em> <code>lean</code> ecotype.</p>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries" class="level2">
<h2 class="anchored" data-anchor-id="libraries">2.1 Libraries</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tidyverse)</span></code></pre></div>
<pre><code>## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.4     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (&lt;http://conflicted.r-lib.org/&gt;) to force all conflicts to become errors</code></pre>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reticulate)</span>
<span id="cb3-2"></span>
<span id="cb3-3">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">results =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hold"</span>,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hold outputs and show them after the full code chunk</span></span>
<span id="cb3-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb3-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Keep code and output in separate blocks</span></span>
<span id="cb3-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb3-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb3-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"##"</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prefix output lines with '##' so output is visually distinct</span></span>
<span id="cb3-12">)</span></code></pre></div>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">2.2 Set R variables</h2>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTPUT DIRECTORY</span></span>
<span id="cb4-2">data_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../data/pacbio-lean"</span></span>
<span id="cb4-3">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-genome-assembly-lean"</span></span>
<span id="cb4-4"></span>
<span id="cb4-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#OUTPUT FILE(S)</span></span>
<span id="cb4-6">prefix <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"snam-lean-pb-flye"</span></span>
<span id="cb4-7"></span>
<span id="cb4-8"></span>
<span id="cb4-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CONDA</span></span>
<span id="cb4-10">conda_env_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env"</span>)</span>
<span id="cb4-11">conda_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/bin/conda"</span>)</span>
<span id="cb4-12"></span>
<span id="cb4-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SETTINGS</span></span>
<span id="cb4-14">genome_size <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.3g"</span></span>
<span id="cb4-15">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"32"</span></span>
<span id="cb4-16"></span>
<span id="cb4-17"></span>
<span id="cb4-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb4-19"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb4-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data_dir =</span> data_dir,</span>
<span id="cb4-21">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_size =</span> genome_size,</span>
<span id="cb4-22">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb4-23">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prefix =</span> prefix,</span>
<span id="cb4-24">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads</span>
<span id="cb4-25">)</span></code></pre></div>
</section>
<section id="load-flye-conda-environment" class="level2">
<h2 class="anchored" data-anchor-id="load-flye-conda-environment">2.3 Load <a href="https://github.com/mikolmogorov/Flye">Flye</a> conda environment</h2>
<p>If this is successful, the first line of output should show that the Python being used is the one in your <a href="https://github.com/mikolmogorov/Flye">Flye</a> conda environment path.</p>
<p>E.g.</p>
<p><code>python:         /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/bin/python</code></p>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">use_condaenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">condaenv =</span> conda_env_name, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conda =</span> conda_path)</span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">py_config</span>()</span></code></pre></div>
<pre><code>## python:         /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/bin/python
## libpython:      /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/lib/libpython3.12.so
## pythonhome:     /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env:/srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env
## version:        3.12.13 | packaged by conda-forge | (main, Mar  5 2026, 16:50:00) [GCC 14.3.0]
## numpy:           [NOT FOUND]
## 
## NOTE: Python version was forced by use_python() function</code></pre>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directory, if it doesn't exist</span></span>
<span id="cb7-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-3"></span>
<span id="cb7-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create an array of .fastq.gz files</span></span>
<span id="cb7-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${data_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fastq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb7-6"></span>
<span id="cb7-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the result (optional, for verification)</span></span>
<span id="cb7-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## newline-delimited format</span></span>
<span id="cb7-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"List of FastQs used for assembly:"</span></span>
<span id="cb7-10"></span>
<span id="cb7-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/input_fastqs.txt"</span></span>
<span id="cb7-13"></span>
<span id="cb7-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run Flye assembly</span></span>
<span id="cb7-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">flye</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-16">--pacbio-hifi <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-17">--genome-size <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_size}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-18">--out-dir <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-19">--threads <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-20"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/pb-lean-assembly.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
</section>
<section id="outputs" class="level1">
<h1>3 OUTPUTS</h1>
<section id="list-files" class="level2">
<h2 class="anchored" data-anchor-id="list-files">3.1 List files</h2>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-ltrh</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span></code></pre></div>
<pre><code>## total 8.2G
## -rw-r--r-- 1 samwhite all  326 Mar 26 11:02 input_fastqs.txt
## drwxr-xr-x 2 samwhite all  512 Mar 30 07:44 00-assembly
## drwxr-xr-x 2 samwhite all 8.0K Mar 30 12:12 10-consensus
## drwxr-xr-x 2 samwhite all  512 Mar 31 08:22 20-repeat
## drwxr-xr-x 2 samwhite all  512 Mar 31 08:33 30-contigger
## drwxr-xr-x 2 samwhite all 8.0K Mar 31 17:25 40-polishing
## -rw-r--r-- 1 samwhite all   92 Mar 31 17:25 params.json
## -rw-r--r-- 1 samwhite all  53M Mar 31 17:25 assembly_graph.gv
## -rw-r--r-- 1 samwhite all 4.0G Mar 31 17:25 assembly_graph.gfa
## -rw-r--r-- 1 samwhite all 3.9G Mar 31 17:25 assembly.fasta
## -rw-r--r-- 1 samwhite all 4.8M Mar 31 17:25 assembly_info.txt
## -rw-r--r-- 1 samwhite all 3.2K Mar 31 17:25 pb-lean-assembly.log
## -rw-r--r-- 1 samwhite all 338M Mar 31 17:25 flye.log
## -rw-r--r-- 1 samwhite all 3.9M Apr  2 10:05 assembly.fasta.fai</code></pre>
</section>
<section id="rename-files" class="level2">
<h2 class="anchored" data-anchor-id="rename-files">3.2 Rename files</h2>
<p>Files have generic “assembly_*” naming.</p>
<p>Renaming to reflect specific species-ecotype-data-assembly_method.</p>
<div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-2"></span>
<span id="cb10-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> file <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> assembly<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb10-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb10-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span>-<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span></span>
<span id="cb10-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
</section>
<section id="create-fasta-index" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index">3.3 Create FastA Index</h2>
<div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-2"></span>
<span id="cb11-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span>-assembly.fasta</span></code></pre></div>
</section>
<section id="create-checksums" class="level2">
<h2 class="anchored" data-anchor-id="create-checksums">3.4 Create checksums</h2>
<div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb12-2"></span>
<span id="cb12-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> file <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb12-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb12-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb12-6">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb12-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
<pre><code>## ac7c2af6c32834f86954cfb9893c4c50  snam-lean-pb-flye-assembly.fasta
## 242ea029692207d1c7df0b7e842fd58f  snam-lean-pb-flye-assembly.fasta.fai
## 35f1973b873fd7498ebeeecdb7eecd2e  snam-lean-pb-flye-assembly_graph.gfa
## d4f6a3a41846f6285d0290c7a41ed1f7  snam-lean-pb-flye-assembly_graph.gv
## e1224b9a628253fd8cee1d39517343ef  snam-lean-pb-flye-assembly_info.txt</code></pre>
</section>
<section id="assembly-stats" class="level2">
<h2 class="anchored" data-anchor-id="assembly-stats">3.5 Assembly stats</h2>
<div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-2"></span>
<span id="cb14-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span> flye.log</span></code></pre></div>
<pre><code>## [2026-03-31 17:25:45] root: INFO: Assembly statistics:
## 
##  Total length:   4046369763
##  Fragments:  112562
##  Fragments N50:  74514
##  Largest frg:    2170611
##  Scaffolds:  0
##  Mean coverage:  15
## 
## [2026-03-31 17:25:45] root: INFO: Final assembly: /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.1-genome-assembly-lean/assembly.fasta</code></pre>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-kolmogorov2019" class="csl-entry">
Kolmogorov, Mikhail, Jeffrey Yuan, Yu Lin, and Pavel A. Pevzner. 2019. “Assembly of Long, Error-Prone Reads Using Repeat Graphs.” <em>Nature Biotechnology</em> 37 (5): 540–46. <a href="https://doi.org/10.1038/s41587-019-0072-8" class="uri">https://doi.org/10.1038/s41587-019-0072-8</a>.
</div>
</div>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Genome Assembly</category>
  <category>PacBio</category>
  <category>HiFi Reads</category>
  <category>Flye</category>
  <category>Salvelinus namaycush</category>
  <category>Lake Trout</category>
  <category>Lean</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Lean-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/</guid>
  <pubDate>Thu, 26 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Genome Assembly - S.namaycush Siscowet Ecotype with PacBio HiFi Reads Using Flye</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>As part of <a href="https://github.com/RobertsLab/project-lake-trout"><code>project-lake-trout</code></a> (GitHub repo), Steven <a href="https://github.com/RobertsLab/resources/issues/2409">asked that I assemble the genome of a siscowet ecotype of lake trout</a> (GitHub Issue), <em>Salvelinus namaycush</em>, using PacBio HiFi reads. I opted to use Flye for the assembly, as we’d previously used it for <a href="http://en.wikipedia.org/wiki/Chionoecetes_bairdi"><em>Chionoecetes bairdi</em> (Tanner crab)</a> (Wikipedia), and it performed well. The assembly process was straightforward and quick.</p>
<p>I performed the assembly on Hyak (Klone), UW’s high-performance computing cluster. I used our Apptainer (Singularity) container to run the job (<code>srlab-R4.4-bioinformatics-container-fca8ae6.sif</code>), which includes Flye version 2.9.6.</p>
<p>Below is the rendered markdown from <code>13.1-genome-assembly-siscowet.Rmd</code>. The run took ~7 days.</p>
</section>
<section id="primary-outputs" class="level1">
<h1>PRIMARY OUTPUTS</h1>
<ul>
<li><p>FastA (4.1GB): https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta</p></li>
<li><p>MD5: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta.md5</p></li>
<li><p>FastA index: https://gannet.fish.washington.edu/gitrepos/project-lake-trout/output/13.1-genome-assembly-siscowet/snam-siscowet-pb-flye-assembly.fasta.fai</p></li>
</ul>
<p>Once I’ve also assembled this genome using <a href="https://github.com/CHPGenetics/hifiasm">hifiasm</a>, I’ll compare the two assemblies using <a href="https://github.com/ablab/quast">QUAST</a>, which will provide a more comprehensive set of assembly statistics and metrics.</p>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>Use <a href="https://github.com/mikolmogorov/Flye">Flye</a>(GitHub) (Kolmogorov et al.&nbsp;2019) to assemble PacBio reads for <em>S.namaycush</em> <code>siscowet</code> ecotype.</p>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries" class="level2">
<h2 class="anchored" data-anchor-id="libraries">2.1 Libraries</h2>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">2.2 Set R variables</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTPUT DIRECTORY</span></span>
<span id="cb1-2">data_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../data/pacbio-siscowet"</span></span>
<span id="cb1-3">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output/13.1-genome-assembly-siscowet"</span></span>
<span id="cb1-4"></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#OUTPUT FILE(S)</span></span>
<span id="cb1-6">prefix <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"snam-siscowet-pb-flye"</span></span>
<span id="cb1-7"></span>
<span id="cb1-8"></span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CONDA</span></span>
<span id="cb1-11">conda_env_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env"</span>)</span>
<span id="cb1-12">conda_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/srlab/programs/miniforge3-24.7.1-0/bin/conda"</span>)</span>
<span id="cb1-13"></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SETTINGS</span></span>
<span id="cb1-15">genome_size <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.3g"</span></span>
<span id="cb1-16">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100"</span></span>
<span id="cb1-17"></span>
<span id="cb1-18"></span>
<span id="cb1-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb1-20"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb1-21">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data_dir =</span> data_dir,</span>
<span id="cb1-22">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_size =</span> genome_size,</span>
<span id="cb1-23">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb1-24">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prefix =</span> prefix,</span>
<span id="cb1-25">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads</span>
<span id="cb1-26">)</span></code></pre></div>
</section>
<section id="load-flye-conda-environment" class="level2">
<h2 class="anchored" data-anchor-id="load-flye-conda-environment">2.3 Load <a href="https://github.com/mikolmogorov/Flye">Flye</a> conda environment</h2>
<p>If this is successful, the first line of output should show that the Python being used is the one in your <a href="https://github.com/mikolmogorov/Flye">Flye</a> conda environment path.</p>
<p>E.g.</p>
<p><code>python:         /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/bin/python</code></p>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">use_condaenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">condaenv =</span> conda_env_name, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conda =</span> conda_path)</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">py_config</span>()</span></code></pre></div>
<pre><code>## python:         /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/bin/python
## libpython:      /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env/lib/libpython3.12.so
## pythonhome:     /srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env:/srlab/programs/miniforge3-24.7.1-0/envs/flye-2.9.6-env
## version:        3.12.13 | packaged by conda-forge | (main, Mar  5 2026, 16:50:00) [GCC 14.3.0]
## numpy:           [NOT FOUND]
## 
## NOTE: Python version was forced by use_python() function</code></pre>
</section>
</section>
<section id="flye" class="level1">
<h1>3 FLYE</h1>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directory, if it doesn't exist</span></span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-3"></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create an array of .fastq.gz files</span></span>
<span id="cb4-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${data_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fastq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the result (optional, for verification)</span></span>
<span id="cb4-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## newline-delimited format</span></span>
<span id="cb4-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"List of FastQs used for assembly:"</span></span>
<span id="cb4-10"></span>
<span id="cb4-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/input_fastqs.txt"</span></span>
<span id="cb4-13"></span>
<span id="cb4-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run Flye assembly</span></span>
<span id="cb4-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">flye</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-16">--pacbio-hifi <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastqs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-17">--genome-size <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_size}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-18">--out-dir <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-19">--threads <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-20"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/pb-siscowet-assembly.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
<section id="outputs" class="level1">
<h1>4 OUTPUTS</h1>
<section id="list-files" class="level2">
<h2 class="anchored" data-anchor-id="list-files">4.1 List files</h2>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-ltrh</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span></code></pre></div>
<pre><code>## total 8.9G
## -rw-r--r-- 1 samwhite all  342 Apr  6 08:08 input_fastqs.txt
## drwxr-xr-x 2 samwhite all  512 Apr  8 11:51 00-assembly
## drwxr-xr-x 2 samwhite all 8.0K Apr  8 15:08 10-consensus
## drwxr-xr-x 2 samwhite all  512 Apr  9 02:23 20-repeat
## drwxr-xr-x 2 samwhite all  512 Apr  9 02:40 30-contigger
## drwxr-xr-x 2 samwhite all 8.0K Apr  9 10:29 40-polishing
## -rw-r--r-- 1 samwhite all   92 Apr  9 10:29 params.json
## -rw-r--r-- 1 samwhite all  55M Apr  9 10:29 assembly_graph.gv
## -rw-r--r-- 1 samwhite all 4.3G Apr  9 10:30 assembly_graph.gfa
## -rw-r--r-- 1 samwhite all 4.2G Apr  9 10:30 assembly.fasta
## -rw-r--r-- 1 samwhite all 4.8M Apr  9 10:30 assembly_info.txt
## -rw-r--r-- 1 samwhite all 3.2K Apr  9 10:30 pb-siscowet-assembly.log
## -rw-r--r-- 1 samwhite all 482M Apr  9 10:30 flye.log</code></pre>
</section>
<section id="rename-files" class="level2">
<h2 class="anchored" data-anchor-id="rename-files">4.2 Rename files</h2>
<p>Files have generic “assembly_*” naming.</p>
<p>Renaming to reflect specific species-ecotype-data-assembly_method.</p>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-2"></span>
<span id="cb7-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> file <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> assembly<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb7-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb7-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span>-<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span></span>
<span id="cb7-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
</section>
<section id="create-fasta-index" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index">4.3 Create FastA Index</h2>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-2"></span>
<span id="cb8-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">samtools</span> faidx <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span>-assembly.fasta</span></code></pre></div>
</section>
<section id="create-checksums" class="level2">
<h2 class="anchored" data-anchor-id="create-checksums">4.4 Create checksums</h2>
<div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> file <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${prefix}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb9-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb9-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb9-6">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${file}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb9-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span></code></pre></div>
<pre><code>## 30139d7d8d7fdad878543fc5a5f3f0a8  snam-siscowet-pb-flye-assembly.fasta
## adf9dfc0996f12c28a41089e148e693a  snam-siscowet-pb-flye-assembly.fasta.fai
## 62f9467fdd049e7dafaf7c63871c4184  snam-siscowet-pb-flye-assembly_graph.gfa
## 949d7663ab4d54500e00856fd80deed9  snam-siscowet-pb-flye-assembly_graph.gv
## 1f336e131d47f582e15bdd0acc66414f  snam-siscowet-pb-flye-assembly_info.txt</code></pre>
</section>
<section id="assembly-stats" class="level2">
<h2 class="anchored" data-anchor-id="assembly-stats">4.5 Assembly stats</h2>
<div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-2"></span>
<span id="cb11-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span> flye.log</span></code></pre></div>
<pre><code>## [2026-04-09 10:30:36] root: INFO: Assembly statistics:
## 
##  Total length:   4336778941
##  Fragments:  110158
##  Fragments N50:  78564
##  Largest frg:    2753427
##  Scaffolds:  0
##  Mean coverage:  21
## 
## [2026-04-09 10:30:36] root: INFO: Final assembly: /mmfs1/gscratch/scrubbed/samwhite/gitrepos/RobertsLab/project-lake-trout/output/13.1-genome-assembly-siscowet/assembly.fasta</code></pre>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-kolmogorov2019" class="csl-entry">
Kolmogorov, Mikhail, Jeffrey Yuan, Yu Lin, and Pavel A. Pevzner. 2019. “Assembly of Long, Error-Prone Reads Using Repeat Graphs.” <em>Nature Biotechnology</em> 37 (5): 540–46. <a href="https://doi.org/10.1038/s41587-019-0072-8" class="uri">https://doi.org/10.1038/s41587-019-0072-8</a>.
</div>
</div>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Genome Assembly</category>
  <category>PacBio</category>
  <category>HiFi Reads</category>
  <category>Flye</category>
  <category>Salvelinus namaycush</category>
  <category>Lake Trout</category>
  <category>Siscowet</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-26-Genome-Assembly---S.namaycush-Siscowet-Ecotype-with-PacBio-HiFi-Reads-Using-Flye/</guid>
  <pubDate>Thu, 26 Mar 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Software Installation - EGAPx and FCS-GX on Klone</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Installation---EGAPx-and-FCS-GX-on-Klone/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Laura <a href="https://github.com/RobertsLab/resources/issues/2399">asked me to install EGAPx and FCS-GX on Klone</a> (GitHub Issue) so that she can use them for annotation of some existing snow crab RNA-seq data she is working with.</p>
</section>
<section id="methods" class="level1">
<h1>METHODS</h1>
<section id="fcs-gx" class="level2">
<h2 class="anchored" data-anchor-id="fcs-gx">[FCS-GX]</h2>
<p>The steps below follow those outlined in the <a href="https://github.com/ncbi/fcs/wiki/FCS-adaptor-quickstart">FCS-GX documentation</a>.</p>
<section id="get-fcs-python-script" class="level3">
<h3 class="anchored" data-anchor-id="get-fcs-python-script">Get FCS Python script</h3>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /gscratch/srlab/containers <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">curl</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-LO</span> https://github.com/ncbi/fcs/raw/main/dist/fcs.py</span></code></pre></div>
</section>
<section id="get-fcs-gx-singularity-image" class="level3">
<h3 class="anchored" data-anchor-id="get-fcs-gx-singularity-image">Get FCS-GX Singularity image</h3>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">curl</span> https://ftp.ncbi.nlm.nih.gov/genomes/TOOLS/FCS/releases/latest/fcs-gx.sif <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-Lo</span> fcs-gx.sif</span></code></pre></div>
</section>
<section id="get-fcs-gx-databases" class="level3">
<h3 class="anchored" data-anchor-id="get-fcs-gx-databases">Get FCS-GX databases</h3>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p>This downloads ~500GB of data, so be sure you have enough storage space before running this command! Additionally, the download may take a while to complete.</p>
</div>
</div>
</div>
<p><code>module load coenv/python/3.13.11</code></p>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /gscratch/scrubbed/samwhite/databases</span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">SOURCE_DB_MANIFEST</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://ncbi-fcs-gx.s3.amazonaws.com/gxdb/latest/all.manifest"</span></span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">python3</span> /gscratch/srlab/containers/fcs.py <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-6">--image /gscratch/srlab/containers/fcs-gx.sif <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-7">db <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-8">get <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--mft</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$SOURCE_DB_MANIFEST</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-9">--dir <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"./gxdb"</span></span></code></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Installation---EGAPx-and-FCS-GX-on-Klone/20260305-fcs_gx-db-downloads-completed.png" class="img-fluid figure-img" alt="Screenshot of completed DB downloads"></p>
<figcaption>Screenshot of completed DB downloads</figcaption>
</figure>
</div>
<p>Installation was <em>not</em> tested by running an annotation job, but the above steps were successfully completed without issue.</p>
</section>
</section>
<section id="egapx" class="level2">
<h2 class="anchored" data-anchor-id="egapx">EGAPx</h2>
<p>The steps below follow those outlined in the <a href="https://github.com/ncbi/egapx">EGAPx documentation</a>.</p>
<section id="containers-and-scripts" class="level3">
<h3 class="anchored" data-anchor-id="containers-and-scripts">Containers and scripts</h3>
<p>I created an Apptainer (Singularity) container for EGAPx and a script to execute it.</p>
<p>Container definition file: <a href="https://github.com/RobertsLab/code/blob/cc8e19040ee50cb8cbe3bbb0fda6a17619e2beae/apptainer_definition_files/srlab-NCBI-EGAPx.def">srlab-NCBI-EGAPx.def</a> (GitHub)</p>
<ul>
<li><p>This container is based on the EGAPx Dockerfile and includes EGAPx and all dependencies.</p></li>
<li><p>Primarily written using Claude Sonnet 4.6 (gAI agent) with some manual edits to ensure it would build correctly.</p></li>
</ul>
<p>Execution script: <a href="https://github.com/RobertsLab/code/blob/cc8e19040ee50cb8cbe3bbb0fda6a17619e2beae/apptainer_definition_files/run_egapx.sh">run_egapx.sh</a> (GitHub).</p>
<ul>
<li>This script is designed to execute the <code>srlab-NCBI-EGAPx.sif</code> container. It will create a cache directory, set a cache variable, and execute the container.</li>
</ul>
<p>Both have been added to Klone and can be found in the <code>/mmfs1/gscratch/srlab/containers</code> directory.</p>
<p>Container and script have been added to Klone:</p>
<ul>
<li><p><code>/mmfs1/gscratch/srlab/containers/run_egapx.sh</code>: Script to execute <code>srlab-NCBI-EGAPx.sif</code> container. This will create a cache directory, set a cache variable, and bind directories to the container.</p>
<p>Example usage: <code>bash   ./run_egapx.sh \   /opt/egapx/examples/input_D_farinae_small.yaml \   -e singularity \   -w ./work \   -o ./output</code></p>
<p>This requires that the <code>srlab-NCBI-EGAPx.sif</code> container is in the same directory as this script. Both can be copied to other directories, if desired.</p></li>
<li><p><code>/mmfs1/gscratch/srlab/containers/srlab-NCBI-EGAPx.sif</code>: Apptainer (Singularity) container. Can be executed by itself, but is better to use with the <code>run_egapx.sh</code> to ensure cache directory is set.</p>
<p>To see additional help examples for using the <code>srlab-NCBI-EGAPx.sif</code> container:</p>
<p><code>singularity run-help srlab-NCBI-EGAPx.sif</code></p></li>
</ul>
</section>
<section id="test-egapx-container" class="level3">
<h3 class="anchored" data-anchor-id="test-egapx-container">Test EGAPx container</h3>
<p>The built-in test example was used to test the container. The test completed successfully, with all expected output files generated.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Installation---EGAPx-and-FCS-GX-on-Klone/20260305-egapx-test-output.png" class="img-fluid figure-img" alt="Screenshot of EGAPx test output"></p>
<figcaption>Screenshot of EGAPx test output</figcaption>
</figure>
</div>
</section>
</section>
</section>
<section id="conclusion" class="level1">
<h1>CONCLUSION</h1>
<p>EGAPx and FCS-GX have been successfully installed on Klone. Both were tested to ensure they are working correctly, with FCS-GX tested by downloading the databases and EGAPx tested by running the built-in test example.</p>
<p>For info on how to run EGAPx: https://github.com/ncbi/egapx</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>Hyak</category>
  <category>Klone</category>
  <category>EGAPx</category>
  <category>FCS-GX</category>
  <category>annotation</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Installation---EGAPx-and-FCS-GX-on-Klone/</guid>
  <pubDate>Thu, 05 Mar 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>Software Testing - Stevens workflow-annotation Pipeline</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Steven asked me to test out his <a href="https://github.com/sr320/workflow-annotation/tree/main"><code>workflow-annotation</code> pipeline</a> (GitHub) after Hannah encountered an issue yesterday and we <a href="https://github.com/RobertsLab/resources/issues/2404#issuecomment-4000199854">implemented a potential fix</a> (GitHub Issue).</p>
<p>The pipeline was designed to take nucleotide sequences all the way through gene ontology annotation.</p>
<p>After some back-and-forth attempts at troubleshooting, I resorted to asking the Gemini 3 Flash (preview) gAI agent. The suggestion was the lack of an <code>User-Agent</code> in the URL request header was causing the 403 permission denied error Hannah (and I) encountered.</p>
<p>I implemented the suggested changes and tested them.</p>
</section>
<section id="methods" class="level1">
<h1>METHODS</h1>
<p>As input, I used a subset of a FastA file provided by Hannah (see code below).</p>
<section id="set-up-conda-environment" class="level3">
<h3 class="anchored" data-anchor-id="set-up-conda-environment">Set up Conda environment</h3>
</section>
<section id="create-mambaconda-environment" class="level2">
<h2 class="anchored" data-anchor-id="create-mambaconda-environment">Create Mamba/Conda environment</h2>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>Be sure to deactivate any current Python/Conda environments!</p>
<p><code>deactivate</code></p>
<p>and/or</p>
<p><code>conda deactivate</code></p>
</div>
</div>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mamba</span> create <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-2">-n sr320-workflow-annotation <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-3">python=3.11 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-4">diamond <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-5">blast <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-6">requests <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-7">pandas <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-8">goatools <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-9">matplotlib <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-10">-c bioconda <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-11">-c conda-forge <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-12">-y</span></code></pre></div>
</section>
<section id="r-setup" class="level2">
<h2 class="anchored" data-anchor-id="r-setup">R setup</h2>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reticulate)</span></code></pre></div>
</details>
</div>
</section>
<section id="set-r-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-r-variables">Set R variables</h2>
<p>Specifically, sets Conda paths/environments to be used throughout this notebook.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>This was run on my laptop, so the paths are specific to my system. Adjust as needed for your system.</p>
</div>
</div>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CONDA</span></span>
<span id="cb3-2">conda_env_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/programs/miniforge3/envs/sr320-workflow-annotation"</span>)</span>
<span id="cb3-3">conda_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/programs/miniforge3/bin/conda"</span>)</span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WORKING DIRECTORY</span></span>
<span id="cb3-6">working_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/"</span>)</span>
<span id="cb3-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">working_dir =</span> working_dir)</span></code></pre></div>
</details>
</div>
</section>
<section id="load-worfkflow-annotation-conda-environment" class="level2">
<h2 class="anchored" data-anchor-id="load-worfkflow-annotation-conda-environment">Load <a href="https://github.com/sr320/workflow-annotation/tree/main">worfkflow-annotation</a> conda environment</h2>
<p>If this is successful, the first line of output should show that the Python being used is the one in your <a href="https://github.com/sr320/workflow-annotation/tree/main">workflow-annotation</a> conda environment path.</p>
<p>E.g.</p>
<p><code>python:         /home/sam/programs/miniforge3/envs/sr320-workflow-annotation/bin/python</code></p>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">use_condaenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">condaenv =</span> conda_env_name, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conda =</span> conda_path)</span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">py_config</span>()</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>python:         /home/sam/programs/miniforge3/envs/sr320-workflow-annotation/bin/python
libpython:      /home/sam/programs/miniforge3/envs/sr320-workflow-annotation/lib/libpython3.11.so
pythonhome:     /home/sam/programs/miniforge3/envs/sr320-workflow-annotation:/home/sam/programs/miniforge3/envs/sr320-workflow-annotation
version:        3.11.15 | packaged by conda-forge | (main, Mar  5 2026, 16:45:40) [GCC 14.3.0]
numpy:          /home/sam/programs/miniforge3/envs/sr320-workflow-annotation/lib/python3.11/site-packages/numpy
numpy_version:  2.4.2

NOTE: Python version was forced by use_python() function</code></pre>
</div>
</div>
<section id="clone-the-workflow-annotation-pipeline" class="level3">
<h3 class="anchored" data-anchor-id="clone-the-workflow-annotation-pipeline">Clone the workflow-annotation pipeline</h3>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">git</span> clone git@github.com:kubu4/workflow-annotation.git</span></code></pre></div>
</section>
<section id="download-the-fasta" class="level3">
<h3 class="anchored" data-anchor-id="download-the-fasta">Download the FastA</h3>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The full FastA was not utilized. I created a subset for quick testing.</p>
</div>
</div>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/"</span></span>
<span id="cb7-2"></span>
<span id="cb7-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">git</span> clone git@github.com:kubu4/workflow-annotation.git</span>
<span id="cb7-4"></span>
<span id="cb7-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> workflow-annotation</span>
<span id="cb7-6"></span>
<span id="cb7-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">wget</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--quiet</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--continue</span> https://raw.githubusercontent.com/hannahnowers/Seastar-capstone/refs/heads/main/data/derm-protein.fa</span></code></pre></div>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/workflow-annotation"</span></span>
<span id="cb8-2"></span>
<span id="cb8-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> subset-derm-protein.fa</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>&gt;g7941.t1
MQYLPFRGVLCVFWGFLLIETFRPANAGDFALVADLRNGTIYAGSIGQSLADIAPLPLTG
VIRPLAVEYDPVEKMVYWTDVNSLPSPKITRAHVNGSGQMTLVDQLHLPDGLALDVESRL
VYWTDGVLGYIGRTRMNGTGARETIVVGLDQPRAIITDSGFIYWTDWGNSSRIERAGLDG
SNRTTLITGNLVWPNGLFKDGNNLYWCDAKLDKIERSDLLGNNREIVIDLTSYPQIHPFD
LAVYDEYIYWTDWGYTTLIRVHTSGRGEQNYGPSVFQQSGGLHIQKEPNYCNSSPCQNGA
ICIDVINGFSCICPSEHQGITRSENPSGSGPCVNGGTCTTIPGGFTCQCPAGYDGPTCTI
EFIVKKRDREIAGKCKRLH*
&gt;g7942.t1
MVVQVTKTSRDYGKINPELLQNLLDERLRDTFQTEDYPNLLYETYESITTSVLDEICPVT
TRVRTVKPRLPWYDNTIQEERRIPRRLERNWRKSRLDTDYDAFLTQENNV*
&gt;g7943.t1
MKSTSSAILCLFGLFGLGYCGPCETLDPCENGAQCLDFDSIPGYFFCYCPYTFYGTRCEN
RNAACDDNPCMFGGTCLVFNERYECECPSGIYGNHCQANGCANDPCMNGGTCWPFGFSYT
CICSPGYRGENCDE*
&gt;g7944.t1
MATIPIDTCKRHASTKSAETVGVKHLRRRIQTTGPLTIADYMREVLTNPLTGYYMNKDVF
GNKGDFITSPEISQMFGELIALWIIHEWTQLGQMTPLQVVELGPGRGTLADDMLRVFKQF
QHITGNSLSLHLVEVSPKMSQLQEEKLTGQQQSKTDMDQPSVSQDSPAGRCEGDTVAERG
SLSSAYKTSISKTGMPVSWYQSLKEVPKGVSCFIAHEFFDALPIHQFKKTEKGWREVLVD
VDSDDAGSNHLRFVLSPAATPASTVYPQGSDSRGQIEVCPEGGVIVQEMAHRISEHGGMS
LIVDYGHDGTKTDTLRGFKKHKLHDVLCEPGTADLTADVDFSYFRQVVQGKVSTHGPITQ
ESFLKAMGIETRLKMLLKSATGEQRNSLITGCRMLTDPAQMGERFKFFAMMPLNQGTESG
QAKARTPAGFPSVC*</code></pre>
</div>
</div>
</section>
<section id="execute-the-annotation-script" class="level3">
<h3 class="anchored" data-anchor-id="execute-the-annotation-script">Execute the annotation script</h3>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/workflow-annotation"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">export</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PATH</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/programs/miniforge3/envs/sr320-workflow-annotation/bin:</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PATH</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">./blast2slim.sh</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-4">-i subset-derm-protein.fa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-5">--diamond <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-6">--protein <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-7"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> blast_run.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</details>
</div>
</section>
</section>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<section id="check-log" class="level3">
<h3 class="anchored" data-anchor-id="check-log">Check log</h3>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/workflow-annotation/blast_run.log"</span></span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[INFO] Output directory: output/run_20260310_164133
[INFO] Running DIAMOND BLASTP...
diamond v2.1.23.177 (C) Max Planck Society for the Advancement of Science, Benjamin J. Buchfink, University of Tuebingen
Documentation, support and updates available at http://www.diamondsearch.org
Please cite: http://dx.doi.org/10.1038/s41592-021-01101-x Nature Methods (2021)

#CPU threads: 40
Scoring parameters: (Matrix=BLOSUM62 Lambda=0.267 K=0.041 Penalties=11/1)
Temporary directory: output/run_20260310_164133
#Target sequences to report alignments for: 1
Opening the database...  [0.101s]
Database: blastdb/uniprot_sprot.dmnd (type: Diamond database, sequences: 574627, letters: 208482574)
Block size = 2000000000
Opening the input file...  [0s]
Opening the output file...  [0s]
Loading query sequences...  [0s]
Masking queries...  [0.014s]
Algorithm: Double-indexed
Building query histograms...  [0.006s]
Seeking in database...  [0s]
Loading reference sequences...  [0.565s]
Masking reference...  [3.266s]
Initializing temporary storage...  [0s]
Building reference histograms...  [2.46s]
Allocating buffers...  [0s]
Processing query block 1, reference block 1/1, shape 1/2, index chunk 1/4.
Building reference seed array...  [0.838s]
Building query seed array...  [0.007s]
Computing hash join...  [0.055s]
Masking low complexity seeds...  [0.009s]
Searching alignments...  [0.006s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 1/2, index chunk 2/4.
Building reference seed array...  [1.104s]
Building query seed array...  [0.008s]
Computing hash join...  [0.056s]
Masking low complexity seeds...  [0.006s]
Searching alignments...  [0.005s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 1/2, index chunk 3/4.
Building reference seed array...  [1.153s]
Building query seed array...  [0.009s]
Computing hash join...  [0.058s]
Masking low complexity seeds...  [0.003s]
Searching alignments...  [0.004s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 1/2, index chunk 4/4.
Building reference seed array...  [0.817s]
Building query seed array...  [0.006s]
Computing hash join...  [0.056s]
Masking low complexity seeds...  [0.003s]
Searching alignments...  [0.005s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 2/2, index chunk 1/4.
Building reference seed array...  [0.859s]
Building query seed array...  [0.009s]
Computing hash join...  [0.054s]
Masking low complexity seeds...  [0.003s]
Searching alignments...  [0.005s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 2/2, index chunk 2/4.
Building reference seed array...  [1.106s]
Building query seed array...  [0.006s]
Computing hash join...  [0.049s]
Masking low complexity seeds...  [0.004s]
Searching alignments...  [0.003s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 2/2, index chunk 3/4.
Building reference seed array...  [1.038s]
Building query seed array...  [0.007s]
Computing hash join...  [0.05s]
Masking low complexity seeds...  [0.006s]
Searching alignments...  [0.007s]
Deallocating memory...  [0s]
Processing query block 1, reference block 1/1, shape 2/2, index chunk 4/4.
Building reference seed array...  [0.786s]
Building query seed array...  [0.007s]
Computing hash join...  [0.055s]
Masking low complexity seeds...  [0.005s]
Searching alignments...  [0.011s]
Deallocating memory...  [0s]
Deallocating buffers...  [0.036s]
Clearing query masking...  [0s]
Computing alignments...  [0.098s]
Deallocating reference...  [0.017s]
Loading reference sequences...  [0s]
Deallocating buffers...  [0s]
Deallocating queries...  [0s]
Loading query sequences...  [0s]
Closing the input file...  [0s]
Closing the output file...  [0s]
Closing the database...  [0.005s]
Cleaning up...  [0s]
Total time = 14.878s
Reported 2 pairwise alignments, 2 HSPs.
2 queries aligned.
deps ok
output/run_20260310_164133/go-basic.obo: fmt(1.2) rel(2026-01-23) 42,036 Terms; optional_attrs(relationship)
output/run_20260310_164133/goslim_generic.obo: fmt(1.2) rel(go/2026-01-23/subsets/goslim_generic.owl) 207 Terms; optional_attrs(relationship)
[DONE] Wrote:
 - output/run_20260310_164133/annotation_full_go.tsv
 - output/run_20260310_164133/annotation_with_goslim.tsv
[INFO] Summary stats: 2/2 BLAST hits, 2 GO annotations, 2 GO-Slim mappings
[INFO] Generated GO-Slim chart: goslim_chart.png
[INFO] Generated summary report: summary.md
[OK] All done. See output/run_20260310_164133/annotation_with_goslim.tsv and output/run_20260310_164133/summary.md</code></pre>
</div>
</div>
</section>
<section id="confirm-expected-output-files" class="level3">
<h3 class="anchored" data-anchor-id="confirm-expected-output-files">Confirm expected output files</h3>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/workflow-annotation"</span></span>
<span id="cb13-2"></span>
<span id="cb13-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-ltrh</span> output/run_<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span></span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>output/run_20260306_113912:
total 31M
-rw-rw-r-- 1 sam sam  339 Mar  6 11:39 subset-derm-protein.blast.tsv
-rw-rw-r-- 1 sam sam 9.0K Mar  6 11:39 postprocess_uniprot_go.py
-rw-rw-r-- 1 sam sam 2.8K Mar  6 11:39 annotation_full_go.tsv
-rw-rw-r-- 1 sam sam  31M Mar  6 11:39 go-basic.obo
-rw-rw-r-- 1 sam sam 122K Mar  6 11:39 goslim_generic.obo
-rw-rw-r-- 1 sam sam 3.2K Mar  6 11:39 annotation_with_goslim.tsv
-rw-rw-r-- 1 sam sam  296 Mar  6 11:39 summary_stats.json
-rw-rw-r-- 1 sam sam  51K Mar  6 11:39 goslim_chart.png
-rw-rw-r-- 1 sam sam 1.2K Mar  6 11:39 summary.md

output/run_20260306_150323:
total 31M
-rw-rw-r-- 1 sam sam  339 Mar  6 15:03 subset-derm-protein.blast.tsv
-rw-rw-r-- 1 sam sam 9.0K Mar  6 15:03 postprocess_uniprot_go.py
-rw-rw-r-- 1 sam sam 2.8K Mar  6 15:03 annotation_full_go.tsv
-rw-rw-r-- 1 sam sam  31M Mar  6 15:03 go-basic.obo
-rw-rw-r-- 1 sam sam 122K Mar  6 15:03 goslim_generic.obo
-rw-rw-r-- 1 sam sam 3.2K Mar  6 15:03 annotation_with_goslim.tsv
-rw-rw-r-- 1 sam sam  296 Mar  6 15:03 summary_stats.json
-rw-rw-r-- 1 sam sam  51K Mar  6 15:03 goslim_chart.png
-rw-rw-r-- 1 sam sam 1.2K Mar  6 15:03 summary.md

output/run_20260310_164133:
total 31M
-rw-rw-r-- 1 sam sam  339 Mar 10 16:41 subset-derm-protein.blast.tsv
-rw-rw-r-- 1 sam sam 9.0K Mar 10 16:41 postprocess_uniprot_go.py
-rw-rw-r-- 1 sam sam 2.8K Mar 10 16:41 annotation_full_go.tsv
-rw-rw-r-- 1 sam sam  31M Mar 10 16:41 go-basic.obo
-rw-rw-r-- 1 sam sam 122K Mar 10 16:41 goslim_generic.obo
-rw-rw-r-- 1 sam sam 3.2K Mar 10 16:41 annotation_with_goslim.tsv
-rw-rw-r-- 1 sam sam  296 Mar 10 16:41 summary_stats.json
-rw-rw-r-- 1 sam sam  51K Mar 10 16:41 goslim_chart.png
-rw-rw-r-- 1 sam sam 1.2K Mar 10 16:41 summary.md</code></pre>
</div>
</div>
</section>
<section id="peek-at-output-files" class="level3">
<h3 class="anchored" data-anchor-id="peek-at-output-files">Peek at output files</h3>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/sam/gitrepos/RobertsLab/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/workflow-annotation/output"</span></span>
<span id="cb15-2"></span>
<span id="cb15-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">find</span> run_<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>/ <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-maxdepth</span> 1 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-type</span> f ! <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-name</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*.png"</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-exec</span> head {} +</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>==&gt; run_20260306_113912/annotation_with_goslim.tsv &lt;==
query   accession   id  reviewed    protein_name    organism    pident  length  evalue  bitscore    title   go_ids  go_bp   go_cc   go_mf   goslim_ids  goslim_names
g7941.t1    C0HL13  LRP2_PIG        Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]   GO:0016192; GO:0022414; GO:0048856; GO:0050877; GO:0055085  vesicle-mediated transport; reproductive process; anatomical structure development; nervous system process; transmembrane transport
g7944.t1    Q7L592  NDUF7_HUMAN     Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]    GO:0003824; GO:0005615; GO:0005739; GO:0016740; GO:0043226; GO:0065003; GO:0140096  catalytic activity; extracellular space; mitochondrion; transferase activity; organelle; protein-containing complex assembly; catalytic activity, acting on a protein

==&gt; run_20260306_113912/postprocess_uniprot_go.py &lt;==
import sys, os, time, json, math
import pandas as pd
import requests
from pathlib import Path

BLAST_TSV = sys.argv[1]
OUTDIR = sys.argv[2]

os.makedirs(OUTDIR, exist_ok=True)
hits = pd.read_csv(BLAST_TSV, sep='\t', header=None,

==&gt; run_20260306_113912/summary_stats.json &lt;==
{"total_sequences": 2, "blast_hits": 2, "go_matches": 2, "goslim_matches": 2, "goslim_counts": {"vesicle-mediated transport": 1, "reproductive process": 1, "anatomical structure development": 1, "nervous system process": 1, "transmembrane transport": 1, "protein-containing complex assembly": 1}}
==&gt; run_20260306_113912/subset-derm-protein.blast.tsv &lt;==
g7941.t1    sp|C0HL13|LRP2_PIG  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1
g7944.t1    sp|Q7L592|NDUF7_HUMAN   51.8    415 8.53e-141   412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1

==&gt; run_20260306_113912/summary.md &lt;==
# Annotation Summary Report

## Job Information
- **Input file**: subset-derm-protein.fa
- **Start time**: 2026-03-06 11:39:12
- **End time**: 2026-03-06 11:39:39
- **Duration**: 0h 0m 27s
- **CPUs used**: 40
- **Tool**: DIAMOND BLASTP (protein)


==&gt; run_20260306_113912/goslim_generic.obo &lt;==
format-version: 1.2
data-version: go/releases/2026-01-23/subsets/goslim_generic.owl
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260306_113912/go-basic.obo &lt;==
format-version: 1.2
data-version: releases/2026-01-23
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260306_113912/annotation_full_go.tsv &lt;==
query   accession   pident  length  evalue  bitscore    title   id  Reviewed    protein_name    organism    go_ids  go_bp   go_cc   go_mf
g7941.t1    C0HL13  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   LRP2_PIG    reviewed    Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]
g7944.t1    Q7L592  51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    NDUF7_HUMAN reviewed    Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]

==&gt; run_20260306_150323/annotation_with_goslim.tsv &lt;==
query   accession   id  reviewed    protein_name    organism    pident  length  evalue  bitscore    title   go_ids  go_bp   go_cc   go_mf   goslim_ids  goslim_names
g7941.t1    C0HL13  LRP2_PIG        Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]   GO:0016192; GO:0022414; GO:0048856; GO:0050877; GO:0055085  vesicle-mediated transport; reproductive process; anatomical structure development; nervous system process; transmembrane transport
g7944.t1    Q7L592  NDUF7_HUMAN     Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]    GO:0003824; GO:0005615; GO:0005739; GO:0016740; GO:0043226; GO:0065003; GO:0140096  catalytic activity; extracellular space; mitochondrion; transferase activity; organelle; protein-containing complex assembly; catalytic activity, acting on a protein

==&gt; run_20260306_150323/postprocess_uniprot_go.py &lt;==
import sys, os, time, json, math
import pandas as pd
import requests
from pathlib import Path

BLAST_TSV = sys.argv[1]
OUTDIR = sys.argv[2]

os.makedirs(OUTDIR, exist_ok=True)
hits = pd.read_csv(BLAST_TSV, sep='\t', header=None,

==&gt; run_20260306_150323/summary_stats.json &lt;==
{"total_sequences": 2, "blast_hits": 2, "go_matches": 2, "goslim_matches": 2, "goslim_counts": {"vesicle-mediated transport": 1, "reproductive process": 1, "anatomical structure development": 1, "nervous system process": 1, "transmembrane transport": 1, "protein-containing complex assembly": 1}}
==&gt; run_20260306_150323/subset-derm-protein.blast.tsv &lt;==
g7941.t1    sp|C0HL13|LRP2_PIG  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1
g7944.t1    sp|Q7L592|NDUF7_HUMAN   51.8    415 8.53e-141   412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1

==&gt; run_20260306_150323/summary.md &lt;==
# Annotation Summary Report

## Job Information
- **Input file**: subset-derm-protein.fa
- **Start time**: 2026-03-06 15:03:23
- **End time**: 2026-03-06 15:03:42
- **Duration**: 0h 0m 19s
- **CPUs used**: 40
- **Tool**: DIAMOND BLASTP (protein)


==&gt; run_20260306_150323/goslim_generic.obo &lt;==
format-version: 1.2
data-version: go/releases/2026-01-23/subsets/goslim_generic.owl
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260306_150323/go-basic.obo &lt;==
format-version: 1.2
data-version: releases/2026-01-23
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260306_150323/annotation_full_go.tsv &lt;==
query   accession   pident  length  evalue  bitscore    title   id  Reviewed    protein_name    organism    go_ids  go_bp   go_cc   go_mf
g7941.t1    C0HL13  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   LRP2_PIG    reviewed    Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]
g7944.t1    Q7L592  51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    NDUF7_HUMAN reviewed    Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]

==&gt; run_20260310_164133/annotation_with_goslim.tsv &lt;==
query   accession   id  reviewed    protein_name    organism    pident  length  evalue  bitscore    title   go_ids  go_bp   go_cc   go_mf   goslim_ids  goslim_names
g7941.t1    C0HL13  LRP2_PIG        Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]   GO:0016192; GO:0022414; GO:0048856; GO:0050877; GO:0055085  vesicle-mediated transport; reproductive process; anatomical structure development; nervous system process; transmembrane transport
g7944.t1    Q7L592  NDUF7_HUMAN     Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]    GO:0003824; GO:0005615; GO:0005739; GO:0016740; GO:0043226; GO:0065003; GO:0140096  catalytic activity; extracellular space; mitochondrion; transferase activity; organelle; protein-containing complex assembly; catalytic activity, acting on a protein

==&gt; run_20260310_164133/postprocess_uniprot_go.py &lt;==
import sys, os, time, json, math
import pandas as pd
import requests
from pathlib import Path

BLAST_TSV = sys.argv[1]
OUTDIR = sys.argv[2]

os.makedirs(OUTDIR, exist_ok=True)
hits = pd.read_csv(BLAST_TSV, sep='\t', header=None,

==&gt; run_20260310_164133/summary_stats.json &lt;==
{"total_sequences": 2, "blast_hits": 2, "go_matches": 2, "goslim_matches": 2, "goslim_counts": {"vesicle-mediated transport": 1, "reproductive process": 1, "anatomical structure development": 1, "nervous system process": 1, "transmembrane transport": 1, "protein-containing complex assembly": 1}}
==&gt; run_20260310_164133/subset-derm-protein.blast.tsv &lt;==
g7941.t1    sp|C0HL13|LRP2_PIG  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1
g7944.t1    sp|Q7L592|NDUF7_HUMAN   51.8    415 8.53e-141   412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1

==&gt; run_20260310_164133/summary.md &lt;==
# Annotation Summary Report

## Job Information
- **Input file**: subset-derm-protein.fa
- **Start time**: 2026-03-10 16:41:33
- **End time**: 2026-03-10 16:41:54
- **Duration**: 0h 0m 21s
- **CPUs used**: 40
- **Tool**: DIAMOND BLASTP (protein)


==&gt; run_20260310_164133/goslim_generic.obo &lt;==
format-version: 1.2
data-version: go/releases/2026-01-23/subsets/goslim_generic.owl
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260310_164133/go-basic.obo &lt;==
format-version: 1.2
data-version: releases/2026-01-23
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_obsoletion_candidate "Terms planned for obsoletion"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"

==&gt; run_20260310_164133/annotation_full_go.tsv &lt;==
query   accession   pident  length  evalue  bitscore    title   id  Reviewed    protein_name    organism    go_ids  go_bp   go_cc   go_mf
g7941.t1    C0HL13  28.9    294 2.34e-31    129 sp|C0HL13|LRP2_PIG Low-density lipoprotein receptor-related protein 2 OS=Sus scrofa OX=9823 GN=LRP2 PE=1 SV=1   LRP2_PIG    reviewed    Low-density lipoprotein receptor-related protein 2 (LRP-2) (Glycoprotein 330) (gp330) (Megalin) Sus scrofa (Pig)    GO:0001843; GO:0003139; GO:0003148; GO:0003223; GO:0005509; GO:0005905; GO:0006898; GO:0007605; GO:0008584; GO:0009897; GO:0016324; GO:0017124; GO:0030001; GO:0030424; GO:0030425; GO:0030514; GO:0031526; GO:0031904; GO:0043235; GO:0050769; GO:0051087; GO:0060068; GO:0060982; GO:0061156; GO:0070447; GO:0140058; GO:1904447; GO:1905167  coronary artery morphogenesis [GO:0060982]; folate import across plasma membrane [GO:1904447]; male gonad development [GO:0008584]; metal ion transport [GO:0030001]; negative regulation of BMP signaling pathway [GO:0030514]; neural tube closure [GO:0001843]; neuron projection arborization [GO:0140058]; outflow tract septum morphogenesis [GO:0003148]; positive regulation of lysosomal protein catabolic process [GO:1905167]; positive regulation of neurogenesis [GO:0050769]; positive regulation of oligodendrocyte progenitor proliferation [GO:0070447]; pulmonary artery morphogenesis [GO:0061156]; receptor-mediated endocytosis [GO:0006898]; secondary heart field specification [GO:0003139]; sensory perception of sound [GO:0007605]; vagina development [GO:0060068]; ventricular compact myocardium morphogenesis [GO:0003223]   apical plasma membrane [GO:0016324]; axon [GO:0030424]; brush border membrane [GO:0031526]; clathrin-coated pit [GO:0005905]; dendrite [GO:0030425]; endosome lumen [GO:0031904]; external side of plasma membrane [GO:0009897]; receptor complex [GO:0043235]  calcium ion binding [GO:0005509]; protein-folding chaperone binding [GO:0051087]; SH3 domain binding [GO:0017124]
g7944.t1    Q7L592  51.8    415 8.529999999999999e-141  412 sp|Q7L592|NDUF7_HUMAN Protein arginine methyltransferase NDUFAF7, mitochondrial OS=Homo sapiens OX=9606 GN=NDUFAF7 PE=1 SV=1    NDUF7_HUMAN reviewed    Protein arginine methyltransferase NDUFAF7, mitochondrial (EC 2.1.1.320) (NADH dehydrogenase [ubiquinone] complex I, assembly factor 7) (Protein midA homolog)  Homo sapiens (Human)    GO:0005615; GO:0005739; GO:0005759; GO:0008168; GO:0019899; GO:0019918; GO:0032981; GO:0035243  mitochondrial respiratory chain complex I assembly [GO:0032981]; peptidyl-arginine methylation, to symmetrical-dimethyl arginine [GO:0019918]   extracellular space [GO:0005615]; mitochondrial matrix [GO:0005759]; mitochondrion [GO:0005739] enzyme binding [GO:0019899]; methyltransferase activity [GO:0008168]; protein-arginine omega-N symmetric methyltransferase activity [GO:0035243]</code></pre>
</div>
</div>
</section>
</section>
<section id="discussion" class="level1">
<h1>DISCUSSION</h1>
<p>Looks like the fix worked! Everything is as expected.</p>


</section>

 ]]></description>
  <category>2026</category>
  <category>software</category>
  <category>annotation</category>
  <category>workflow-annotation</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-03-05-Software-Testing---Stevens-workflow-annotation-Pipeline/</guid>
  <pubDate>Thu, 05 Mar 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>De Novo Transcriptome Assembly and Annotation - E5 A.pulchra RNA-seq Using Trinity and PASA</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-A.pulchra-RNA-seq-Using-Trinity-and-PASA/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotation for <em>A.pulchra</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a>, as part of the E5 <a href="https://github.com/urol-e5/timeseries_molecular">timeseries_molecular project</a>. This produced an updated genome annotation that incorporates the RNA-seq data, including alternative splicing information. However, it’s important to note that the resulting GFF/BED files will <em>not</em> contain any annotations from the original genome GFF which did not have any support from RNA-seq alignments!</p>
<p>Thus, the resulting PASA annotations will be a <em>subset</em> of the original genome annotations, but with updated gene models based on the RNA-seq data. The PASA pipeline will merge the de novo and genome-guided transcriptome assemblies, clean the transcripts, and update the genome annotations with alternative splicing information where supported by the data.</p>
<p>Due to large file sizes, the majority of important output files are <em>not</em> availabe on GitHub, but can be accessed on Gannet here:</p>
<p><a href="https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/">https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/</a></p>
<p>Primary products:</p>
<ul>
<li>Trinity de-novo assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/de_novo_assembly/apul-denovo-Trinity.fasta</li>
<li>Trinity genome-guided assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/genome_guided_assembly/apul-GG-Trinity.fasta</li>
<li>PASA final GFF: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/PASA/apul-PASA.gff3</li>
<li>PASA final BED: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/00.30-D-Apul-transcriptome-assembly-Trinity/PASA/apul-PASA.bed</li>
</ul>
<p>The markdown below was produced from the original Rmd script:</p>
<ul>
<li><a href="https://github.com/urol-e5/timeseries_molecular/blob/1c9153b836d2ebba3d7aa22e896fa71749f28d8b/D-Apul/code/00.30-D-Apul-transcriptome-assembly-Trinity.Rmd">00.30-D-Apul-transcriptome-assembly-Trinity.Rmd</a> (GitHub)</li>
</ul>
<p>Not described below is the access to the PASA web portal, which allows the user to browse the PASA results in a user-friendly interface. This can be accessed here:</p>
<ul>
<li>http://gannet.fish.washington.edu:9000/</li>
</ul>
<p>Enter <code>apul_pasa</code> as the database name. If this is your first time using the database, it will take many minutes for the data to load (the MySQL files behind the scenes are ~10GB in size, so it takes a while to process). After initial acces, the data is cached and access is much faster.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-A.pulchra-RNA-seq-Using-Trinity-and-PASA/20260227-apul-pasa_web.png" class="img-fluid figure-img"></p>
<figcaption>Screenshot of apul_pasa web portal on Gannet</figcaption>
</figure>
</div>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotaiton for <em>A.pulchra</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a> pipeline, as well as alternative isoform identification. This pipeline relies on both <em>de novo</em> and genome-guided transcriptome assemblies with <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a>.</p>
<p>The key steps include: 1. <strong>De Novo Assembly</strong> and <strong>Genome-Guided Assembly</strong>: Using <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> to assemble transcripts directly from RNA-seq reads. 2. <strong>PASA Pipeline</strong>: Utilizing <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> to merge the assemblies, clean transcripts, and update genome annotations with alternative splicing information.</p>
<p><strong>Programs Used:</strong> - <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> - Transcriptome assembly. - <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> - Annotation update and transcript assembly refinement. - <a href="https://github.com/NBISweden/AGAT">AGAT</a> - GFF/GTF toolkit for annotation merging and conversion. - <a href="https://apptainer.org/">Singularity (Apptainer)</a> - Container platform used to run assembly pipelines.</p>
<section id="expected-outputs" class="level2">
<h2 class="anchored" data-anchor-id="expected-outputs">1.1 Expected outputs</h2>
<p><strong>TRINITY</strong>:</p>
<ul>
<li>FastA: <em>De novo</em> transcriptome assembly.</li>
<li>FastA: Genome-guided transcriptome assembly.</li>
</ul>
<p><strong>PASA</strong>:</p>
<ul>
<li>GFF3: Genome annotations produced by PASA pipeline in GFF3.</li>
<li>BED: Genome annotations produced by PASA pipeline in BED format.</li>
</ul>
</section>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries-and-markdown-settings" class="level2">
<h2 class="anchored" data-anchor-id="libraries-and-markdown-settings">2.1 Libraries and markdown settings</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb1-2">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb1-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb1-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prevents appending '##' to beginning of lines in code output</span></span>
<span id="cb1-8">)</span></code></pre></div>
</section>
<section id="set-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-variables">2.2 Set variables</h2>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DIRECTORIES</span></span>
<span id="cb2-2">top_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output"</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"00.30-D-Apul-transcriptome-assembly-Trinity"</span>)</span>
<span id="cb2-5">de_novo_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"de_novo_assembly"</span>)</span>
<span id="cb2-6">genome_guided_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"genome_guided_assembly"</span>)</span>
<span id="cb2-7">pasa_container_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"containers"</span>)</span>
<span id="cb2-8">PASA_HOME <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb2-9">pasa_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA"</span>)</span>
<span id="cb2-10">stringtie_gtf_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-D-Apul-RNAseq-alignment-HiSat2"</span>)</span>
<span id="cb2-11">trimmed_reads_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01.00-D-Apul-RNAseq-trimming-fastp-FastQC-MultiQC"</span>)</span>
<span id="cb2-12"></span>
<span id="cb2-13"></span>
<span id="cb2-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FILES</span></span>
<span id="cb2-15">bam_alignment <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-D-Apul-RNAseq-alignment-HiSat2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sorted-bams-merged.bam"</span>)</span>
<span id="cb2-16"></span>
<span id="cb2-17"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## Path for genome will be relative to PASA output dir</span></span>
<span id="cb2-18">genome_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Apulchra-genome.fa"</span>)</span>
<span id="cb2-19">genome_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Apulchra-genome.gff"</span>)</span>
<span id="cb2-20">denovo_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apul-denovo-Trinity"</span></span>
<span id="cb2-21">genome_guided_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apul-GG-Trinity"</span></span>
<span id="cb2-22">pasa_bed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apul-PASA.bed"</span></span>
<span id="cb2-23">pasa_container <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb2-24">pasa_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apul-PASA.gff3"</span></span>
<span id="cb2-25">stringtie_gtf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(stringtie_gtf_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Apulchra-genome.stringtie.gtf"</span>)</span>
<span id="cb2-26"></span>
<span id="cb2-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SETTINGS</span></span>
<span id="cb2-28"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## THREADS</span></span>
<span id="cb2-29">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb2-30"></span>
<span id="cb2-31"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## MAX RAM</span></span>
<span id="cb2-32">max_ram <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb2-33"></span>
<span id="cb2-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROGRAMS</span></span>
<span id="cb2-35">samtools <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools-1.12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools"</span>)</span>
<span id="cb2-36"></span>
<span id="cb2-37"></span>
<span id="cb2-38"></span>
<span id="cb2-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FORMATTING</span></span>
<span id="cb2-40">line <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-----------------------------------------------"</span></span>
<span id="cb2-41"></span>
<span id="cb2-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb2-43"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb2-44">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bam_alignment =</span> bam_alignment,</span>
<span id="cb2-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">denovo_assembly_name =</span> denovo_assembly_name,</span>
<span id="cb2-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">de_novo_output_dir =</span> de_novo_output_dir,</span>
<span id="cb2-47">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_fasta =</span> genome_fasta,</span>
<span id="cb2-48">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_gff =</span> genome_gff,</span>
<span id="cb2-49">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_assembly_name =</span> genome_guided_assembly_name,</span>
<span id="cb2-50">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_output_dir =</span> genome_guided_output_dir,</span>
<span id="cb2-51">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line =</span> line,</span>
<span id="cb2-52">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_ram =</span> max_ram,</span>
<span id="cb2-53">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb2-54">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">top_output_dir =</span> top_output_dir,</span>
<span id="cb2-55">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container =</span> pasa_container,</span>
<span id="cb2-56">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container_dir =</span> pasa_container_dir,</span>
<span id="cb2-57">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_bed =</span> pasa_bed,</span>
<span id="cb2-58">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_gff =</span> pasa_gff,</span>
<span id="cb2-59">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">PASA_HOME =</span> PASA_HOME,</span>
<span id="cb2-60">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_output_dir =</span> pasa_output_dir,</span>
<span id="cb2-61">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">samtools =</span> samtools,</span>
<span id="cb2-62">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf_dir =</span> stringtie_gtf_dir,</span>
<span id="cb2-63">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf =</span> stringtie_gtf,</span>
<span id="cb2-64">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads,</span>
<span id="cb2-65">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">trimmed_reads_dir =</span> trimmed_reads_dir</span>
<span id="cb2-66">)</span></code></pre></div>
</section>
</section>
<section id="de-novo-assembly" class="level1">
<h1>3 DE NOVO ASSEMBLY</h1>
<section id="run-trinity" class="level2">
<h2 class="anchored" data-anchor-id="run-trinity">3.1 Run Trinity</h2>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/D-Apul/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<section id="set-bash-variables" class="level3">
<h3 class="anchored" data-anchor-id="set-bash-variables">3.1.1 Set Bash variables</h3>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Directories</span></span>
<span id="cb3-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">top_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output"</span></span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/00.30-D-Apul-transcriptome-assembly-Trinity"</span></span>
<span id="cb3-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">de_novo_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/de_novo_assembly"</span></span>
<span id="cb3-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/genome_guided_assembly"</span></span>
<span id="cb3-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">trimmed_reads_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/01.00-D-Apul-RNAseq-trimming-fastp-FastQC-MultiQC"</span></span>
<span id="cb3-8"></span>
<span id="cb3-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PASA INPUT FILES</span></span>
<span id="cb3-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">####### NEED TO BE RELATIVE TO PASA SUBDIRECTORY #######</span></span>
<span id="cb3-11"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_fasta</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Apulchra-genome.fa"</span></span>
<span id="cb3-12"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_gff</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Apulchra-genome.gff3"</span></span>
<span id="cb3-13"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_container</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb3-14"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PASA_HOME</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb3-15"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">stringtie_gtf</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../02.20-D-Apul-RNAseq-alignment-HiSat2/Apulchra-genome.stringtie.gtf"</span></span>
<span id="cb3-16"></span>
<span id="cb3-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## THREADS</span></span>
<span id="cb3-18"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">threads</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb3-19"></span>
<span id="cb3-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## MAX RAM</span></span>
<span id="cb3-21"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">max_ram</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb3-22"></span>
<span id="cb3-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directoy, if it doesn't exist</span></span>
<span id="cb3-24"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb3-25"></span>
<span id="cb3-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Inititalize arrays</span></span>
<span id="cb3-27"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-28"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-29"></span>
<span id="cb3-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Variables for R1/R2 lists</span></span>
<span id="cb3-31"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-32"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-33"></span>
<span id="cb3-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R1 files</span></span>
<span id="cb3-35"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R1_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-36"></span>
<span id="cb3-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R2 files</span></span>
<span id="cb3-38"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R2_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-39"></span>
<span id="cb3-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create list of fastq files used in analysis</span></span>
<span id="cb3-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Uses parameter substitution to strip leading path from filename</span></span>
<span id="cb3-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">!</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-f</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/fastq.list.txt"</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb3-43">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fastq <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fq.gz</span>
<span id="cb3-44">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb3-45">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastq</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">##</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/fastq.list.txt</span>
<span id="cb3-46">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span>
<span id="cb3-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span>
<span id="cb3-48"></span>
<span id="cb3-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create comma-separated lists of FastQ reads</span></span>
<span id="cb3-50"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-51"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div>
</section>
<section id="run-trinity-singularity-image." class="level3">
<h3 class="anchored" data-anchor-id="run-trinity-singularity-image.">3.1.2 Run Trinity Singularity image.</h3>
<p>Used “stranded” setting (–SS_lib_type).</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-3">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-4">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-5">--seqType fq <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-9">--left <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-10">--right <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-11">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-12">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-13"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-14">2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
</section>
<section id="rename-output-files" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files">3.2 Rename output files</h2>
<section id="rename-fasta" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta">3.2.1 Rename FastA</h3>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log">3.2.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.gene_trans_map</span>
<span id="cb6-3"></span>
<span id="cb6-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.log</span></code></pre></div>
</section>
<section id="assembly-stats" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats">3.2.3 Assembly stats</h3>
<section id="run-trinity-singularity-image.-1" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-1">3.2.3.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-4">../output/00.30-D-Apul-transcriptome-assembly-Trinity/de_novo_assembly/apul-denovo-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-D-Apul-transcriptome-assembly-Trinity/de_novo_assembly/apul-denovo-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
<section id="create-fasta-index" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index">3.3 Create FastA index</h2>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb8-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums" class="level2">
<h2 class="anchored" data-anchor-id="checksums">3.4 Checksums</h2>
<div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>f5a8213c889f1fdbd8a48b5047e8d797  apul-denovo-Trinity.fasta</code></pre>
</section>
</section>
<section id="genome-guided-assembly" class="level1">
<h1>4 GENOME-GUIDED ASSEMBLY</h1>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/D-Apul/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-2">-B /home <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-3">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-4">--genome_guided_bam ../output/02.20-D-Apul-RNAseq-alignment-HiSat2/sorted-bams-merged.bam <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-5">--genome_guided_max_intron 10000 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-9">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-10">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-11"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
<section id="rename-output-files-1" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files-1">4.1 Rename output files</h2>
<section id="rename-fasta-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta-1">4.1.1 Rename FastA</h3>
<div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb12-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb12-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log-1">4.1.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.gene_trans_map</span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.log</span></code></pre></div>
</section>
</section>
<section id="create-fasta-index-1" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index-1">4.2 Create FastA index</h2>
<div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb14-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums-1" class="level2">
<h2 class="anchored" data-anchor-id="checksums-1">4.3 Checksums</h2>
<div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span></span>
<span id="cb15-2"></span>
<span id="cb15-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>44c4f7b6493239377cf02d9f9d5fb15f  apul-GG-Trinity.fasta</code></pre>
<section id="assembly-stats-1" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats-1">4.3.1 Assembly stats</h3>
<section id="run-trinity-singularity-image.-2" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-2">4.3.1.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb17-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-4">../output/00.30-D-Apul-transcriptome-assembly-Trinity/genome_guided_assembly/apul-GG-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-D-Apul-transcriptome-assembly-Trinity/genome_guided_assembly/apul-GG-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
</section>
<section id="pasa-pipeline" class="level1">
<h1>5 PASA PIPELINE</h1>
<section id="concatenate-trinity-assemblies" class="level2">
<h2 class="anchored" data-anchor-id="concatenate-trinity-assemblies">5.1 Concatenate Trinity assemblies</h2>
<div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta</span></code></pre></div>
<section id="confirm-counts" class="level3">
<h3 class="anchored" data-anchor-id="confirm-counts">5.1.1 Confirm counts</h3>
<div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Count transcripts in each file</span></span>
<span id="cb19-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">denovo_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-5"></span>
<span id="cb19-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate sum of first two counts</span></span>
<span id="cb19-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((denovo_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count))</span></span>
<span id="cb19-8"></span>
<span id="cb19-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compare sum to PASA count</span></span>
<span id="cb19-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"De novo count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$denovo_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genome-guided count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$genome_guided_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sum: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-14"></span>
<span id="cb19-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-eq</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb19-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✓ Counts match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb19-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✗ Counts do not match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> ≠ </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> (difference: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((pasa_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum))</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb19-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span></code></pre></div>
<pre><code>De novo count: 1854167
Genome-guided count: 661982
Sum: 2516149
PASA count: 2516149
✓ Counts match: 2516149 = 2516149</code></pre>
</section>
</section>
<section id="extract-transcript-accessions" class="level2">
<h2 class="anchored" data-anchor-id="extract-transcript-accessions">5.2 Extract transcript accessions</h2>
<div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb21-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-3">-e <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/misc_utilities/accession_extractor.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span>
<span id="cb21-7"></span>
<span id="cb21-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span></code></pre></div>
</section>
<section id="clean-transcripts" class="level2">
<h2 class="anchored" data-anchor-id="clean-transcripts">5.3 Clean transcripts</h2>
<div class="sourceCode" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb22-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb22-2"></span>
<span id="cb22-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-4">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-5">-e <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-6">--env USER=<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$USER</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-8"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/bin/seqclean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-9">transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-10">-c 16</span></code></pre></div>
</section>
<section id="pasa-assembly" class="level2">
<h2 class="anchored" data-anchor-id="pasa-assembly">5.4 PASA Assembly</h2>
<section id="fix-schema-key-length" class="level3">
<h3 class="anchored" data-anchor-id="fix-schema-key-length">5.4.1 Fix schema key length</h3>
<div class="sourceCode" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb23-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb23-2"></span>
<span id="cb23-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#### Fix schema key length issue ####</span></span>
<span id="cb23-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-5">cat <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> cdna_alignment_mysqlschema</span>
<span id="cb23-7"></span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix all variations of gene_id and model_id indexes</span></span>
<span id="cb23-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_id_idx (gene_id)/KEY gene_id_idx (gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY mod_idx (model_id)/KEY mod_idx (model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(gene_id)/(gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(model_id)/(model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_idx (annotation_version,gene_id)/KEY gene_idx (annotation_version,gene_id(255))/g'</span> cdna_alignment_mysqlschema</span></code></pre></div>
</section>
<section id="run-pasa-assembly-pipeline" class="level3">
<h3 class="anchored" data-anchor-id="run-pasa-assembly-pipeline">5.4.2 Run PASA Assembly Pipeline</h3>
<p>This was executed outside of RStudio due to the verbose output, which will cause RStudio to crash.</p>
<div class="sourceCode" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb24-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-8">--config alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-9">--create <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-10">--run <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-11">--genome <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-12">--transcripts transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-13">--trans_gtf <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${stringtie_gtf}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-14">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-15">-T <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-16">-u transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-17">--ALIGNERS blat,gmap,minimap2 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-18">--TDN tdn.accs <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-19">--transcribed_is_aligned_orient <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-20">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-21">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-22">--annots <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-23">--TRANSDECODER <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-24">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="alternative-splicing" class="level3">
<h3 class="anchored" data-anchor-id="alternative-splicing">5.4.3 Alternative Splicing</h3>
<p>This doesn’t seem to have run during the assembly phase, so ran separately.</p>
<div class="sourceCode" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb25-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-8">-c alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-9">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-10">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-11">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-12">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="update-annotations" class="level3">
<h3 class="anchored" data-anchor-id="update-annotations">5.4.4 Update annotations</h3>
<p>Now includes alternative splicing info.</p>
<p>Uses output GFF3 from initial annotations as annotation <em>input</em>.</p>
<div class="sourceCode" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb26-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-8">-c annotCompare.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-9">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-10">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-11">--annots apul_pasa.gene_structures_post_PASA_updates.2550130.gff3 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-12">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-13">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-14">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
</section>
</section>
<section id="pasa-outputs" class="level1">
<h1>6 PASA OUTPUTS</h1>
<section id="generate-checksums" class="level2">
<h2 class="anchored" data-anchor-id="generate-checksums">6.1 Generate checksums</h2>
<div class="sourceCode" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb27-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-2"></span>
<span id="cb27-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> apul_pasa.gene_structures_post_PASA_updates.3761114.gff3 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> apul_pasa.gene_structures_post_PASA_updates.3761114.gff3.md5</span>
<span id="cb27-4"></span>
<span id="cb27-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> apul_pasa.gene_structures_post_PASA_updates.3761114.bed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> apul_pasa.gene_structures_post_PASA_updates.3761114.bed.md5</span></code></pre></div>
<pre><code>66809687062caaf68e2a5bf118a77398  apul_pasa.gene_structures_post_PASA_updates.3761114.gff3
341d5aa495756bafcc5753722e8c93d4  apul_pasa.gene_structures_post_PASA_updates.3761114.bed</code></pre>
</section>
<section id="rename-outputs" class="level2">
<h2 class="anchored" data-anchor-id="rename-outputs">6.2 Rename outputs</h2>
<div class="sourceCode" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb29-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> apul_pasa.gene_structures_post_PASA_updates.3761114.gff3 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-3"></span>
<span id="cb29-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> apul_pasa.gene_structures_post_PASA_updates.3761114.bed <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-5"></span>
<span id="cb29-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb29-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span></code></pre></div>
<pre><code>66809687062caaf68e2a5bf118a77398  apul-PASA.gff3
341d5aa495756bafcc5753722e8c93d4  apul-PASA.bed</code></pre>
</section>
<section id="gff3-preview" class="level2">
<h2 class="anchored" data-anchor-id="gff3-preview">6.3 GFF3 Preview</h2>
<div class="sourceCode" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb31-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 50 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span></code></pre></div>
<pre><code># ORIGINAL: FUN_044110-T1 original gene structure, not modified by PASA
ptg000092l  funannotate gene    6557    14524   .   +   .   ID=FUN_044110;Name=FUN_044110-T1
ptg000092l  funannotate mRNA    6557    14524   .   +   .   ID=FUN_044110-T1;Parent=FUN_044110;Name=FUN_044110-T1
ptg000092l  funannotate exon    6557    6575    .   +   .   ID=FUN_044110-T1.exon1;Parent=FUN_044110-T1
ptg000092l  funannotate CDS 6557    6575    .   +   0   ID=FUN_044110-T1.cds.1;Parent=FUN_044110-T1
ptg000092l  funannotate exon    8536    8657    .   +   .   ID=FUN_044110-T1.exon2;Parent=FUN_044110-T1
ptg000092l  funannotate CDS 8536    8657    .   +   2   ID=FUN_044110-T1.cds.2;Parent=FUN_044110-T1
ptg000092l  funannotate exon    9330    9410    .   +   .   ID=FUN_044110-T1.exon3;Parent=FUN_044110-T1
ptg000092l  funannotate CDS 9330    9410    .   +   0   ID=FUN_044110-T1.cds.3;Parent=FUN_044110-T1
ptg000092l  funannotate exon    10230   10307   .   +   .   ID=FUN_044110-T1.exon4;Parent=FUN_044110-T1
ptg000092l  funannotate CDS 10230   10307   .   +   0   ID=FUN_044110-T1.cds.4;Parent=FUN_044110-T1
ptg000092l  funannotate exon    12512   14524   .   +   .   ID=FUN_044110-T1.exon5;Parent=FUN_044110-T1
ptg000092l  funannotate CDS 12512   14524   .   +   0   ID=FUN_044110-T1.cds.5;Parent=FUN_044110-T1


#PROT FUN_044110-T1 FUN_044110  MLIFNRGELLFLPIRNVLCMMPQGYKNALPGYKDLYLSQAITEEVHNMFSTGIDCGVSSFKHGPSLSLLALDKKLCVIALIESLFQVRGLPFCARSLNKTALSTQSSLMSPHYLPLQSNQLGQVKPTFQLSEPGRSDENFSDTDPKFICKHPRIHVPTSVGVVQPSVRRRTSDNPVSPTESRSESPLFSLLHEPETSVATTTLGDPTNQLVSRTLAKSNVNQLSAQDIPNDSSVQQNSLESHLTPLNQPVDPDPLLPESIDGTSSIEIDSSKESTKSSRTVTLSESEMSPQLRLDLEEIRKFYSLPINLNRDGGVLQDVSIGKMLERIKGFLWFLKKVKGVEPALTYCINPEVLQQFVEFMMKNRGIKAITCSRYVTSLISACKVPLACTQDEQKEESLEKIRAIQRQLERLSRQEKIDSDSLNPQTDKVVYSELLELCREFKWEVSEKTGADRARSCMNLCLLLMYCAVNPGRVKEYISLRIYKDQSGDQLKDQNFIWFKEDGGIVLLENNYKTRNTYGLNTTDVSSVTYLNYYLQLYKSKMRSLLLHGNDHDFFFVAPRGNRFSHASYNYYISGLFEKYLSRRLTTVDLRKIVVNYFLSLPESGDYSLRESFATLMKHSIRAQQKYYDERPLTQKKDRALDLLTSVARRSLDEDEPEIVSDEDQEGYLDCLPVPGDFVALVAANSTEKVPEVFVAKVLRLSEDKKTAYLADFAEEEPGRFKSKAGKSYKENTNSLIFPIDIVFSHSDGLYELRTPKIDLHLVTVQKKS*

# ORIGINAL: FUN_044109-T1 original gene structure, not modified by PASA
ptg000092l  funannotate gene    3791    5008    .   +   .   ID=FUN_044109;Name=FUN_044109-T1
ptg000092l  funannotate mRNA    3791    5008    .   +   .   ID=FUN_044109-T1;Parent=FUN_044109;Name=FUN_044109-T1
ptg000092l  funannotate exon    3791    3811    .   +   .   ID=FUN_044109-T1.exon1;Parent=FUN_044109-T1
ptg000092l  funannotate CDS 3791    3811    .   +   0   ID=FUN_044109-T1.cds.1;Parent=FUN_044109-T1
ptg000092l  funannotate exon    4856    5008    .   +   .   ID=FUN_044109-T1.exon2;Parent=FUN_044109-T1
ptg000092l  funannotate CDS 4856    5008    .   +   0   ID=FUN_044109-T1.cds.2;Parent=FUN_044109-T1


#PROT FUN_044109-T1 FUN_044109  MSNFSIKSEDEPASPLVRTDKNEELPTIPQAFRKLKECYCNCSWGDSLHADPQLTGE*

# ORIGINAL: FUN_044111-T1 original gene structure, not modified by PASA
ptg000092l  funannotate gene    17683   22752   .   +   .   ID=FUN_044111;Name=FUN_044111-T1
ptg000092l  funannotate mRNA    17683   22752   .   +   .   ID=FUN_044111-T1;Parent=FUN_044111;Name=FUN_044111-T1
ptg000092l  funannotate exon    17683   17881   .   +   .   ID=FUN_044111-T1.exon1;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 17683   17881   .   +   0   ID=FUN_044111-T1.cds.1;Parent=FUN_044111-T1
ptg000092l  funannotate exon    18082   18144   .   +   .   ID=FUN_044111-T1.exon2;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 18082   18144   .   +   2   ID=FUN_044111-T1.cds.2;Parent=FUN_044111-T1
ptg000092l  funannotate exon    18985   19058   .   +   .   ID=FUN_044111-T1.exon3;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 18985   19058   .   +   2   ID=FUN_044111-T1.cds.3;Parent=FUN_044111-T1
ptg000092l  funannotate exon    19708   19968   .   +   .   ID=FUN_044111-T1.exon4;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 19708   19968   .   +   0   ID=FUN_044111-T1.cds.4;Parent=FUN_044111-T1
ptg000092l  funannotate exon    20540   21849   .   +   .   ID=FUN_044111-T1.exon5;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 20540   21849   .   +   0   ID=FUN_044111-T1.cds.5;Parent=FUN_044111-T1
ptg000092l  funannotate exon    22188   22752   .   +   .   ID=FUN_044111-T1.exon6;Parent=FUN_044111-T1
ptg000092l  funannotate CDS 22188   22752   .   +   1   ID=FUN_044111-T1.cds.6;Parent=FUN_044111-T1


#PROT FUN_044111-T1 FUN_044111  MAFVRLPRPLLDEFITLWDQVQSISPTLPEQARHLIHRVDDKVAEIRSQASDTPTTGGHGAESQSTAADQPPQIPCLAMQEETASSSDDQPATPLVRKRKRRVAQKITSSAQGIQLPARPPDIVSEPTPDINFESMEIKYLKQALASVVQPSTKAEVYLKYLAKCDFNTTLEPHSIIKFNQDDVRRMVGIGQNPNGEEEVVGKLHQALQQRLQLAVQQAFSIGEFMSTCIKEHGSTLPDEDHQRRRGRPRVSSLLDTLDSIESLGASSSCLQDQVLIFQAISNFPLLKYVNEPMTHFVCNDVRLAIRHLPAALHHKCDVPENIQDAHINLRPFRSLVSDQESPPLSGDMSYSNVTPCDGDGLVVGINLDHREPLENAEYTRFYGIDAPELSSVHFIKTNDFQHVFCKQVGHISLCAVHLFLQMFLLSGSAKLCEELPREAAPQPRDIYNRALKEYWFKFITPPSQHLEKVFLQSLEELVPPTSESRKRLMSPFPATMATAANPFLLSLNALLVVSGFCHVFTKYCQDGFLLGLQAIARDNKLGPIWCGASRKFIFGCTSGNNTDFFLKHFTPETTSHLARAGFPFKHSNAFLPWHERQMLKQLCSQETTRTAARNHLAQHLPGMEPQFGMYIDIQRSNQGEGYQTVRTGEAYLKVMNSQVVGIGGNSTGLGLFTLKKIPRGTLVCAYAPTATIWEGKLNGDYVLETSFNNKVISVNGKENLFELGLGIYCNDGSFPFSLARARFSNVISHRVNCEYCKCGDGIWLKTVRDVSAGEELLMCYSQDGSYWATIFSREQLNQITAALNSCGPSLQDAERCIRLLQV*

# PASA_UPDATE: FUN_044120-T1, single gene model update, valid-1, status:[pasa:asmbl_497397,status:12], valid-1
# PASA_UPDATE: FUN_044120-T1.1.69943284, single gene model update, valid-1, status:[pasa:asmbl_497398,status:12], valid-1
# PASA_UPDATE: FUN_044120-T1.2.69943284, single gene model update, valid-1, status:[pasa:asmbl_497396,status:12], valid-1</code></pre>
</section>
<section id="gff-comparisons" class="level2">
<h2 class="anchored" data-anchor-id="gff-comparisons">6.4 GFF Comparisons</h2>
<div class="sourceCode" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb33-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'%s\n\n'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original GFF feature counts:"</span></span>
<span id="cb33-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span>
<span id="cb33-4"></span>
<span id="cb33-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-8"></span>
<span id="cb33-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Updated GFF feature counts:"</span></span>
<span id="cb33-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"\t"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span></code></pre></div>
<pre><code>Original GFF feature counts:

exon 209537
CDS 201613
gene 44371
mRNA 36447
tRNA 7924

-----------------------------------------------

Updated GFF feature counts:

exon 273865
CDS 268202
mRNA 42845
gene 36742
five_prime_UTR 13538
three_prime_UTR 13463</code></pre>
</section>
</section>
<section id="extract-proteins-to-fasta" class="level1">
<h1>7 EXTRACT PROTEINS TO FASTA</h1>
<div class="sourceCode" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb35-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-2"></span>
<span id="cb35-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'/^#PROT / {print "&gt;" $2 "." $3 "\n" $4}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> proteins-PASA.fasta</span>
<span id="cb35-4"></span>
<span id="cb35-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original protein counts:"</span></span>
<span id="cb35-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^#PROT"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-7"></span>
<span id="cb35-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-11"></span>
<span id="cb35-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Extracted protein counts:"</span></span>
<span id="cb35-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> proteins-PASA.fasta</span>
<span id="cb35-14"></span>
<span id="cb35-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create FastA Index</span></span>
<span id="cb35-16"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx proteins-PASA.fasta</span></code></pre></div>
<pre><code>Original protein counts:

42845

-----------------------------------------------

Extracted protein counts:

42845</code></pre>
<section id="checksums-2" class="level2">
<h2 class="anchored" data-anchor-id="checksums-2">7.1 Checksums</h2>
<div class="sourceCode" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb37-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> proteins-PASA.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> proteins-PASA.fasta.md5</span></code></pre></div>
<pre><code>b8bcef2f9bc2e19edf908343c07c4448  proteins-PASA.fasta</code></pre>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Trinity</category>
  <category>E5</category>
  <category>PASA</category>
  <category>transcriptome assembly</category>
  <category>Acropora pulchra</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-A.pulchra-RNA-seq-Using-Trinity-and-PASA/</guid>
  <pubDate>Fri, 27 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>De Novo Transcriptome Assembly and Annotation - E5 P.evermanni RNA-seq Using Trinity and PASA</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.evermanni-RNA-seq-Using-Trinity-and-PASA/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotation for <em>P.evermanni</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a>, as part of the E5 <a href="https://github.com/urol-e5/timeseries_molecular">timeseries_molecular project</a>. This produced an updated genome annotation that incorporates the RNA-seq data, including alternative splicing information. However, it’s important to note that the resulting GFF/BED files will <em>not</em> contain any annotations from the original genome GFF which did not have any support from RNA-seq alignments!</p>
<p>Thus, the resulting PASA annotations will be a <em>subset</em> of the original genome annotations, but with updated gene models based on the RNA-seq data. The PASA pipeline will merge the de novo and genome-guided transcriptome assemblies, clean the transcripts, and update the genome annotations with alternative splicing information where supported by the data.</p>
<p>Due to large file sizes, the majority of important output files are <em>not</em> availabe on GitHub, but can be accessed on Gannet here:</p>
<p><a href="https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/">https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/</a></p>
<p>Primary products:</p>
<ul>
<li>Trinity de-novo assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/de_novo_assembly/peve-denovo-Trinity.fasta</li>
<li>Trinity genome-guided assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/genome_guided_assembly/peve-GG-Trinity.fasta</li>
<li>PASA final GFF: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/PASA/peve-PASA.gff3</li>
<li>PASA final BED: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/PASA/peve-PASA.bed</li>
</ul>
<p>The markdown below was produced from the original Rmd script:</p>
<ul>
<li><a href="https://github.com/urol-e5/timeseries_molecular/blob/1c9153b836d2ebba3d7aa22e896fa71749f28d8b/E-Peve/code/00.30-E-Peve-transcriptome-assembly-Trinity.Rmd">00.30-E-Peve-transcriptome-assembly-Trinity.Rmd</a> (GitHub)</li>
</ul>
<p>Not described below is the access to the PASA web portal, which allows the user to browse the PASA results in a user-friendly interface. This can be accessed here:</p>
<ul>
<li>http://gannet.fish.washington.edu:9000/</li>
</ul>
<p>Enter <code>peve_pasa</code> as the database name. If this is your first time using the database, it will take many minutes for the data to load (the MySQL files behind the scenes are ~10GB in size, so it takes a while to process). After initial acces, the data is cached and access is much faster.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.evermanni-RNA-seq-Using-Trinity-and-PASA/20260227-peve-pasa_web.png" class="img-fluid figure-img"></p>
<figcaption>Screenshot of peve_pasa web portal on Gannet</figcaption>
</figure>
</div>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotaiton for <em>P.evermanni</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a> pipeline, as well as alternative isoform identification. This pipeline relies on both <em>de novo</em> and genome-guided transcriptome assemblies with <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a>.</p>
<p>The key steps include: 1. <strong>De Novo Assembly</strong> and <strong>Genome-Guided Assembly</strong>: Using <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> to assemble transcripts directly from RNA-seq reads. 2. <strong>PASA Pipeline</strong>: Utilizing <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> to merge the assemblies, clean transcripts, and update genome annotations with alternative splicing information.</p>
<p><strong>Programs Used:</strong> - <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> - Transcriptome assembly. - <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> - Annotation update and transcript assembly refinement. - <a href="https://github.com/NBISweden/AGAT">AGAT</a> - GFF/GTF toolkit for annotation merging and conversion. - <a href="https://apptainer.org/">Singularity (Apptainer)</a> - Container platform used to run assembly pipelines.</p>
<section id="expected-outputs" class="level2">
<h2 class="anchored" data-anchor-id="expected-outputs">1.1 Expected outputs</h2>
<p><strong>TRINITY</strong>:</p>
<ul>
<li>FastA: <em>De novo</em> transcriptome assembly.</li>
<li>FastA: Genome-guided transcriptome assembly.</li>
</ul>
<p><strong>PASA</strong>:</p>
<ul>
<li>GFF3: Genome annotations produced by PASA pipeline in GFF3.</li>
<li>BED: Genome annotations produced by PASA pipeline in BED format.</li>
</ul>
</section>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries-and-markdown-settings" class="level2">
<h2 class="anchored" data-anchor-id="libraries-and-markdown-settings">2.1 Libraries and markdown settings</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reticulate)</span>
<span id="cb1-3">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb1-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb1-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb1-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prevents appending '##' to beginning of lines in code output</span></span>
<span id="cb1-9">)</span></code></pre></div>
</section>
<section id="set-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-variables">2.2 Set variables</h2>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DIRECTORIES</span></span>
<span id="cb2-2">top_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output"</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"00.30-E-Peve-transcriptome-assembly-Trinity"</span>)</span>
<span id="cb2-5">de_novo_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"de_novo_assembly"</span>)</span>
<span id="cb2-6">genome_guided_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"genome_guided_assembly"</span>)</span>
<span id="cb2-7">pasa_container_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"containers"</span>)</span>
<span id="cb2-8">pasa_bed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peve-PASA.bed"</span></span>
<span id="cb2-9">pasa_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peve-PASA.gff3"</span></span>
<span id="cb2-10">PASA_HOME <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb2-11">pasa_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA"</span>)</span>
<span id="cb2-12">stringtie_gtf_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-E-Peve-RNAseq-alignment-HiSat2"</span>)</span>
<span id="cb2-13">trimmed_reads_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01.00-E-Peve-RNAseq-trimming-fastp-FastQC-MultiQC"</span>)</span>
<span id="cb2-14"></span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FILES</span></span>
<span id="cb2-17">bam_alignment <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-E-Peve-RNAseq-alignment-HiSat2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sorted-bams-merged.bam"</span>)</span>
<span id="cb2-18"></span>
<span id="cb2-19"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## Path for genome will be relative to PASA output dir</span></span>
<span id="cb2-20">genome_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Porites_evermanni_v1.fa"</span>)</span>
<span id="cb2-21">genome_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Porites_evermanni_validated.gff3"</span>)</span>
<span id="cb2-22">denovo_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peve-denovo-Trinity"</span></span>
<span id="cb2-23">genome_guided_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peve-GG-Trinity"</span></span>
<span id="cb2-24">pasa_container <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb2-25">stringtie_gtf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(stringtie_gtf_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Porites_evermanni_v1.stringtie.gtf"</span>)</span>
<span id="cb2-26"></span>
<span id="cb2-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SETTINGS</span></span>
<span id="cb2-28"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## THREADS</span></span>
<span id="cb2-29">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb2-30"></span>
<span id="cb2-31"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## MAX RAM</span></span>
<span id="cb2-32">max_ram <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb2-33"></span>
<span id="cb2-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROGRAMS</span></span>
<span id="cb2-35">samtools <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools-1.12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools"</span>)</span>
<span id="cb2-36"></span>
<span id="cb2-37"></span>
<span id="cb2-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FORMATTING</span></span>
<span id="cb2-39">line <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-----------------------------------------------"</span></span>
<span id="cb2-40"></span>
<span id="cb2-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb2-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb2-43">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bam_alignment =</span> bam_alignment,</span>
<span id="cb2-44">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">denovo_assembly_name =</span> denovo_assembly_name,</span>
<span id="cb2-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">de_novo_output_dir =</span> de_novo_output_dir,</span>
<span id="cb2-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_fasta =</span> genome_fasta,</span>
<span id="cb2-47">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_gff =</span> genome_gff,</span>
<span id="cb2-48">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_assembly_name =</span> genome_guided_assembly_name,</span>
<span id="cb2-49">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_output_dir =</span> genome_guided_output_dir,</span>
<span id="cb2-50">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line =</span> line,</span>
<span id="cb2-51">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_ram =</span> max_ram,</span>
<span id="cb2-52">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb2-53">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">top_output_dir =</span> top_output_dir,</span>
<span id="cb2-54">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_bed =</span> pasa_bed,</span>
<span id="cb2-55">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container =</span> pasa_container,</span>
<span id="cb2-56">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container_dir =</span> pasa_container_dir,</span>
<span id="cb2-57">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_gff =</span> pasa_gff,</span>
<span id="cb2-58">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">PASA_HOME =</span> PASA_HOME,</span>
<span id="cb2-59">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_output_dir =</span> pasa_output_dir,</span>
<span id="cb2-60">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">samtools =</span> samtools,</span>
<span id="cb2-61">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf_dir =</span> stringtie_gtf_dir,</span>
<span id="cb2-62">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf =</span> stringtie_gtf,</span>
<span id="cb2-63">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads,</span>
<span id="cb2-64">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">trimmed_reads_dir =</span> trimmed_reads_dir</span>
<span id="cb2-65">)</span></code></pre></div>
</section>
</section>
<section id="de-novo-assembly" class="level1">
<h1>3 DE NOVO ASSEMBLY</h1>
<section id="run-trinity" class="level2">
<h2 class="anchored" data-anchor-id="run-trinity">3.1 Run Trinity</h2>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/E-Peve/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<section id="set-bash-variables" class="level3">
<h3 class="anchored" data-anchor-id="set-bash-variables">3.1.1 Set Bash variables</h3>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Directories</span></span>
<span id="cb3-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">top_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output"</span></span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/00.30-E-Peve-transcriptome-assembly-Trinity"</span></span>
<span id="cb3-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">de_novo_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/de_novo_assembly"</span></span>
<span id="cb3-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/genome_guided_assembly"</span></span>
<span id="cb3-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">trimmed_reads_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/01.00-E-Peve-RNAseq-trimming-fastp-FastQC-MultiQC"</span></span>
<span id="cb3-8"></span>
<span id="cb3-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PASA INPUT FILES</span></span>
<span id="cb3-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">####### NEED TO BE RELATIVE TO PASA SUBDIRECTORY #######</span></span>
<span id="cb3-11"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_fasta</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Porites_evermanni_v1.fa"</span></span>
<span id="cb3-12"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_gff</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Porites_evermanni_validated.gff3"</span></span>
<span id="cb3-13"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_container</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb3-14"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PASA_HOME</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb3-15"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">stringtie_gtf</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../02.20-E-Peve-RNAseq-alignment-HiSat2/Porites_evermanni_v1.stringtie.gtf"</span></span>
<span id="cb3-16"></span>
<span id="cb3-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## THREADS</span></span>
<span id="cb3-18"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">threads</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb3-19"></span>
<span id="cb3-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## MAX RAM</span></span>
<span id="cb3-21"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">max_ram</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb3-22"></span>
<span id="cb3-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directoy, if it doesn't exist</span></span>
<span id="cb3-24"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb3-25"></span>
<span id="cb3-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Inititalize arrays</span></span>
<span id="cb3-27"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-28"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-29"></span>
<span id="cb3-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Variables for R1/R2 lists</span></span>
<span id="cb3-31"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-32"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-33"></span>
<span id="cb3-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R1 files</span></span>
<span id="cb3-35"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R1_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-36"></span>
<span id="cb3-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R2 files</span></span>
<span id="cb3-38"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R2_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-39"></span>
<span id="cb3-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create list of fastq files used in analysis</span></span>
<span id="cb3-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Uses parameter substitution to strip leading path from filename</span></span>
<span id="cb3-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">!</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-f</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/fastq.list.txt"</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb3-43">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fastq <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fq.gz</span>
<span id="cb3-44">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb3-45">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastq</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">##</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/fastq.list.txt</span>
<span id="cb3-46">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span>
<span id="cb3-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span>
<span id="cb3-48"></span>
<span id="cb3-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create comma-separated lists of FastQ reads</span></span>
<span id="cb3-50"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-51"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div>
</section>
<section id="run-trinity-singularity-image." class="level3">
<h3 class="anchored" data-anchor-id="run-trinity-singularity-image.">3.1.2 Run Trinity Singularity image.</h3>
<p>Used “stranded” setting (–SS_lib_type).</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-3">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-4">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-5">--seqType fq <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-9">--left <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-10">--right <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-11">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-12">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-13"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-14">2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
</section>
<section id="rename-output-files" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files">3.2 Rename output files</h2>
<section id="rename-fasta" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta">3.2.1 Rename FastA</h3>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log">3.2.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.gene_trans_map</span>
<span id="cb6-3"></span>
<span id="cb6-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.log</span></code></pre></div>
</section>
<section id="assembly-stats" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats">3.2.3 Assembly stats</h3>
<section id="run-trinity-singularity-image.-1" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-1">3.2.3.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-4">../output/00.30-E-Peve-transcriptome-assembly-Trinity/de_novo_assembly/peve-denovo-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-E-Peve-transcriptome-assembly-Trinity/de_novo_assembly/peve-denovo-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
<section id="create-fasta-index" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index">3.3 Create FastA index</h2>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb8-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums" class="level2">
<h2 class="anchored" data-anchor-id="checksums">3.4 Checksums</h2>
<div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>72835974384b1693cad623628ae9315c  peve-denovo-Trinity.fasta</code></pre>
</section>
</section>
<section id="genome-guided-assembly" class="level1">
<h1>4 GENOME-GUIDED ASSEMBLY</h1>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/E-Peve/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-2">-B /home <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-3">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-4">--genome_guided_bam ../output/02.20-E-Peve-RNAseq-alignment-HiSat2/sorted-bams-merged.bam <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-5">--genome_guided_max_intron 10000 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-9">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-10">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-11"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
<section id="rename-output-files-1" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files-1">4.1 Rename output files</h2>
<section id="rename-fasta-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta-1">4.1.1 Rename FastA</h3>
<div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb12-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb12-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log-1">4.1.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.gene_trans_map</span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.log</span></code></pre></div>
</section>
</section>
<section id="create-fasta-index-1" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index-1">4.2 Create FastA index</h2>
<div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb14-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums-1" class="level2">
<h2 class="anchored" data-anchor-id="checksums-1">4.3 Checksums</h2>
<div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span></span>
<span id="cb15-2"></span>
<span id="cb15-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>d60d91acf9621a424fe61c1dbfc2d875  peve-GG-Trinity.fasta</code></pre>
<section id="assembly-stats-1" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats-1">4.3.1 Assembly stats</h3>
<section id="run-trinity-singularity-image.-2" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-2">4.3.1.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb17-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-4">../output/00.30-E-Peve-transcriptome-assembly-Trinity/genome_guided_assembly/peve-GG-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-E-Peve-transcriptome-assembly-Trinity/genome_guided_assembly/peve-GG-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
</section>
<section id="pasa-pipeline" class="level1">
<h1>5 PASA PIPELINE</h1>
<section id="concatenate-trinity-assemblies" class="level2">
<h2 class="anchored" data-anchor-id="concatenate-trinity-assemblies">5.1 Concatenate Trinity assemblies</h2>
<div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta</span></code></pre></div>
<section id="confirm-counts" class="level3">
<h3 class="anchored" data-anchor-id="confirm-counts">5.1.1 Confirm counts</h3>
<div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Count transcripts in each file</span></span>
<span id="cb19-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">denovo_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-5"></span>
<span id="cb19-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate sum of first two counts</span></span>
<span id="cb19-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((denovo_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count))</span></span>
<span id="cb19-8"></span>
<span id="cb19-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compare sum to PASA count</span></span>
<span id="cb19-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"De novo count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$denovo_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genome-guided count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$genome_guided_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sum: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-14"></span>
<span id="cb19-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-eq</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb19-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✓ Counts match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb19-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✗ Counts do not match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> ≠ </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> (difference: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((pasa_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum))</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb19-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span></code></pre></div>
<pre><code>De novo count: 1065667
Genome-guided count: 533664
Sum: 1599331
PASA count: 1599331
✓ Counts match: 1599331 = 1599331</code></pre>
</section>
</section>
<section id="extract-transcript-accessions" class="level2">
<h2 class="anchored" data-anchor-id="extract-transcript-accessions">5.2 Extract transcript accessions</h2>
<div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb21-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-3">-e <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/misc_utilities/accession_extractor.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span>
<span id="cb21-7"></span>
<span id="cb21-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span></code></pre></div>
</section>
<section id="clean-transcripts" class="level2">
<h2 class="anchored" data-anchor-id="clean-transcripts">5.3 Clean transcripts</h2>
<div class="sourceCode" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb22-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb22-2"></span>
<span id="cb22-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-4">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-5">-e <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-6">--env USER=<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$USER</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-8"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/bin/seqclean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-9">transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-10">-c 16</span></code></pre></div>
</section>
<section id="pasa-assembly" class="level2">
<h2 class="anchored" data-anchor-id="pasa-assembly">5.4 PASA Assembly</h2>
<section id="fix-schema-key-length" class="level3">
<h3 class="anchored" data-anchor-id="fix-schema-key-length">5.4.1 Fix schema key length</h3>
<div class="sourceCode" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb23-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb23-2"></span>
<span id="cb23-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#### Fix schema key length issue ####</span></span>
<span id="cb23-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-5">cat /usr/local/src/PASApipeline/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> cdna_alignment_mysqlschema</span>
<span id="cb23-7"></span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix all variations of gene_id and model_id indexes</span></span>
<span id="cb23-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_id_idx (gene_id)/KEY gene_id_idx (gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY mod_idx (model_id)/KEY mod_idx (model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(gene_id)/(gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(model_id)/(model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_idx (annotation_version,gene_id)/KEY gene_idx (annotation_version,gene_id(255))/g'</span> cdna_alignment_mysqlschema</span></code></pre></div>
</section>
<section id="run-pasa-assembly-pipeline" class="level3">
<h3 class="anchored" data-anchor-id="run-pasa-assembly-pipeline">5.4.2 Run PASA Assembly Pipeline</h3>
<p>This was executed outside of RStudio due to the verbose output, which will cause RStudio to crash.</p>
<div class="sourceCode" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb24-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-8">--config alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-9">--create <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-10">--run <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-11">--genome <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-12">--transcripts transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-13">--trans_gtf <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${stringtie_gtf}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-14">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-15">-T <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-16">-u transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-17">--ALIGNERS blat,gmap,minimap2 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-18">--TDN tdn.accs <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-19">--transcribed_is_aligned_orient <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-20">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-21">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-22">--annots <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-23">--TRANSDECODER <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-24">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="alternative-splicing" class="level3">
<h3 class="anchored" data-anchor-id="alternative-splicing">5.4.3 Alternative Splicing</h3>
<p>This doesn’t seem to have run during the assembly phase, so ran separately.</p>
<div class="sourceCode" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb25-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-8">-c alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-9">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-10">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-11">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-12">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="update-annotations" class="level3">
<h3 class="anchored" data-anchor-id="update-annotations">5.4.4 Update annotations</h3>
<p>Now includes alternative splicing info.</p>
<p>Uses output GFF3 from initial annotations as annotation <em>input</em>.</p>
<div class="sourceCode" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb26-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-8">-c annotCompare.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-9">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-10">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-11">--annots peve_pasa.gene_structures_post_PASA_updates.2550221.gff3 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-12">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-13">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-14">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
</section>
</section>
<section id="pasa-outputs" class="level1">
<h1>6 PASA OUTPUTS</h1>
<section id="generate-checksums" class="level2">
<h2 class="anchored" data-anchor-id="generate-checksums">6.1 Generate checksums</h2>
<div class="sourceCode" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb27-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-2"></span>
<span id="cb27-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> peve_pasa.gene_structures_post_PASA_updates.3761502.gff3 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> peve_pasa.gene_structures_post_PASA_updates.3761502.gff3.md5</span>
<span id="cb27-4"></span>
<span id="cb27-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> peve_pasa.gene_structures_post_PASA_updates.3761502.bed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> peve_pasa.gene_structures_post_PASA_updates.3761502.bed.md5</span></code></pre></div>
<pre><code>08d65a59913b56823d9a108db722f820  peve_pasa.gene_structures_post_PASA_updates.3761502.gff3
b4f76f4651063be32724c86d067ad34a  peve_pasa.gene_structures_post_PASA_updates.3761502.bed</code></pre>
</section>
<section id="rename-outputs" class="level2">
<h2 class="anchored" data-anchor-id="rename-outputs">6.2 Rename outputs</h2>
<div class="sourceCode" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb29-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> peve_pasa.gene_structures_post_PASA_updates.3761502.gff3 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-3"></span>
<span id="cb29-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> peve_pasa.gene_structures_post_PASA_updates.3761502.bed <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-5"></span>
<span id="cb29-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb29-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span></code></pre></div>
<pre><code>08d65a59913b56823d9a108db722f820  peve-PASA.gff3
b4f76f4651063be32724c86d067ad34a  peve-PASA.bed</code></pre>
</section>
<section id="gff3-preview" class="level2">
<h2 class="anchored" data-anchor-id="gff3-preview">6.3 GFF3 Preview</h2>
<div class="sourceCode" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb31-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 50 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span></code></pre></div>
<pre><code># PASA_UPDATE: mrna-26667, single gene model update, valid-1, status:[pasa:asmbl_337815,status:12], valid-1
Porites_evermani_scaffold_4224  .   gene    28057   29953   .   -   .   ID=gene-Peve_00030015;Name=mrna-26667
Porites_evermani_scaffold_4224  .   mRNA    28057   29953   .   -   .   ID=mrna-26667;Parent=gene-Peve_00030015;Name=mrna-26667
Porites_evermani_scaffold_4224  .   five_prime_UTR  29913   29953   .   -   .   ID=mrna-26667.utr5p1;Parent=mrna-26667
Porites_evermani_scaffold_4224  .   exon    29544   29953   .   -   .   ID=mrna-26667.exon1;Parent=mrna-26667
Porites_evermani_scaffold_4224  .   CDS 29544   29912   .   -   0   ID=mrna-26667.cds.1;Parent=mrna-26667
Porites_evermani_scaffold_4224  .   exon    28057   29172   .   -   .   ID=mrna-26667.exon2;Parent=mrna-26667
Porites_evermani_scaffold_4224  .   CDS 29008   29172   .   -   0   ID=mrna-26667.cds.2;Parent=mrna-26667
Porites_evermani_scaffold_4224  .   three_prime_UTR 28057   29007   .   -   .   ID=mrna-26667.utr3p1;Parent=mrna-26667


#PROT mrna-26667 gene-Peve_00030015 MPGPRGDRGREGPPGKSGPRGINGMKGQQGLLGMKGEPGIAGMKGERGAVGIKGQRGIVGMKGVPGAVGIKGERGIVGNPGRKGNKGEKGESAKASQASVVPQTNWKQCVWNSDSGTDNGKIKDCAFNKLQSNSALKVSFQGNMRVIGHGACNRWYFKFNGNECNGPMTIEAIVNNH*

# PASA_UPDATE: novel_model_1794_698a2f3c, single gene model update, valid-1, status:[pasa:asmbl_411975,status:3], valid-1
Porites_evermani_scaffold_594   .   gene    170578  170986  .   +   .   ID=novel_gene_1397_698a2f3c;Name=%2A%2A%20NO%20NAME%20ASSIGNED%20%2A%2A
Porites_evermani_scaffold_594   .   mRNA    170578  170986  .   +   .   ID=novel_model_1794_698a2f3c;Parent=novel_gene_1397_698a2f3c;Name=%2A%2A%20NO%20NAME%20ASSIGNED%20%2A%2A
Porites_evermani_scaffold_594   .   five_prime_UTR  170578  170640  .   +   .   ID=novel_model_1794_698a2f3c.utr5p1;Parent=novel_model_1794_698a2f3c
Porites_evermani_scaffold_594   .   exon    170578  170986  .   +   .   ID=novel_model_1794_698a2f3c.exon1;Parent=novel_model_1794_698a2f3c
Porites_evermani_scaffold_594   .   CDS 170641  170952  .   +   0   ID=novel_model_1794_698a2f3c.cds.1;Parent=novel_model_1794_698a2f3c
Porites_evermani_scaffold_594   .   three_prime_UTR 170953  170986  .   +   .   ID=novel_model_1794_698a2f3c.utr3p1;Parent=novel_model_1794_698a2f3c


#PROT novel_model_1794_698a2f3c novel_gene_1397_698a2f3c    MSKTPLQDEYLQWRPQILGITTQLNAFFFNHLMKSCHPFKSHATEYLCSTCNSGVCSDPPLPFEAWVKCTMYIDPTLSKIDTFGTSTKCPSKSDVCLLESQKM*

# ORIGINAL: mrna-32793 original gene structure, not modified by PASA
Porites_evermani_scaffold_594   Gmove   gene    82339   84386   .   +   .   ID=gene-Peve_00036817;Name=mrna-32793
Porites_evermani_scaffold_594   Gmove   mRNA    82339   84386   .   +   .   ID=mrna-32793;Parent=gene-Peve_00036817;Name=mrna-32793
Porites_evermani_scaffold_594   Gmove   exon    82339   82462   .   +   .   ID=mrna-32793.exon1;Parent=mrna-32793
Porites_evermani_scaffold_594   Gmove   CDS 82339   82462   .   +   0   ID=mrna-32793.cds.1;Parent=mrna-32793
Porites_evermani_scaffold_594   Gmove   exon    83270   83388   .   +   .   ID=mrna-32793.exon2;Parent=mrna-32793
Porites_evermani_scaffold_594   Gmove   CDS 83270   83388   .   +   2   ID=mrna-32793.cds.2;Parent=mrna-32793
Porites_evermani_scaffold_594   Gmove   exon    84354   84386   .   +   .   ID=mrna-32793.exon3;Parent=mrna-32793
Porites_evermani_scaffold_594   Gmove   CDS 84354   84386   .   +   0   ID=mrna-32793.cds.3;Parent=mrna-32793


#PROT mrna-32793 gene-Peve_00036817 LKAIVTTEGVYFVRARGTPSPESIVLLVRFSDLYVCQPLSTDGKSYIELVMKADNSSVPTPSKNPSKRPRVRCDQQSVAQKVAQKINYAKNL

# PASA_UPDATE: mrna-32790, single gene model update, valid-1, status:[pasa:asmbl_411993,status:12], valid-1
Porites_evermani_scaffold_594   .   gene    203517  221865  .   +   .   ID=gene-Peve_00036814;Name=mrna-32790
Porites_evermani_scaffold_594   .   mRNA    203517  221865  .   +   .   ID=mrna-32790;Parent=gene-Peve_00036814;Name=mrna-32790
Porites_evermani_scaffold_594   .   exon    203517  203643  .   +   .   ID=mrna-32790.exon1;Parent=mrna-32790
Porites_evermani_scaffold_594   .   CDS 203517  203643  .   +   0   ID=mrna-32790.cds.1;Parent=mrna-32790
Porites_evermani_scaffold_594   .   exon    211961  212176  .   +   .   ID=mrna-32790.exon2;Parent=mrna-32790
Porites_evermani_scaffold_594   .   CDS 211961  212176  .   +   2   ID=mrna-32790.cds.2;Parent=mrna-32790
Porites_evermani_scaffold_594   .   exon    217811  217948  .   +   .   ID=mrna-32790.exon3;Parent=mrna-32790
Porites_evermani_scaffold_594   .   CDS 217811  217948  .   +   2   ID=mrna-32790.cds.3;Parent=mrna-32790
Porites_evermani_scaffold_594   .   exon    219213  219368  .   +   .   ID=mrna-32790.exon4;Parent=mrna-32790
Porites_evermani_scaffold_594   .   CDS 219213  219368  .   +   2   ID=mrna-32790.cds.4;Parent=mrna-32790
Porites_evermani_scaffold_594   .   exon    220000  220155  .   +   .   ID=mrna-32790.exon5;Parent=mrna-32790
Porites_evermani_scaffold_594   .   CDS 220000  220155  .   +   2   ID=mrna-32790.cds.5;Parent=mrna-32790</code></pre>
</section>
<section id="gff-comparisons" class="level2">
<h2 class="anchored" data-anchor-id="gff-comparisons">6.4 GFF Comparisons</h2>
<div class="sourceCode" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb33-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'%s\n\n'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original GFF feature counts:"</span></span>
<span id="cb33-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span>
<span id="cb33-4"></span>
<span id="cb33-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-8"></span>
<span id="cb33-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Updated GFF feature counts:"</span></span>
<span id="cb33-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"\t"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span></code></pre></div>
<pre><code>Original GFF feature counts:

exon 246418
CDS 231320
mRNA 40389
gene 40389
UTR 15098

-----------------------------------------------

Updated GFF feature counts:

exon 463084
CDS 442258
mRNA 59418
five_prime_UTR 43027
gene 40808
three_prime_UTR 38919</code></pre>
</section>
</section>
<section id="extract-proteins-to-fasta" class="level1">
<h1>7 EXTRACT PROTEINS TO FASTA</h1>
<div class="sourceCode" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb35-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-2"></span>
<span id="cb35-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'/^#PROT / {print "&gt;" $2 "." $3 "\n" $4}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> peve-proteins-PASA.fasta</span>
<span id="cb35-4"></span>
<span id="cb35-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original protein counts:"</span></span>
<span id="cb35-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^#PROT"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-7"></span>
<span id="cb35-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-11"></span>
<span id="cb35-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Extracted protein counts:"</span></span>
<span id="cb35-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> peve-proteins-PASA.fasta</span>
<span id="cb35-14"></span>
<span id="cb35-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create FastA Index</span></span>
<span id="cb35-16"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx peve-proteins-PASA.fasta</span></code></pre></div>
<pre><code>Original protein counts:

59418

-----------------------------------------------

Extracted protein counts:

59418</code></pre>
<section id="checksums-2" class="level2">
<h2 class="anchored" data-anchor-id="checksums-2">7.1 Checksums</h2>
<div class="sourceCode" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb37-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> peve-proteins-PASA.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> peve-proteins-PASA.fasta.md5</span></code></pre></div>
<pre><code>9198a4d1e67759b0a78dd4d9f4229695  peve-proteins-PASA.fasta</code></pre>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Trinity</category>
  <category>E5</category>
  <category>PASA</category>
  <category>transcriptome assembly</category>
  <category>Porites evermanni</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.evermanni-RNA-seq-Using-Trinity-and-PASA/</guid>
  <pubDate>Fri, 27 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>De Novo Transcriptome Assembly and Annotation - E5 P.tuahiensis RNA-seq Using Trinity and PASA</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.tuahiensis-RNA-seq-Using-Trinity-and-PASA/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotation for <em>P.tuahiensis</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a>, as part of the E5 <a href="https://github.com/urol-e5/timeseries_molecular">timeseries_molecular project</a>. This produced an updated genome annotation that incorporates the RNA-seq data, including alternative splicing information. However, it’s important to note that the resulting GFF/BED files will <em>not</em> contain any annotations from the original genome GFF which did not have any support from RNA-seq alignments!</p>
<p>Thus, the resulting PASA annotations will be a <em>subset</em> of the original genome annotations, but with updated gene models based on the RNA-seq data. The PASA pipeline will merge the de novo and genome-guided transcriptome assemblies, clean the transcripts, and update the genome annotations with alternative splicing information where supported by the data.</p>
<p>Due to large file sizes, the majority of important output files are <em>not</em> availabe on GitHub, but can be accessed on Gannet here:</p>
<p><a href="https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/">https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/</a></p>
<p>Primary products:</p>
<ul>
<li>Trinity de-novo assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/de_novo_assembly/ptua-denovo-Trinity.fasta</li>
<li>Trinity genome-guided assembly FastA: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/genome_guided_assembly/ptua-GG-Trinity.fasta</li>
<li>PASA final GFF: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/PASA/ptua-PASA.gff3</li>
<li>PASA final BED: https://gannet.fish.washington.edu/gitrepos/urol-e5/timeseries_molecular/F-Ptua/output/00.30-F-Ptua-transcriptome-assembly-Trinity/PASA/ptua-PASA.bed</li>
</ul>
<p>The markdown below was produced from the original Rmd script:</p>
<ul>
<li><a href="https://github.com/urol-e5/timeseries_molecular/blob/main/F-Ptua/code/00.30-F-Ptua-transcriptome-assembly-Trinity.Rmd">00.30-F-Ptua-transcriptome-assembly-Trinity.Rmd</a> (GitHub)</li>
</ul>
<p>Not described below is the access to the PASA web portal, which allows the user to browse the PASA results in a user-friendly interface. This can be accessed here:</p>
<ul>
<li>http://gannet.fish.washington.edu:9000/</li>
</ul>
<p>Enter <code>ptua_pasa</code> as the database name. If this is your first time using the database, it will take many minutes for the data to load (the MySQL files behind the scenes are ~10GB in size, so it takes a while to process). After initial acces, the data is cached and access is much faster.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.tuahiensis-RNA-seq-Using-Trinity-and-PASA/20260227-ptua-pasa_web.png" class="img-fluid figure-img"></p>
<figcaption>Screenshot of ptua_pasa web portal on Gannet</figcaption>
</figure>
</div>
<hr>
</section>
<section id="background" class="level1">
<h1>1 BACKGROUND</h1>
<p>This notebook performs a comprehensive transcriptome assembly and annotaiton for <em>P.tuahiensis</em> using the <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA (Program to Assemble Spliced Alignments)</a> pipeline, as well as alternative isoform identification. This pipeline relies on both <em>de novo</em> and genome-guided transcriptome assemblies with <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a>.</p>
<p>The key steps include: 1. <strong>De Novo Assembly</strong> and <strong>Genome-Guided Assembly</strong>: Using <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> to assemble transcripts directly from RNA-seq reads. 2. <strong>PASA Pipeline</strong>: Utilizing <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> to merge the assemblies, clean transcripts, and update genome annotations with alternative splicing information.</p>
<p><strong>Programs Used:</strong> - <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki">Trinity</a> - Transcriptome assembly. - <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA</a> - Annotation update and transcript assembly refinement. - <a href="https://github.com/NBISweden/AGAT">AGAT</a> - GFF/GTF toolkit for annotation merging and conversion. - <a href="https://apptainer.org/">Singularity (Apptainer)</a> - Container platform used to run assembly pipelines.</p>
<section id="expected-outputs" class="level2">
<h2 class="anchored" data-anchor-id="expected-outputs">1.1 Expected outputs</h2>
<p><strong>TRINITY</strong>:</p>
<ul>
<li>FastA: <em>De novo</em> transcriptome assembly.</li>
<li>FastA: Genome-guided transcriptome assembly.</li>
</ul>
<p><strong>PASA</strong>:</p>
<ul>
<li>GFF3: Genome annotations produced by PASA pipeline in GFF3.</li>
<li>BED: Genome annotations produced by PASA pipeline in BED format.</li>
</ul>
</section>
</section>
<section id="setup" class="level1">
<h1>2 SETUP</h1>
<section id="libraries-and-markdown-settings" class="level2">
<h2 class="anchored" data-anchor-id="libraries-and-markdown-settings">2.1 Libraries and markdown settings</h2>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reticulate)</span>
<span id="cb1-3">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb1-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb1-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb1-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prevents appending '##' to beginning of lines in code output</span></span>
<span id="cb1-9">)</span></code></pre></div>
</section>
<section id="set-variables" class="level2">
<h2 class="anchored" data-anchor-id="set-variables">2.2 Set variables</h2>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DIRECTORIES</span></span>
<span id="cb2-2">top_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output"</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4">output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"00.30-F-Ptua-transcriptome-assembly-Trinity"</span>)</span>
<span id="cb2-5">de_novo_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"de_novo_assembly"</span>)</span>
<span id="cb2-6">genome_guided_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"genome_guided_assembly"</span>)</span>
<span id="cb2-7">pasa_container_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"containers"</span>)</span>
<span id="cb2-8">PASA_HOME <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb2-9">pasa_output_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA"</span>)</span>
<span id="cb2-10">stringtie_gtf_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-F-Ptua-RNAseq-alignment-HiSat2"</span>)</span>
<span id="cb2-11">trimmed_reads_dir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01.00-F-Ptua-RNAseq-trimming-fastp-FastQC-MultiQC"</span>)</span>
<span id="cb2-12"></span>
<span id="cb2-13"></span>
<span id="cb2-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FILES</span></span>
<span id="cb2-15">bam_alignment <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(top_output_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"02.20-F-Ptua-RNAseq-alignment-HiSat2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sorted-bams-merged.bam"</span>)</span>
<span id="cb2-16"></span>
<span id="cb2-17"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## Path for genome will be relative to PASA output dir</span></span>
<span id="cb2-18">genome_fasta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pocillopora_meandrina_HIv1.assembly.fasta"</span>)</span>
<span id="cb2-19">genome_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pocillopora_meandrina_HIv1.genes.gff3"</span>)</span>
<span id="cb2-20">denovo_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-denovo-Trinity"</span></span>
<span id="cb2-21">genome_guided_assembly_name <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-GG-Trinity"</span></span>
<span id="cb2-22">pasa_bed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-PASA.bed"</span></span>
<span id="cb2-23">pasa_container <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb2-24">pasa_gff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-PASA.gff3"</span></span>
<span id="cb2-25">stringtie_gtf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(stringtie_gtf_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pocillopora_meandrina_HIv1.assembly.stringtie.gtf"</span>)</span>
<span id="cb2-26"></span>
<span id="cb2-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SETTINGS</span></span>
<span id="cb2-28"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## THREADS</span></span>
<span id="cb2-29">threads <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb2-30"></span>
<span id="cb2-31"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## MAX RAM</span></span>
<span id="cb2-32">max_ram <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb2-33"></span>
<span id="cb2-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROGRAMS</span></span>
<span id="cb2-35">samtools <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools-1.12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"samtools"</span>)</span>
<span id="cb2-36"></span>
<span id="cb2-37"></span>
<span id="cb2-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FORMATTING</span></span>
<span id="cb2-39">line <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-----------------------------------------------"</span></span>
<span id="cb2-40"></span>
<span id="cb2-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Export these as environment variables for bash chunks.</span></span>
<span id="cb2-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb2-43">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bam_alignment =</span> bam_alignment,</span>
<span id="cb2-44">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">denovo_assembly_name =</span> denovo_assembly_name,</span>
<span id="cb2-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">de_novo_output_dir =</span> de_novo_output_dir,</span>
<span id="cb2-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_fasta =</span> genome_fasta,</span>
<span id="cb2-47">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_gff =</span> genome_gff,</span>
<span id="cb2-48">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_assembly_name =</span> genome_guided_assembly_name,</span>
<span id="cb2-49">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">genome_guided_output_dir =</span> genome_guided_output_dir,</span>
<span id="cb2-50">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line =</span> line,</span>
<span id="cb2-51">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_ram =</span> max_ram,</span>
<span id="cb2-52">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output_dir =</span> output_dir,</span>
<span id="cb2-53">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">top_output_dir =</span> top_output_dir,</span>
<span id="cb2-54">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_bed =</span> pasa_bed,</span>
<span id="cb2-55">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container =</span> pasa_container,</span>
<span id="cb2-56">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_container_dir =</span> pasa_container_dir,</span>
<span id="cb2-57">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_gff =</span> pasa_gff,</span>
<span id="cb2-58">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">PASA_HOME =</span> PASA_HOME,</span>
<span id="cb2-59">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pasa_output_dir =</span> pasa_output_dir,</span>
<span id="cb2-60">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">samtools =</span> samtools,</span>
<span id="cb2-61">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf_dir =</span> stringtie_gtf_dir,</span>
<span id="cb2-62">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringtie_gtf =</span> stringtie_gtf,</span>
<span id="cb2-63">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threads =</span> threads,</span>
<span id="cb2-64">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">trimmed_reads_dir =</span> trimmed_reads_dir</span>
<span id="cb2-65">)</span></code></pre></div>
</section>
</section>
<section id="de-novo-assembly" class="level1">
<h1>3 DE NOVO ASSEMBLY</h1>
<section id="run-trinity" class="level2">
<h2 class="anchored" data-anchor-id="run-trinity">3.1 Run Trinity</h2>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/F-Ptua/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<section id="set-bash-variables" class="level3">
<h3 class="anchored" data-anchor-id="set-bash-variables">3.1.1 Set Bash variables</h3>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Directories</span></span>
<span id="cb3-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">top_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../output"</span></span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/00.30-F-Ptua-transcriptome-assembly-Trinity"</span></span>
<span id="cb3-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">de_novo_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/de_novo_assembly"</span></span>
<span id="cb3-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/genome_guided_assembly"</span></span>
<span id="cb3-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_output_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/PASA"</span></span>
<span id="cb3-8"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">trimmed_reads_dir</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/01.00-F-Ptua-RNAseq-trimming-fastp-FastQC-MultiQC"</span></span>
<span id="cb3-9"></span>
<span id="cb3-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FILES</span></span>
<span id="cb3-11"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">bam_alignment</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${top_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/02.20-F-Ptua-RNAseq-alignment-HiSat2/sorted-bams-merged.bam"</span></span>
<span id="cb3-12"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">denovo_assembly_name</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-denovo-Trinity"</span></span>
<span id="cb3-13"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_assembly_name</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ptua-GG-Trinity"</span></span>
<span id="cb3-14"></span>
<span id="cb3-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PASA INPUT FILES</span></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">####### NEED TO BE RELATIVE TO PASA SUBDIRECTORY #######</span></span>
<span id="cb3-17"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_fasta</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Pocillopora_meandrina_HIv1.assembly.fasta"</span></span>
<span id="cb3-18"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_gff</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../data/Pocillopora_meandrina_HIv1.genes-validated.gff3"</span></span>
<span id="cb3-19"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_container</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pasapipeline.v2.5.3.simg"</span></span>
<span id="cb3-20"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PASA_HOME</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/local/src/PASApipeline"</span></span>
<span id="cb3-21"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">stringtie_gtf</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../output/02.20-F-Ptua-RNAseq-alignment-HiSat2/Pocillopora_meandrina_HIv1.assembly.stringtie.gtf </span></span>
<span id="cb3-22"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-23"></span>
<span id="cb3-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## THREADS</span></span>
<span id="cb3-25"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">threads</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span></span>
<span id="cb3-26"></span>
<span id="cb3-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## MAX RAM</span></span>
<span id="cb3-28"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">max_ram</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100G"</span></span>
<span id="cb3-29"></span>
<span id="cb3-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make output directoy, if it doesn't exist</span></span>
<span id="cb3-31"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb3-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--parents</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb3-33"></span>
<span id="cb3-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Inititalize arrays</span></span>
<span id="cb3-35"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-36"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb3-37"></span>
<span id="cb3-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Variables for R1/R2 lists</span></span>
<span id="cb3-39"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-40"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-41"></span>
<span id="cb3-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R1 files</span></span>
<span id="cb3-43"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R1_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-44"></span>
<span id="cb3-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create array of fastq R2 files</span></span>
<span id="cb3-46"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>R2_001.fastp-trim.fq.gz<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-47"></span>
<span id="cb3-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create list of fastq files used in analysis</span></span>
<span id="cb3-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">## Uses parameter substitution to strip leading path from filename</span></span>
<span id="cb3-50"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">!</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-f</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/fastq.list.txt"</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb3-51">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fastq <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${trimmed_reads_dir}</span>/<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>.fq.gz</span>
<span id="cb3-52">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">do</span></span>
<span id="cb3-53">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${fastq</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">##</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">*</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/fastq.list.txt</span>
<span id="cb3-54">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">done</span></span>
<span id="cb3-55"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span>
<span id="cb3-56"></span>
<span id="cb3-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create comma-separated lists of FastQ reads</span></span>
<span id="cb3-58"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R1_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-59"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">R2_list</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[@]</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tr</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div>
</section>
<section id="run-trinity-singularity-image." class="level3">
<h3 class="anchored" data-anchor-id="run-trinity-singularity-image.">3.1.2 Run Trinity Singularity image.</h3>
<p>Used “stranded” setting (–SS_lib_type).</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-3">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-4">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-5">--seqType fq <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-9">--left <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R1_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-10">--right <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${R2_list}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-11">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-12">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-13"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-14">2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
</section>
</section>
<section id="rename-output-files" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files">3.2 Rename output files</h2>
<section id="rename-fasta" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta">3.2.1 Rename FastA</h3>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb5-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log">3.2.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity_out_dir.Trinity.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.gene_trans_map</span>
<span id="cb6-3"></span>
<span id="cb6-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb6-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.log</span></code></pre></div>
</section>
<section id="assembly-stats" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats">3.2.3 Assembly stats</h3>
<section id="run-trinity-singularity-image.-1" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-1">3.2.3.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-4">../output/00.30-F-Ptua-transcriptome-assembly-Trinity/de_novo_assembly/ptua-denovo-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-F-Ptua-transcriptome-assembly-Trinity/de_novo_assembly/ptua-denovo-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
<section id="create-fasta-index" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index">3.3 Create FastA index</h2>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb8-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums" class="level2">
<h2 class="anchored" data-anchor-id="checksums">3.4 Checksums</h2>
<div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>0c3073b02a10eb38893e296ce9d9dfb3  ptua-denovo-Trinity.fasta</code></pre>
</section>
</section>
<section id="genome-guided-assembly" class="level1">
<h1>4 GENOME-GUIDED ASSEMBLY</h1>
<p>Trinity was run using the <a href="https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-in-Docker#running-trinity-using-singularity">Trinity Singularity (Apptainer) container</a>, <code>trinityrnaseq.v2.15.2.simg</code> from the <code>urol-e5/timeseries_molecular/F-Ptua/code/</code> directory.</p>
<p>This was done in a terminal, outside of this notebook.</p>
<div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-2">-B /home <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-3">Trinity <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-4">--genome_guided_bam <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${bam_alignment}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-5">--genome_guided_max_intron 10000 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-6">--max_memory <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${max_ram}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-7">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-8">--SS_lib_type RF <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-9">--output <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-10">--full_cleanup <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb11-11"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;&amp;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div>
<section id="rename-output-files-1" class="level2">
<h2 class="anchored" data-anchor-id="rename-output-files-1">4.1 Rename output files</h2>
<section id="rename-fasta-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-fasta-1">4.1.1 Rename FastA</h3>
<div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename generic assembly FastA</span></span>
<span id="cb12-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb12-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="rename-gene-map-and-log-1" class="level3">
<h3 class="anchored" data-anchor-id="rename-gene-map-and-log-1">4.1.2 Rename gene map and log</h3>
<div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity_out_dir.Trinity-GG.fasta.gene_trans_map <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.gene_trans_map</span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/trinity.log <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb13-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.log</span></code></pre></div>
</section>
</section>
<section id="create-fasta-index-1" class="level2">
<h2 class="anchored" data-anchor-id="create-fasta-index-1">4.2 Create FastA index</h2>
<div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb14-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta</span></code></pre></div>
</section>
<section id="checksums-1" class="level2">
<h2 class="anchored" data-anchor-id="checksums-1">4.3 Checksums</h2>
<div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span></span>
<span id="cb15-2"></span>
<span id="cb15-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta.md5</span></code></pre></div>
<pre><code>0c3073b02a10eb38893e296ce9d9dfb3  ptua-denovo-Trinity.fasta</code></pre>
<section id="assembly-stats-1" class="level3">
<h3 class="anchored" data-anchor-id="assembly-stats-1">4.3.1 Assembly stats</h3>
<section id="run-trinity-singularity-image.-2" class="level4">
<h4 class="anchored" data-anchor-id="run-trinity-singularity-image.-2">4.3.1.1 Run Trinity Singularity image.</h4>
<div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb17-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-B</span> /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-2">-e trinityrnaseq.v2.15.2.simg <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-3">/usr/local/bin/util/TrinityStats.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-4">../output/00.30-F-Ptua-transcriptome-assembly-Trinity/genome_guided_assembly/ptua-GG-Trinity.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ../output/00.30-F-Ptua-transcriptome-assembly-Trinity/genome_guided_assembly/ptua-GG-Trinity.stats</span></code></pre></div>
</section>
</section>
</section>
</section>
<section id="pasa-pipeline" class="level1">
<h1>5 PASA PIPELINE</h1>
<section id="concatenate-trinity-assemblies" class="level2">
<h2 class="anchored" data-anchor-id="concatenate-trinity-assemblies">5.1 Concatenate Trinity assemblies</h2>
<div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb18-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta</span></code></pre></div>
<section id="confirm-counts" class="level3">
<h3 class="anchored" data-anchor-id="confirm-counts">5.1.1 Confirm counts</h3>
<div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Count transcripts in each file</span></span>
<span id="cb19-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">denovo_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_guided_assembly_name}</span>.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pasa_count</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/transcripts.fasta<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb19-5"></span>
<span id="cb19-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate sum of first two counts</span></span>
<span id="cb19-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((denovo_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">genome_guided_count))</span></span>
<span id="cb19-8"></span>
<span id="cb19-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compare sum to PASA count</span></span>
<span id="cb19-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"De novo count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$denovo_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genome-guided count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$genome_guided_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sum: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PASA count: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-14"></span>
<span id="cb19-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-eq</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb19-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✓ Counts match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb19-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"✗ Counts do not match: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$sum</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> ≠ </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$pasa_count</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> (difference: </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$((pasa_count</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sum))</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb19-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span></code></pre></div>
<pre><code>De novo count: 1232241
Genome-guided count: 499541
Sum: 1731782
PASA count: 1731782
✓ Counts match: 1731782 = 1731782</code></pre>
</section>
</section>
<section id="extract-transcript-accessions" class="level2">
<h2 class="anchored" data-anchor-id="extract-transcript-accessions">5.2 Extract transcript accessions</h2>
<div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb21-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-3">-e <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/misc_utilities/accession_extractor.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${de_novo_output_dir}</span>/<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${denovo_assembly_name}</span>.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb21-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span>
<span id="cb21-7"></span>
<span id="cb21-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span>/tdn.accs</span></code></pre></div>
</section>
<section id="clean-transcripts" class="level2">
<h2 class="anchored" data-anchor-id="clean-transcripts">5.3 Clean transcripts</h2>
<div class="sourceCode" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb22-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb22-2"></span>
<span id="cb22-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-4">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-5">-e <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-6">--env USER=<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$USER</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-8"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/bin/seqclean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-9">transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-10">-c 16</span></code></pre></div>
</section>
<section id="pasa-assembly" class="level2">
<h2 class="anchored" data-anchor-id="pasa-assembly">5.4 PASA Assembly</h2>
<section id="fix-schema-key-length" class="level3">
<h3 class="anchored" data-anchor-id="fix-schema-key-length">5.4.1 Fix schema key length</h3>
<div class="sourceCode" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb23-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span></span>
<span id="cb23-2"></span>
<span id="cb23-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#### Fix schema key length issue ####</span></span>
<span id="cb23-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-5">cat /usr/local/src/PASApipeline/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-6"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> cdna_alignment_mysqlschema</span>
<span id="cb23-7"></span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix all variations of gene_id and model_id indexes</span></span>
<span id="cb23-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_id_idx (gene_id)/KEY gene_id_idx (gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY mod_idx (model_id)/KEY mod_idx (model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(gene_id)/(gene_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/(model_id)/(model_id(255))/g'</span> cdna_alignment_mysqlschema</span>
<span id="cb23-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/KEY gene_idx (annotation_version,gene_id)/KEY gene_idx (annotation_version,gene_id(255))/g'</span> cdna_alignment_mysqlschema</span></code></pre></div>
</section>
<section id="run-pasa-assembly-pipeline" class="level3">
<h3 class="anchored" data-anchor-id="run-pasa-assembly-pipeline">5.4.2 Run PASA Assembly Pipeline</h3>
<p>This was executed outside of RStudio due to the verbose output, which will cause RStudio to crash.</p>
<div class="sourceCode" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb24-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-8">--config alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-9">--create <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-10">--run <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-11">--genome <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-12">--transcripts transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-13">--trans_gtf <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${stringtie_gtf}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-14">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-15">-T <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-16">-u transcripts.fasta <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-17">--ALIGNERS blat,gmap,minimap2 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-18">--TDN tdn.accs <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-19">--transcribed_is_aligned_orient <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-20">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-21">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-22">--annots <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-23">--TRANSDECODER <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb24-24">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="alternative-splicing" class="level3">
<h3 class="anchored" data-anchor-id="alternative-splicing">5.4.3 Alternative Splicing</h3>
<p>This doesn’t seem to have run during the assembly phase, so ran separately.</p>
<div class="sourceCode" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb25-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-8">-c alignAssembly.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-9">--ALT_SPLICE <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-10">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-11">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb25-12">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
<section id="update-annotations" class="level3">
<h3 class="anchored" data-anchor-id="update-annotations">5.4.4 Update annotations</h3>
<p>Now includes alternative splicing info.</p>
<p>Uses output GFF3 from initial annotations as annotation <em>input</em>.</p>
<div class="sourceCode" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb26-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">singularity</span> exec <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-2">-B /home <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-3">-B /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-4">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/conf.txt:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/pasa_conf/conf.txt <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-5">-B <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PWD</span>/cdna_alignment_mysqlschema:<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/schema/cdna_alignment_mysqlschema <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_container}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PASA_HOME</span>/Launch_PASA_pipeline.pl <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-8">-c annotCompare.config <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-9">--annot_compare <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-10">-L <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-11">--annots ptua_pasa.gene_structures_post_PASA_updates.2550175.gff3 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-12">-g <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_fasta}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-13">-t all.transcripts.fasta.clean <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-14">--CPU <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${threads}</span></span></code></pre></div>
</section>
</section>
</section>
<section id="pasa-outputs" class="level1">
<h1>6 PASA OUTPUTS</h1>
<section id="generate-checksums" class="level2">
<h2 class="anchored" data-anchor-id="generate-checksums">6.1 Generate checksums</h2>
<div class="sourceCode" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb27-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-2"></span>
<span id="cb27-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.gff3 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.gff3.md5</span>
<span id="cb27-4"></span>
<span id="cb27-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.bed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.bed.md5</span></code></pre></div>
<pre><code>3f86269b7aec49a2f1aabbfe0786f31a  ptua_pasa.gene_structures_post_PASA_updates.3761026.gff3
d258401d384efb01543b030a72ec77ac  ptua_pasa.gene_structures_post_PASA_updates.3761026.bed</code></pre>
</section>
<section id="rename-outputs" class="level2">
<h2 class="anchored" data-anchor-id="rename-outputs">6.2 Rename outputs</h2>
<div class="sourceCode" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb29-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.gff3 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-3"></span>
<span id="cb29-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> ptua_pasa.gene_structures_post_PASA_updates.3761026.bed <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-5"></span>
<span id="cb29-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span>
<span id="cb29-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_bed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.md5</span></code></pre></div>
<pre><code>3f86269b7aec49a2f1aabbfe0786f31a  ptua-PASA.gff3
d258401d384efb01543b030a72ec77ac  ptua-PASA.bed</code></pre>
</section>
<section id="gff3-preview" class="level2">
<h2 class="anchored" data-anchor-id="gff3-preview">6.3 GFF3 Preview</h2>
<div class="sourceCode" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb31-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 50 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span></code></pre></div>
<pre><code># PASA_UPDATE: mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1, single gene model update, valid-1, status:[pasa:asmbl_433257,status:3], valid-1
Pocillopora_meandrina_HIv1___xfSc0000885    .   gene    25319   26417   .   +   .   ID=gene-Pocillopora_meandrina_HIv1___TS.g4079.t1;Name=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1
Pocillopora_meandrina_HIv1___xfSc0000885    .   mRNA    25319   26417   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1;Parent=gene-Pocillopora_meandrina_HIv1___TS.g4079.t1;Name=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1
Pocillopora_meandrina_HIv1___xfSc0000885    .   exon    25319   25469   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1.exon1;Parent=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1
Pocillopora_meandrina_HIv1___xfSc0000885    .   CDS 25319   25469   .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1.cds.1;Parent=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1
Pocillopora_meandrina_HIv1___xfSc0000885    .   exon    26266   26417   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1.exon2;Parent=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1
Pocillopora_meandrina_HIv1___xfSc0000885    .   CDS 26266   26417   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1.cds.2;Parent=mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1


#PROT mrna-Pocillopora_meandrina_HIv1___TS.g4079.t1 gene-Pocillopora_meandrina_HIv1___TS.g4079.t1   MAADSDSQKRKRLAGAHYKNTELPQEDEPLTLPKHYIGEQLAGEFGRVDTGPVLIQRKDIRLKKTPKKIGSDWRPSRTKSLQVIAIRAAKLRGGKPDEHG*

# PASA_UPDATE: mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1, single gene model update, valid-1, status:[pasa:asmbl_432824,status:3], valid-1
Pocillopora_meandrina_HIv1___xfSc0000812    .   gene    9924    23544   .   +   .   ID=gene-Pocillopora_meandrina_HIv1___RNAseq.g77.t1;Name=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   mRNA    9924    23544   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1;Parent=gene-Pocillopora_meandrina_HIv1___RNAseq.g77.t1;Name=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    9924    9945    .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon1;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 9924    9945    .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.1;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    10159   10230   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon2;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 10159   10230   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.2;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    11013   11102   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon3;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 11013   11102   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.3;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    13397   13465   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon4;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 13397   13465   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.4;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    15786   15809   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon5;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 15786   15809   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.5;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    16488   16556   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon6;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 16488   16556   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.6;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    17143   17391   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon7;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 17143   17391   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.7;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    17592   19513   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon8;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 17592   19513   .   +   2   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.8;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    21811   23544   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.exon9;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 21811   22104   .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.cds.9;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   three_prime_UTR 22105   23544   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1.utr3p1;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1


#PROT mrna-Pocillopora_meandrina_HIv1___RNAseq.g77.t1 gene-Pocillopora_meandrina_HIv1___RNAseq.g77.t1   METAKWEGTSSLTVVPTTGHGRELEESRGGTDTVPLLVSPTSEPEEELEPGELRMELPRMKDISAEEESCKSDDPSENKRRRLADLAEQLITDNSTGEESFKSDDPSENKRRRLAEPLNVEKCQEQLKSYYNTFSKVKIIPWDDSSSIQIDEIYTPLSWVRDHRKPSGVTQEELEDYTDMFKEKPTRMLVYGRPGIGKNKVLLILDGYDEYSFAEEHSPILEIWKGELLRDCHVIVTTRQLKCDELRGPSHVQLEIQGFKSRERKETFARKFMAGEEDLDEFNLYLEEKDLYDMAEIPLLLLMLCSLWKEKRHEGLPKSRADIFTQFIQTMLDHKGGSHQSMPFQKVTSTEAREDLSNLGKAAFEALLQDRLYVRCIKLPGNISRSLEKLSEVGLFQIVNLTSLNPERGAYFIHKSVQEFLAAWHIKEEVLSNKGESTLSLSKVESFEEIVKMKEVLKFACELSTEAACAVFRHVGSVGRKESVSEFDFIELLLEDEELPVNEEVYHELIWHSYFCCSAEKRRDLCSVFPSCTGGGFLYLDSNRVNITANEHLLKSGMIPDFIFFPDYENSSEKSYRDLITVAEDTNAVFLSRSGEKKAADVLKKFPRRPMDEFFLKRERKIVVYVNQIRKGRNVSTFPTEMLRELISPTAESTQVTRLVDPLNEHDRETASSFTQNTDSITGPTPQSLSRVKQIDIVGIERQEIKMLADFLPLFTALRRIDIYGEPFEIIAAQLTETLVSRIIFNDRLHTLVLANINLTAKPAAVIARSLHQANGLQRLGLSWNPLGEGVSVLIQHLSRVPHLEWLWLSEVKMTKQQVNDLSAAVRQSNISWLETDYHDCKGNVKPEEEWPTDEYWSDYWWESEEESDPGSVTDSGEEEEPGSVTNSGDEGDPGSVTDSSDQEDPGLVTDSGGEEDPGSVTDSGDKEEPGSCLET*

# PASA_UPDATE: mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1, single gene model update, valid-1, status:[pasa:asmbl_432858,status:12], valid-1
# PASA_UPDATE: mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.1.6992b91d, single gene model update, valid-1, status:[pasa:asmbl_432855,status:12], valid-1
Pocillopora_meandrina_HIv1___xfSc0000812    .   gene    34067   37241   .   +   .   ID=gene-Pocillopora_meandrina_HIv1___RNAseq.g78.t1;Name=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   mRNA    34073   35237   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1;Parent=gene-Pocillopora_meandrina_HIv1___RNAseq.g78.t1;Name=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    34073   34168   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.exon1;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 34073   34168   .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.cds.1;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    34483   34488   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.exon2;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 34483   34488   .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.cds.2;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    34894   34988   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.exon3;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 34894   34988   .   +   0   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.cds.3;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   exon    35222   35237   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.exon4;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   CDS 35222   35237   .   +   1   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.cds.4;Parent=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1
Pocillopora_meandrina_HIv1___xfSc0000812    .   mRNA    34067   37241   .   +   .   ID=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1.1.6992b91d;Parent=gene-Pocillopora_meandrina_HIv1___RNAseq.g78.t1;Name=mrna-Pocillopora_meandrina_HIv1___RNAseq.g78.t1</code></pre>
</section>
<section id="gff-comparisons" class="level2">
<h2 class="anchored" data-anchor-id="gff-comparisons">6.4 GFF Comparisons</h2>
<div class="sourceCode" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb33-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'%s\n\n'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original GFF feature counts:"</span></span>
<span id="cb33-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${genome_gff}</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span>
<span id="cb33-4"></span>
<span id="cb33-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb33-8"></span>
<span id="cb33-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Updated GFF feature counts:"</span></span>
<span id="cb33-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"\t"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'!/^#/ &amp;&amp; !/^[[:space:]]*$/ &amp;&amp; NF &gt; 0 &amp;&amp; $3 != "" {print $3}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>/<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb33-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniq</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{print $2, $1}'</span></span></code></pre></div>
<pre><code>Original GFF feature counts:

exon 208535
CDS 208535
transcript 31840

-----------------------------------------------

Updated GFF feature counts:

exon 351589
CDS 341675
mRNA 43292
gene 32019
five_prime_UTR 22150
three_prime_UTR 21812</code></pre>
</section>
</section>
<section id="extract-proteins-to-fasta" class="level1">
<h1>7 EXTRACT PROTEINS TO FASTA</h1>
<div class="sourceCode" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb35-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-2"></span>
<span id="cb35-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">awk</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'/^#PROT / {print "&gt;" $2 "." $3 "\n" $4}'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ptua-proteins-PASA.fasta</span>
<span id="cb35-4"></span>
<span id="cb35-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Original protein counts:"</span></span>
<span id="cb35-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^#PROT"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_gff}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-7"></span>
<span id="cb35-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${line}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb35-11"></span>
<span id="cb35-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">printf</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s\n\n"</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Extracted protein counts:"</span></span>
<span id="cb35-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--count</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^&gt;"</span> ptua-proteins-PASA.fasta</span>
<span id="cb35-14"></span>
<span id="cb35-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create FastA Index</span></span>
<span id="cb35-16"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${samtools}</span> faidx ptua-proteins-PASA.fasta</span></code></pre></div>
<pre><code>Original protein counts:

43292

-----------------------------------------------

Extracted protein counts:

43292</code></pre>
<section id="checksums-2" class="level2">
<h2 class="anchored" data-anchor-id="checksums-2">7.1 Checksums</h2>
<div class="sourceCode" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb37-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${pasa_output_dir}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md5sum</span> ptua-proteins-PASA.fasta <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tee</span> ptua-proteins-PASA.fasta.md5</span></code></pre></div>
<pre><code>d41376d2ac0a8f41b0bbe333ed8cf08b  ptua-proteins-PASA.fasta</code></pre>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Trinity</category>
  <category>E5</category>
  <category>PASA</category>
  <category>transcriptome assembly</category>
  <category>Pocillopora tuahiensis</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-De-Novo-Transcriptome-Assembly-and-Annotation---E5-P.tuahiensis-RNA-seq-Using-Trinity-and-PASA/</guid>
  <pubDate>Fri, 27 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>PASA Web Portal - Configuration on Gannet Using Synology Container Manager</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-PASA-Web-Portal---Configuration-on-Gannet-Using-Synology-Container-Manager/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>The <a href="https://github.com/PASApipeline/PASApipeline/wiki">PASA pipeline</a> (GitHub) was used to generate transcriptome annotations using the RNA-seq data for the three coral species in the <a href="https://github.com/urol-e5/timeseries_molecular">`timeseries_molecular project</a> (GitHub) project. The PASA web portal provides a user-friendly interface to explore and visualize the results of the PASA pipeline, including gene models, alignments, and annotations.</p>
<p>Below, I detail the steps I took to configure the PASA web portal on Gannet using the Synology Container Manager. This includes building a custom Docker image with the necessary Perl modules, transferring it to the Synology, and setting up the container to run the PASA web portal.</p>
</section>
<section id="methods" class="level1">
<h1>METHODS</h1>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The example below uses the <code>peve_pasa</code> database, but you can replace it with your database name as needed.</p>
</div>
</div>
<section id="build-and-transfer-docker-image" class="level2">
<h2 class="anchored" data-anchor-id="build-and-transfer-docker-image">Build and Transfer Docker Image</h2>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>This doesn’t have to be done on a local computer; you can build the image directly on the Synology if you have the necessary tools and permissions. However, building locally and transferring can be faster and more convenient in some cases.</p>
</div>
</div>
<ol type="1">
<li><p>Build the image (if not already done)</p>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /home/shared/8TB_HDD_01/sam/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/PASA</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> docker build <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> pasapipeline-fixed:latest <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> Dockerfile.pasaweb .</span></code></pre></div>
<p>Here’s what’s in <code>Dockerfile.pasaweb</code>:</p>
<div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">$</span> cat Dockerfile.pasaweb</span>
<span id="cb2-2"></span>
<span id="cb2-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">FROM</span> pasapipeline/pasapipeline:latest</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Install missing Perl modules required for PasaWeb</span></span>
<span id="cb2-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">RUN</span> cpan <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> CGI GD::Graph</span>
<span id="cb2-7"></span>
<span id="cb2-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Keep the original entrypoint</span></span></code></pre></div></li>
<li><p>Save the image to a tar file.</p>
<div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> docker save pasapipeline-fixed:latest <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-2"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> /home/sam/pasapipeline-fixed.tar</span></code></pre></div></li>
<li><p>Transfer to Synology (replace with your Synology details).</p>
<div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rsync</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-avP</span> pasapipeline-fixed.tar <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb4-2">gannet:/volume2/docker/PASA_web_portal/</span></code></pre></div></li>
</ol>
</section>
<section id="synology-configuration-steps" class="level2">
<h2 class="anchored" data-anchor-id="synology-configuration-steps">Synology Configuration Steps</h2>
<section id="command-line-setup" class="level3">
<h3 class="anchored" data-anchor-id="command-line-setup">Command Line Setup</h3>
<p>On Synology, via command line:</p>
<section id="load-the-pre-built-image" class="level4">
<h4 class="anchored" data-anchor-id="load-the-pre-built-image">Load the pre-built image</h4>
<div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"></span>
<span id="cb5-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /volume2/docker/PASA_web_portal</span>
<span id="cb5-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> docker load <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> pasapipeline-fixed.tar</span></code></pre></div>
</section>
<section id="grant-mysql-permissions-if-not-already-done" class="level4">
<h4 class="anchored" data-anchor-id="grant-mysql-permissions-if-not-already-done">Grant MySQL permissions (if not already done):</h4>
<div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mysql</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-u</span> root <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>password<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span></span></code></pre></div>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode sql code-with-copy"><code class="sourceCode sql"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">GRANT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">SELECT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">ON</span> peve_pasa.<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">TO</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pasa_access'</span>@<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'localhost'</span>;</span>
<span id="cb7-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">GRANT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">SELECT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">ON</span> apul_pasa.<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">TO</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pasa_access'</span>@<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'localhost'</span>;</span>
<span id="cb7-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">GRANT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">SELECT</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">ON</span> ptua_pasa.<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">TO</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pasa_access'</span>@<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'localhost'</span>;</span>
<span id="cb7-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">FLUSH</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">PRIVILEGES</span>;</span></code></pre></div>
</section>
<section id="createimport-databases-if-not-already-done" class="level4">
<h4 class="anchored" data-anchor-id="createimport-databases-if-not-already-done">Create/import databases (if not already done):</h4>
<div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mysql</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-u</span> root <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-h127.0.0.1</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-P3307</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;&lt;'EOF'</span></span>
<span id="cb8-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">CREATE DATABASE IF NOT EXISTS peve_pasa;</span></span>
<span id="cb8-3"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">EOF</span></span></code></pre></div>
</section>
<section id="fix-collation-issue-in-the-sql-dump-file-if-needed" class="level4">
<h4 class="anchored" data-anchor-id="fix-collation-issue-in-the-sql-dump-file-if-needed">Fix collation issue in the SQL dump file (if needed):</h4>
<div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sed</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'/volume2/web/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/PASA/peve_pasa_backup.sql'</span></span></code></pre></div>
</section>
<section id="load-the-sql-dump-into-the-database" class="level4">
<h4 class="anchored" data-anchor-id="load-the-sql-dump-into-the-database">Load the SQL dump into the database:</h4>
<div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mysql</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-u</span> root <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>password<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> -h127.0.0.1 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-P3307</span> peve_pasa <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-2">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> /volume2/web/gitrepos/urol-e5/timeseries_molecular/E-Peve/output/00.30-E-Peve-transcriptome-assembly-Trinity/PASA/peve_pasa_backup.sql</span></code></pre></div>
</section>
</section>
<section id="web-interface" class="level3">
<h3 class="anchored" data-anchor-id="web-interface">Web Interface</h3>
<p>Then, access the Synology via the web interface and set up the container.</p>
<p>In the Container Manager app, create a new container with these settings:</p>
<p>Go to the “Image” tab You should see pasapipeline-fixed:latest in the list of images.</p>
<p>Click on the image, then click “Launch” or “Run”</p>
<p>This opens the container creation wizard where you configure: - Container name - Port mappings - Volume mounts - Environment variables - xecution Command: <code>bash -c "cp /pasa_data/conf.txt /usr/local/src/PASApipeline/pasa_conf/conf.txt &amp;&amp; /usr/local/src/PASApipeline/run_PasaWeb.pl 9000"</code> - Port Settings:</p>
<pre><code>- Local Port: 9000
- Container Port: 9000
- Type: TCP
- Volume Mappings:</code></pre>
<ul>
<li><p>Host: /volume1/path/to/PASA/directory</p></li>
<li><p>Container: /pasa_data</p></li>
<li><p>Network:</p></li>
<li><p>Use bridge mode</p></li>
<li><p>Working Directory:</p></li>
</ul>
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-PASA-Web-Portal---Configuration-on-Gannet-Using-Synology-Container-Manager/screenshot-pasa-portal-configuration-01.png" class="img-fluid"></p>
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-PASA-Web-Portal---Configuration-on-Gannet-Using-Synology-Container-Manager/screenshot-pasa-portal-configuration-02.png" class="img-fluid"></p>
</section>
<section id="access" class="level3">
<h3 class="anchored" data-anchor-id="access">Access</h3>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p><code>http</code> is used instead of <code>https</code> because the PASA web portal does not support SSL/TLS. Ensure that your network is secure and consider using a VPN if accessing remotely.</p>
</div>
</div>
<p>http://gannet.fish.washington.edu:9000 Enter database name when prompted (e.g., peve_pasa)</p>


</section>
</section>
</section>

 ]]></description>
  <category>gannet</category>
  <category>MySQL</category>
  <category>PASA</category>
  <category>2026</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-27-PASA-Web-Portal---Configuration-on-Gannet-Using-Synology-Container-Manager/</guid>
  <pubDate>Fri, 27 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>qPCR Analysis - M.gigas PolyIC Data from Valentinas Project</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>This is an analysis of qPCR data from <em>Magallana gigas</em> (Pacific oyster) samples treated with PolyIC (a synthetic analog of double-stranded RNA that mimics viral infection) and subjected to different stress types (Temperature, Mechanical, Control). The goal was to assess gene expression changes in response to these treatments.</p>
<p>The qPCR data was generated by me on January 27-29, 2026, as part of Valentina’s project on immune responses in oysters. Eight genes were targeted: ATP Synthase, Citrate Synthase, DNMT1, HSP70, HSP90, cGAS, and VIPERIN. GAPDH was used as the normalizing gene. Notebook entries documenting the qPCR runs and data exports can be found in the following posts:</p>
<ul>
<li><a href="../2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/">2026-01-27-qPCRs - M.gigas Valentina PolyIC cGAS, citrate_synthase, and DNMT1</a></li>
<li><a href="../2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/">2026-01-28-qPCRs - M.gigas Valentina PolyIC ATP synthase, GAPDH, HSP70, and HSP90</a></li>
<li><a href="../2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/">2026-01-29-qPCR - M.gigas Valentina PolyIC VIPERIN</a></li>
</ul>
<p>I also managed to track down the qPCRs run on the RNA I isolated on <a href="../2025-08-04-RNA-Isolation-and-Quantification---C.gigas-PolyIC-Mechanical-Trials-for-Valentina-Using-Quick-DNA-RNA-MiniPrep-Plus-Kit/">isolated on 20250804</a>. After RNA isolation, they were passed to Valentina for reverse transcription and qPCR. I believe those qPCRs were run/analyzed by Aakriti <a href="https://genefish.wordpress.com/2025/08/14/results-from-qpcr-with-valentina/">on 20250814</a> (Notebook entry). I found the files here:</p>
<ul>
<li><p><a href="https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-14%2011-11-18_Connect_ATPase_vv.pcrd">https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-14%2011-11-18_Connect_ATPase_vv.pcrd</a></p></li>
<li><p><a href="https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-12%2014-19-37_Connect_HSP70_vv.pcrd">https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-12%2014-19-37_Connect_HSP70_vv.pcrd</a></p></li>
<li><p><a href="https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-12%2011-18-15_Connect_citrate_VV.pcrd">https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-12%2011-18-15_Connect_citrate_VV.pcrd</a></p></li>
<li><p><a href="https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-08%2014-18-00_Connect_GAPDH.pcrd">https://owl.fish.washington.edu/scaphapoda/qPCR_data/cfx_connect_data/admin_2025-08-08%2014-18-00_Connect_GAPDH.pcrd</a></p></li>
</ul>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>I have not taken the time to evaluate the qPCRs run by Aakriti in detail. I’ve relied on the processing below to filter out samples with poor technical replicates. Maybe these can be revisited at a later date to see if any samples need to be re-run.</p>
</div>
</div>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>opts_chunk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set</span>(</span>
<span id="cb1-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">echo =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display code chunks</span></span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Evaluate code chunks</span></span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide warnings</span></span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">message =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Hide messages</span></span>
<span id="cb1-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comment =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prevents appending '##' to beginning of lines in code output</span></span>
<span id="cb1-7">)</span>
<span id="cb1-8"></span>
<span id="cb1-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tidyverse)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stderr">
<pre><code>── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.2     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (&lt;http://conflicted.r-lib.org/&gt;) to force all conflicts to become errors</code></pre>
</div>
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(car)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stderr">
<pre><code>Loading required package: carData

Attaching package: 'car'

The following object is masked from 'package:dplyr':

    recode

The following object is masked from 'package:purrr':

    some</code></pre>
</div>
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(emmeans)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stderr">
<pre><code>Welcome to emmeans.
Caution: You lose important information if you filter this package's results.
See '? untidy'</code></pre>
</div>
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(multcomp)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stderr">
<pre><code>Loading required package: mvtnorm
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS

Attaching package: 'MASS'

The following object is masked from 'package:dplyr':

    select


Attaching package: 'TH.data'

The following object is masked from 'package:MASS':

    geyser</code></pre>
</div>
</div>
</section>
<section id="load-data" class="level1">
<h1>Load Data</h1>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load qPCR data</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define file URLs and target names in a structured format</span></span>
<span id="cb9-4">file_list <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb9-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CITRATE SYNTHASE</span></span>
<span id="cb9-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_15-32-08_Connect-citrate_synthase-01--Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-7">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"citrate_synthase"</span>),</span>
<span id="cb9-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_15-30-47_CFX96-citrate_synthase-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-9">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"citrate_synthase"</span>),</span>
<span id="cb9-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_16-31-12_Connect-citrate_synthase-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-11">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"citrate_synthase"</span>),</span>
<span id="cb9-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/admin_2025-08-12%2011-18-15_Connect_citrate_VV-SJW-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-13">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"citrate_synthase"</span>),</span>
<span id="cb9-14">  </span>
<span id="cb9-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DNMT1</span></span>
<span id="cb9-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_13-34-02_Connect-DNMT1-01-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-17">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>),</span>
<span id="cb9-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_13-29-34_CFX96-DNMT1-02%20Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-19">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>),</span>
<span id="cb9-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_14-33-31_Connect-DNMT1-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-21">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>),</span>
<span id="cb9-22">  </span>
<span id="cb9-23">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cGAS</span></span>
<span id="cb9-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_11-25-14_Connect-cGAS-01-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-25">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>),</span>
<span id="cb9-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_11-49-08_CFX96-cGAS-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-27">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>),</span>
<span id="cb9-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-27-qPCRs---M.gigas-Valentina-PolyIC-cGAS-citrate_synthase-and-DNMT1/sam_2026-01-27_12-35-04_Connect-cGAS-03-QuantificationCq_Results.csv"</span>, </span>
<span id="cb9-29">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>),</span>
<span id="cb9-30">  </span>
<span id="cb9-31">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATP SYNTHASE</span></span>
<span id="cb9-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_09-56-00_Connect-ATP_synthase-01-QuantificationCq_Results.csv"</span>, </span>
<span id="cb9-33">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP_synthase"</span>),</span>
<span id="cb9-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_10-13-15_CFX96-ATP_synthase-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-35">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP_synthase"</span>),</span>
<span id="cb9-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_10-55-49_Connect-ATP_synthase-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-37">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP_synthase"</span>),</span>
<span id="cb9-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/admin_2025-08-14%2011-11-18_Connect_ATPase_vv-SJW-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-39">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP_synthase"</span>),</span>
<span id="cb9-40">  </span>
<span id="cb9-41">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># GAPDH</span></span>
<span id="cb9-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_12-06-16_Connect-GAPDH-01-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-43">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>),</span>
<span id="cb9-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_12-07-20_CFX96-GAPDH-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-45">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>),</span>
<span id="cb9-46">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_13-05-59_Connect-GAPDH-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-47">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>),</span>
<span id="cb9-48">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/admin_2025-08-08%2014-18-00_Connect_GAPD-SJW-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-49">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>),</span>
<span id="cb9-50">  </span>
<span id="cb9-51">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP70</span></span>
<span id="cb9-52">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_14-03-35_Connect-HSP70-01-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-53">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>),</span>
<span id="cb9-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_14-25-31_CFX96-HSP70-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-55">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>),</span>
<span id="cb9-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_15-00-57_Connect-HSP70-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-57">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>),</span>
<span id="cb9-58">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/admin_2025-08-12%2014-19-37_Connect_HSP70_vv-SJW-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-59">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>),</span>
<span id="cb9-60">  </span>
<span id="cb9-61">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP90</span></span>
<span id="cb9-62">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28-16-06-43_Connect-HSP90-01-QuantificationCq_Results.csv"</span>, </span>
<span id="cb9-63">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>),</span>
<span id="cb9-64">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_16-07-47_CFX96-HSP90-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-65">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>),</span>
<span id="cb9-66">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-28-qPCRs---M.gigas-Valentina-PolyIC-ATP-synthase-GAPDH-HSP70-and-HSP90/sam_2026-01-28_17-07-09_Connect-HSP90-03-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-67">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>),</span>
<span id="cb9-68">  </span>
<span id="cb9-69">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VIPERIN</span></span>
<span id="cb9-70">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/sam_2026-01-29_07-21-16_Connect-VIPERIN-01-QuantificationCq_Results.csv"</span>, </span>
<span id="cb9-71">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>),</span>
<span id="cb9-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/sam_2026-01-29_07-39-06_CFX96-VIPERIN-02-Quantification-Cq_Results.csv"</span>, </span>
<span id="cb9-73">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>),</span>
<span id="cb9-74">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/RobertsLab/sams-notebook/refs/heads/master/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/sam_2026-01-29_08-24-59_Connect-VIPERIN-03-QuantificationCq_Results.csv"</span>, </span>
<span id="cb9-75">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gene =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>)</span>
<span id="cb9-76">)</span>
<span id="cb9-77"></span>
<span id="cb9-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load all files and combine automatically</span></span>
<span id="cb9-79">qpcr_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_df</span>(file_list, <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(file_info) {</span>
<span id="cb9-80">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read.csv</span>(file_info<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-81">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> file_info<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>target)</span>
<span id="cb9-82">})</span></code></pre></div>
</details>
</div>
</section>
<section id="functions" class="level1">
<h1>Functions</h1>
<section id="calculate-delta-cq" class="level2">
<h2 class="anchored" data-anchor-id="calculate-delta-cq">Calculate delta Cq</h2>
<p>Normalized to designated normalizing gene</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">calculate_delta_Cq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(df) {</span>
<span id="cb10-2">  df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_Cq =</span> Cq.Mean <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cq.Mean[Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb10-6">  </span>
<span id="cb10-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(df)</span>
<span id="cb10-8">}</span></code></pre></div>
</details>
</div>
</section>
</section>
<section id="data-cleaning" class="level1">
<h1>Data Cleaning</h1>
<section id="remove-ntc-samples" class="level2">
<h2 class="anchored" data-anchor-id="remove-ntc-samples">Remove NTC samples</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Remove rows with Sample name "NTC" or empty/NA Sample names</span></span>
<span id="cb11-2">qpcr_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb11-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NTC"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> Sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb11-4"></span>
<span id="cb11-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>(qpcr_data)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>'data.frame':   2463 obs. of  16 variables:
 $ X                     : logi  NA NA NA NA NA NA ...
 $ Well                  : chr  "A01" "A02" "A03" "A04" ...
 $ Fluor                 : chr  "SYBR" "SYBR" "SYBR" "SYBR" ...
 $ Target                : chr  "Citrate.Synthase" "Citrate.Synthase" "Citrate.Synthase" "Citrate.Synthase" ...
 $ Content               : chr  "Unkn-01" "Unkn-01" "Unkn-01" "Unkn-02" ...
 $ Sample                : chr  "A1C" "A1C" "A1C" "A2C" ...
 $ Biological.Set.Name   : logi  NA NA NA NA NA NA ...
 $ Cq                    : num  24.1 24 23.8 25.1 24.7 ...
 $ Cq.Mean               : num  23.9 23.9 23.9 24.9 24.9 ...
 $ Cq.Std..Dev           : num  0.147 0.147 0.147 0.208 0.208 ...
 $ Starting.Quantity..SQ.: num  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ Log.Starting.Quantity : num  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ SQ.Mean               : num  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ SQ.Std..Dev           : num  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ Set.Point             : int  60 60 60 60 60 60 60 60 60 60 ...
 $ Well.Note             : logi  NA NA NA NA NA NA ...</code></pre>
</div>
</div>
</section>
<section id="check-for-high-standard-deviations" class="level2">
<h2 class="anchored" data-anchor-id="check-for-high-standard-deviations">Check for high standard deviations</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter out rows where Cq.Std..Dev is NA</span></span>
<span id="cb13-2">qpcr_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_data[<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(qpcr_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Cq.Std..Dev), ]</span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter rows where Cq.Std..Dev is greater than 0.5</span></span>
<span id="cb13-5">high_cq_std_dev <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_data[qpcr_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Cq.Std..Dev <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, ]</span>
<span id="cb13-6"></span>
<span id="cb13-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the filtered rows with specified columns, without row names</span></span>
<span id="cb13-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(high_cq_std_dev[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cq"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cq.Std..Dev"</span>)], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">row.names =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>           Target Sample       Cq Cq.Std..Dev
 Citrate.Synthase   D4PC 23.58953   1.2262012
 Citrate.Synthase   D4PC 25.22609   1.2262012
 Citrate.Synthase   D4PC 25.98956   1.2262012
 Citrate.Synthase   C1PT 24.22698   0.6305806
 Citrate.Synthase   C1PT 24.09781   0.6305806
 Citrate.Synthase   C1PT 25.24885   0.6305806
 Citrate.Synthase   C5PT 24.30653   0.6151831
 Citrate.Synthase   C5PT 24.05928   0.6151831
 Citrate.Synthase   C5PT 25.22670   0.6151831
            DNMT1    A5M 30.84670   1.9690822
            DNMT1    A5M 27.36680   1.9690822
            DNMT1    A5M 30.70349   1.9690822
            DNMT1   D4PC 31.61104   0.6475757
            DNMT1   D4PC 31.51718   0.6475757
            DNMT1   D4PC 30.44542   0.6475757
            DNMT1   D5PC 31.81420   0.8774717
            DNMT1   D5PC 30.09977   0.8774717
            DNMT1   D5PC 31.28165   0.8774717
            DNMT1   D4PM 31.84097   0.6990197
            DNMT1   D4PM 31.56654   0.6990197
            DNMT1   D4PM 32.89094   0.6990197
            DNMT1   A3PT 31.37176   0.6647356
            DNMT1   A3PT 31.00085   0.6647356
            DNMT1   A3PT 32.29195   0.6647356
            DNMT1   C3PT 30.93391   1.9559044
            DNMT1   C3PT 34.32213   1.9559044
            DNMT1   C3PT 30.93490   1.9559044
            DNMT1   D4PT 28.51543   0.8274428
            DNMT1   D4PT 29.40357   0.8274428
            DNMT1   D4PT 30.16879   0.8274428
             cGAS    A1C 31.09889   0.5958513
             cGAS    A1C 30.51096   0.5958513
             cGAS    A1C 29.90723   0.5958513
             cGAS    A3C 30.71172   0.6725415
             cGAS    A3C 30.23246   0.6725415
             cGAS    A3C 29.38366   0.6725415
             cGAS    A4C 32.47341   0.5704754
             cGAS    A4C 31.67087   0.5704754
             cGAS    A4C 31.36981   0.5704754
             cGAS    B1C 28.69140   1.5243846
             cGAS    B1C 31.55769   1.5243846
             cGAS    B1C 29.22481   1.5243846
             cGAS    C1C 29.16134   0.7172895
             cGAS    C1C 29.31145   0.7172895
             cGAS    C1C 30.47195   0.7172895
             cGAS    C3M 29.88386   1.8065816
             cGAS    C3M 29.81184   1.8065816
             cGAS    C3M 32.97631   1.8065816
             cGAS    A5T 33.66309   2.4759798
             cGAS    A5T 29.55374   2.4759798
             cGAS    A5T 29.21543   2.4759798
             cGAS   D4PC 29.52347   0.7216823
             cGAS   D4PC 29.38534   0.7216823
             cGAS   D4PC 30.69866   0.7216823
             cGAS   B2PT 30.33579   2.9187950
             cGAS   B2PT 35.74373   2.9187950
             cGAS   B2PT 31.13614   2.9187950
             cGAS   C2PT 29.41279   0.8378923
             cGAS   C2PT 29.04691   0.8378923
             cGAS   C2PT 30.64611   0.8378923
             cGAS   D1PT 31.53902   1.1351264
             cGAS   D1PT 33.08089   1.1351264
             cGAS   D1PT 33.75305   1.1351264
     ATP.Synthase    B1M 21.94408   0.6345520
     ATP.Synthase    B1M 22.95451   0.6345520
     ATP.Synthase    B1M 23.11430   0.6345520
     ATP.Synthase   C3PC 24.15370   0.5694444
     ATP.Synthase   C3PC 23.19252   0.5694444
     ATP.Synthase   C3PC 23.14405   0.5694444
     ATP.Synthase   D3PT 24.70960   0.5708900
     ATP.Synthase   D3PT 24.60682   0.5708900
     ATP.Synthase   D3PT 25.64301   0.5708900
     ATP.Synthase   A1PC 29.49846   3.7832839
     ATP.Synthase   A1PC 30.53143   3.7832839
     ATP.Synthase   A1PC 23.52346   3.7832839
     ATP.Synthase   A2PC 29.79862   4.1202801
     ATP.Synthase   A2PC 30.34860   4.1202801
     ATP.Synthase   A2PC 22.95298   4.1202801
     ATP.Synthase   A4PC 31.51927   0.8092799
     ATP.Synthase   A4PC 32.72186   0.8092799
     ATP.Synthase   A4PC 33.05872   0.8092799
     ATP.Synthase   A2PC 29.22068   1.2680354
     ATP.Synthase   A2PC 31.04155   1.2680354
     ATP.Synthase   A2PC 31.65986   1.2680354
     ATP.Synthase   A1PM 25.88041   0.5968540
     ATP.Synthase   A1PM 25.38009   0.5968540
     ATP.Synthase   A1PM 26.56884   0.5968540
     ATP.Synthase   B1PC 28.20285   3.0574664
     ATP.Synthase   B1PC 33.21694   3.0574664
     ATP.Synthase   B1PC 33.74113   3.0574664
     ATP.Synthase   B2PC 31.61585   2.4554921
     ATP.Synthase   B2PC 26.77269   2.4554921
     ATP.Synthase   B2PC 28.48989   2.4554921
     ATP.Synthase   B5PC 33.25991   0.9734783
     ATP.Synthase   B5PC 33.02801   0.9734783
     ATP.Synthase   B5PC 34.81807   0.9734783
     ATP.Synthase   A2PM 31.87285   4.1105820
     ATP.Synthase   A2PM 25.74462   4.1105820
     ATP.Synthase   A2PM 24.06276   4.1105820
     ATP.Synthase   A3PM 37.05442   6.7379697
     ATP.Synthase   A3PM 23.69949   6.7379697
     ATP.Synthase   A3PM 31.93743   6.7379697
     ATP.Synthase   A4PM 30.86969   1.3433926
     ATP.Synthase   A4PM 31.10307   1.3433926
     ATP.Synthase   A4PM 33.30441   1.3433926
     ATP.Synthase   A5PM 23.07786   1.7068305
     ATP.Synthase   A5PM 23.92584   1.7068305
     ATP.Synthase   A5PM 26.36550   1.7068305
     ATP.Synthase   B1PM 31.02730   5.0891703
     ATP.Synthase   B1PM 23.83012   5.0891703
     ATP.Synthase   B2PM 30.27510   4.3654487
     ATP.Synthase   B2PM 24.10142   4.3654487
     ATP.Synthase   B3PM 38.17801   8.9249343
     ATP.Synthase   B3PM 22.96081   8.9249343
     ATP.Synthase   B3PM 22.48913   8.9249343
            GAPDH    A3T 22.96407   0.6473489
            GAPDH    A3T 23.45998   0.6473489
            GAPDH    A3T 24.24775   0.6473489
            GAPDH   B1PC 29.43218   1.2082882
            GAPDH   B1PC 29.11486   1.2082882
            GAPDH   B1PC 27.19883   1.2082882
            GAPDH   B5PC 27.69885   0.7892948
            GAPDH   B5PC 27.58553   0.7892948
            GAPDH   B5PC 29.00576   0.7892948
            GAPDH   B4PM 26.79585   1.2035459
            GAPDH   B4PM 28.79708   1.2035459
            GAPDH   B4PM 28.95486   1.2035459
            GAPDH   B5PM 29.58450   0.8701184
            GAPDH   B5PM 29.22245   0.8701184
            GAPDH   B5PM 27.92936   0.8701184
            HSP70    B5M 33.74524   0.8087996
            HSP70    B5M 32.37369   0.8087996
            HSP70    B5M 32.31676   0.8087996
            HSP70   B4PC 30.71240   0.6802331
            HSP70   B4PC 29.83791   0.6802331
            HSP70   B4PC 29.37261   0.6802331
            HSP70   A1PM 29.45236   3.1088225
            HSP70   A1PM 29.73179   3.1088225
            HSP70   A1PM 24.21288   3.1088225
            HSP70   A4PM 33.09655   0.6821469
            HSP70   A4PM 31.81483   0.6821469
            HSP70   A4PM 32.86049   0.6821469
            HSP70   B1PM 27.93827   0.5637303
            HSP70   B1PM 28.32120   0.5637303
            HSP70   B1PM 29.04810   0.5637303
            HSP90    B2C 24.79178   2.3098674
            HSP90    B2C 28.85831   2.3098674
            HSP90    B2C 24.92664   2.3098674</code></pre>
</div>
</div>
</section>
<section id="remove-outlier-technical-replicates" class="level2">
<h2 class="anchored" data-anchor-id="remove-outlier-technical-replicates">Remove outlier technical replicates</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Group by Sample and Target, then filter out the outlier replicate</span></span>
<span id="cb15-2">qpcr_filtered <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb15-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb15-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb15-6"></span>
<span id="cb15-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>(qpcr_filtered)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>tibble [2,335 × 16] (S3: tbl_df/tbl/data.frame)
 $ X                     : logi [1:2335] NA NA NA NA NA NA ...
 $ Well                  : chr [1:2335] "A01" "A02" "A03" "A04" ...
 $ Fluor                 : chr [1:2335] "SYBR" "SYBR" "SYBR" "SYBR" ...
 $ Target                : chr [1:2335] "Citrate.Synthase" "Citrate.Synthase" "Citrate.Synthase" "Citrate.Synthase" ...
 $ Content               : chr [1:2335] "Unkn-01" "Unkn-01" "Unkn-01" "Unkn-02" ...
 $ Sample                : chr [1:2335] "A1C" "A1C" "A1C" "A2C" ...
 $ Biological.Set.Name   : logi [1:2335] NA NA NA NA NA NA ...
 $ Cq                    : num [1:2335] 24.1 24 23.8 25.1 24.7 ...
 $ Cq.Mean               : num [1:2335] 23.9 23.9 23.9 24.9 24.9 ...
 $ Cq.Std..Dev           : num [1:2335] 0.147 0.147 0.147 0.208 0.208 ...
 $ Starting.Quantity..SQ.: num [1:2335] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ Log.Starting.Quantity : num [1:2335] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ SQ.Mean               : num [1:2335] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ SQ.Std..Dev           : num [1:2335] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
 $ Set.Point             : int [1:2335] 60 60 60 60 60 60 60 60 60 60 ...
 $ Well.Note             : logi [1:2335] NA NA NA NA NA NA ...</code></pre>
</div>
</div>
<section id="samples-excluded-due-to-quality-control" class="level3">
<h3 class="anchored" data-anchor-id="samples-excluded-due-to-quality-control">Samples excluded due to quality control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify samples that were filtered out</span></span>
<span id="cb17-2">all_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-3">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb17-5"></span>
<span id="cb17-6">retained_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_filtered <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-7">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb17-9"></span>
<span id="cb17-10">excluded_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> all_samples <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">anti_join</span>(retained_samples, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>))</span>
<span id="cb17-12"></span>
<span id="cb17-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(excluded_samples) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb17-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Samples excluded from analysis due to high standard deviation (&gt; 0.5):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-15">  excluded_samples <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Target, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb17-17">    knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb17-18">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb17-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No samples were excluded from the analysis.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-20">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Samples excluded from analysis due to high standard deviation (&gt; 0.5):</code></pre>
</div>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">Sample</th>
<th style="text-align: left;">Target</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">B1PM</td>
<td style="text-align: left;">ATP.Synthase</td>
</tr>
<tr class="even">
<td style="text-align: left;">B2PM</td>
<td style="text-align: left;">ATP.Synthase</td>
</tr>
<tr class="odd">
<td style="text-align: left;">A2PM</td>
<td style="text-align: left;">Citrate.Synthase</td>
</tr>
<tr class="even">
<td style="text-align: left;">D4PM</td>
<td style="text-align: left;">DNMT1</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
</section>
<section id="group-and-summarize-data" class="level1">
<h1>Group and Summarize Data</h1>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Group by Sample and Target, then summarize to get unique rows for each sample</span></span>
<span id="cb19-2">grouped_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> qpcr_filtered <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb19-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb19-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb19-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cq.Mean =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb19-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cq.Std..Dev =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb19-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb19-8">  )</span>
<span id="cb19-9"></span>
<span id="cb19-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>(grouped_df)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>tibble [811 × 4] (S3: tbl_df/tbl/data.frame)
 $ Sample     : chr [1:811] "A1C" "A1C" "A1C" "A1C" ...
 $ Target     : chr [1:811] "ATP.Synthase" "Citrate.Synthase" "DNMT1" "GAPDH" ...
 $ Cq.Mean    : num [1:811] 23.6 23.9 29.7 23.6 30.4 ...
 $ Cq.Std..Dev: num [1:811] 0.0674 0.1467 0.1991 0.3435 0.2572 ...</code></pre>
</div>
</div>
</section>
<section id="parse-sample-names-and-add-treatment-columns" class="level1">
<h1>Parse Sample Names and Add Treatment Columns</h1>
<p>Sample naming convention: Letter + Number + P (optional) + Treatment</p>
<ul>
<li>Letter: Biological replicate</li>
<li>Number: Replicate number</li>
<li>P: PolyIC treatment (absent if no PolyIC)</li>
<li>C/T/M: Control/Temperature/Mechanical stress</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Parse sample names to extract treatment information</span></span>
<span id="cb21-2">grouped_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> grouped_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb21-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb21-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract biological replicate (first letter)</span></span>
<span id="cb21-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bio_replicate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_extract</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^[A-Z]"</span>),</span>
<span id="cb21-6">    </span>
<span id="cb21-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract replicate number</span></span>
<span id="cb21-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">replicate_num =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_extract</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">d+"</span>),</span>
<span id="cb21-9">    </span>
<span id="cb21-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check if PolyIC treatment (contains P)</span></span>
<span id="cb21-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>),</span>
<span id="cb21-12">    </span>
<span id="cb21-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract stress type (last letter: C, T, or M)</span></span>
<span id="cb21-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb21-15">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C$"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>,</span>
<span id="cb21-16">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T$"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>,</span>
<span id="cb21-17">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(Sample, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M$"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>,</span>
<span id="cb21-18">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb21-19">    ),</span>
<span id="cb21-20">    </span>
<span id="cb21-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create combined treatment group</span></span>
<span id="cb21-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatment_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(polyIC, stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb21-23">  )</span>
<span id="cb21-24"></span>
<span id="cb21-25"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>(grouped_df)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>tibble [811 × 9] (S3: tbl_df/tbl/data.frame)
 $ Sample         : chr [1:811] "A1C" "A1C" "A1C" "A1C" ...
 $ Target         : chr [1:811] "ATP.Synthase" "Citrate.Synthase" "DNMT1" "GAPDH" ...
 $ Cq.Mean        : num [1:811] 23.6 23.9 29.7 23.6 30.4 ...
 $ Cq.Std..Dev    : num [1:811] 0.0674 0.1467 0.1991 0.3435 0.2572 ...
 $ bio_replicate  : chr [1:811] "A" "A" "A" "A" ...
 $ replicate_num  : chr [1:811] "1" "1" "1" "1" ...
 $ polyIC         : chr [1:811] "No_PolyIC" "No_PolyIC" "No_PolyIC" "No_PolyIC" ...
 $ stress_type    : chr [1:811] "Control" "Control" "Control" "Control" ...
 $ treatment_group: chr [1:811] "No_PolyIC_Control" "No_PolyIC_Control" "No_PolyIC_Control" "No_PolyIC_Control" ...</code></pre>
</div>
</div>
<section id="view-treatment-groups" class="level2">
<h2 class="anchored" data-anchor-id="view-treatment-groups">View treatment groups</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check the unique treatment groups</span></span>
<span id="cb23-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(grouped_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "No_PolyIC_Control"     "No_PolyIC_Mechanical"  "PolyIC_Control"       
[4] "PolyIC_Mechanical"     "PolyIC_Temperature"    "No_PolyIC_Temperature"</code></pre>
</div>
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Count samples per treatment group</span></span>
<span id="cb25-2">grouped_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb25-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(treatment_group, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb25-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n_samples =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb25-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> n_samples) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb25-6">  knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 24%">
<col style="width: 14%">
<col style="width: 19%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 8%">
<col style="width: 5%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">treatment_group</th>
<th style="text-align: right;">ATP.Synthase</th>
<th style="text-align: right;">Citrate.Synthase</th>
<th style="text-align: right;">DNMT1</th>
<th style="text-align: right;">GAPDH</th>
<th style="text-align: right;">HSP70</th>
<th style="text-align: right;">HSP90</th>
<th style="text-align: right;">VIPERIN</th>
<th style="text-align: right;">cGAS</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">No_PolyIC_Control</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
</tr>
<tr class="even">
<td style="text-align: left;">No_PolyIC_Mechanical</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
</tr>
<tr class="odd">
<td style="text-align: left;">No_PolyIC_Temperature</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
</tr>
<tr class="even">
<td style="text-align: left;">PolyIC_Control</td>
<td style="text-align: right;">17</td>
<td style="text-align: right;">18</td>
<td style="text-align: right;">8</td>
<td style="text-align: right;">18</td>
<td style="text-align: right;">18</td>
<td style="text-align: right;">8</td>
<td style="text-align: right;">8</td>
<td style="text-align: right;">8</td>
</tr>
<tr class="odd">
<td style="text-align: left;">PolyIC_Mechanical</td>
<td style="text-align: right;">12</td>
<td style="text-align: right;">13</td>
<td style="text-align: right;">3</td>
<td style="text-align: right;">14</td>
<td style="text-align: right;">14</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">PolyIC_Temperature</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">20</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="calculate-delta-cq-1" class="level1">
<h1>Calculate Delta Cq</h1>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate delta Cq by subtracting GAPDH Cq.Mean from each corresponding Sample Cq.Mean</span></span>
<span id="cb26-2">delta_Cq_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">calculate_delta_Cq</span>(grouped_df)</span>
<span id="cb26-3"></span>
<span id="cb26-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter out normalizing gene (GAPDH), since no need to compare normalizing gene to itself</span></span>
<span id="cb26-5">delta_Cq_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb26-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>)</span>
<span id="cb26-7"></span>
<span id="cb26-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>(delta_Cq_df)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>tibble [699 × 10] (S3: tbl_df/tbl/data.frame)
 $ Sample         : chr [1:699] "A1C" "A1C" "A1C" "A1C" ...
 $ Target         : chr [1:699] "ATP.Synthase" "Citrate.Synthase" "DNMT1" "HSP70" ...
 $ Cq.Mean        : num [1:699] 23.6 23.9 29.7 30.4 24.3 ...
 $ Cq.Std..Dev    : num [1:699] 0.0674 0.1467 0.1991 0.2572 0.0472 ...
 $ bio_replicate  : chr [1:699] "A" "A" "A" "A" ...
 $ replicate_num  : chr [1:699] "1" "1" "1" "1" ...
 $ polyIC         : chr [1:699] "No_PolyIC" "No_PolyIC" "No_PolyIC" "No_PolyIC" ...
 $ stress_type    : chr [1:699] "Control" "Control" "Control" "Control" ...
 $ treatment_group: chr [1:699] "No_PolyIC_Control" "No_PolyIC_Control" "No_PolyIC_Control" "No_PolyIC_Control" ...
 $ delta_Cq       : num [1:699] 0.0291 0.3858 6.1407 6.8687 0.7935 ...</code></pre>
</div>
</div>
<section id="missing-samples-analysis" class="level2">
<h2 class="anchored" data-anchor-id="missing-samples-analysis">Missing samples analysis</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get all unique sample names from the data that made it to delta_Cq_df</span></span>
<span id="cb28-2">available_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-3">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target, treatment_group, polyIC, stress_type) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb28-5"></span>
<span id="cb28-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Expected samples based on the naming pattern</span></span>
<span id="cb28-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># From the view-groups output, we know the expected samples</span></span>
<span id="cb28-8">expected_no_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>),</span>
<span id="cb28-9">                        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T"</span>),</span>
<span id="cb28-10">                        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M"</span>))</span>
<span id="cb28-11"></span>
<span id="cb28-12">expected_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PC"</span>),</span>
<span id="cb28-13">                     <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PT"</span>),</span>
<span id="cb28-14">                     <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(LETTERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">each=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PM"</span>))</span>
<span id="cb28-15"></span>
<span id="cb28-16">all_expected_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(expected_no_polyIC, expected_polyIC)</span>
<span id="cb28-17"></span>
<span id="cb28-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get all genes</span></span>
<span id="cb28-19">all_genes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(delta_Cq_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target)</span>
<span id="cb28-20"></span>
<span id="cb28-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create expected sample-gene combinations</span></span>
<span id="cb28-22">expected_combinations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expand.grid</span>(</span>
<span id="cb28-23">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Sample =</span> all_expected_samples,</span>
<span id="cb28-24">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> all_genes,</span>
<span id="cb28-25">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb28-26">)</span>
<span id="cb28-27"></span>
<span id="cb28-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Find missing combinations</span></span>
<span id="cb28-29">actual_combinations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-30">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb28-32"></span>
<span id="cb28-33">missing_combinations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> expected_combinations <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">anti_join</span>(actual_combinations, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>))</span>
<span id="cb28-35"></span>
<span id="cb28-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summarize by treatment group and gene</span></span>
<span id="cb28-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Parse treatment info for missing samples</span></span>
<span id="cb28-38">missing_combinations_parsed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_combinations <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb28-40">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substr</span>(Sample, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nchar</span>(Sample)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nchar</span>(Sample))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>),</span>
<span id="cb28-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb28-42">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PC$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>,</span>
<span id="cb28-43">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PT$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>,</span>
<span id="cb28-44">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grepl</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PM$"</span>, Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>,</span>
<span id="cb28-45">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Unknown"</span></span>
<span id="cb28-46">    ),</span>
<span id="cb28-47">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatment_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(polyIC, stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb28-48">  )</span>
<span id="cb28-49"></span>
<span id="cb28-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summary table</span></span>
<span id="cb28-51"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">=== MISSING SAMPLES SUMMARY BY TREATMENT GROUP ===</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-52">missing_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_combinations_parsed <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(treatment_group, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n_missing =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-55">  tidyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> n_missing, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_fill =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(treatment_group)</span>
<span id="cb28-57"></span>
<span id="cb28-58"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(missing_summary)</span>
<span id="cb28-59"></span>
<span id="cb28-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Detailed list of missing samples</span></span>
<span id="cb28-61"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">=== DETAILED LIST OF MISSING SAMPLES ===</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-62"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total missing sample-gene combinations:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(missing_combinations), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-63"></span>
<span id="cb28-64">missing_by_gene <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_combinations_parsed <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-65">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Target, treatment_group, Sample)</span>
<span id="cb28-66"></span>
<span id="cb28-67"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(gene <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(missing_by_gene<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target))) {</span>
<span id="cb28-68">  gene_missing <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_by_gene <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gene)</span>
<span id="cb28-69">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(gene_missing) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb28-70">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**"</span>, gene, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"** ("</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(gene_missing), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" missing samples):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-71">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(trt <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(gene_missing<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group)) {</span>
<span id="cb28-72">      samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gene_missing <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(treatment_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> trt) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Sample)</span>
<span id="cb28-73">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(samples) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb28-74">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, trt, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">": "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(samples, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-75">      }</span>
<span id="cb28-76">    }</span>
<span id="cb28-77">  }</span>
<span id="cb28-78">}</span>
<span id="cb28-79"></span>
<span id="cb28-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Comprehensive list of all problematic samples</span></span>
<span id="cb28-81"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">=== ALL SAMPLES EXCLUDED OR MISSING FROM ANALYSIS ===</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-82"></span>
<span id="cb28-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get samples that failed QC by gene</span></span>
<span id="cb28-84"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Samples that Failed QC (high standard deviation &gt; 0.5) by Gene:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-85"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(excluded_samples) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb28-86">  failed_qc_by_gene <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> excluded_samples <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb28-87">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Target, Sample)</span>
<span id="cb28-88">  </span>
<span id="cb28-89">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(gene <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(failed_qc_by_gene<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target)) {</span>
<span id="cb28-90">    gene_failed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> failed_qc_by_gene <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gene) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Sample)</span>
<span id="cb28-91">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, gene, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" ("</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(gene_failed), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" samples): "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(gene_failed), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-92">  }</span>
<span id="cb28-93">  </span>
<span id="cb28-94">  failed_qc_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(excluded_samples<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Sample)</span>
<span id="cb28-95">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  Total unique samples that failed QC: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(failed_qc_samples), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-96">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  All failed QC samples: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(failed_qc_samples), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-97">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb28-98">  failed_qc_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb28-99">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  No samples failed QC.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-100">}</span>
<span id="cb28-101"></span>
<span id="cb28-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get unique samples that are missing</span></span>
<span id="cb28-103">missing_sample_names <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(missing_combinations<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Sample)</span>
<span id="cb28-104"></span>
<span id="cb28-105"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Missing from data (never run/loaded):** "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(missing_sample_names), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" unique samples</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-106"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(missing_sample_names) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb28-107">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(missing_sample_names), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-108">}</span>
<span id="cb28-109"></span>
<span id="cb28-110"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Combine and get all unique</span></span>
<span id="cb28-111">all_problematic_samples <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(failed_qc_samples, missing_sample_names))</span>
<span id="cb28-112"></span>
<span id="cb28-113"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-114"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Total unique samples with issues: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(all_problematic_samples), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-115"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  All unique sample names (failed QC + missing): "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(all_problematic_samples), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>
=== MISSING SAMPLES SUMMARY BY TREATMENT GROUP ===

# A tibble: 2 × 8
  treatment_group  ATP.Synthase Citrate.Synthase DNMT1 HSP70 HSP90 VIPERIN  cGAS
  &lt;chr&gt;                   &lt;int&gt;            &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt;   &lt;int&gt; &lt;int&gt;
1 PolyIC_Control              3                2    12     2    12      12    12
2 PolyIC_Mechanic…            8                7    17     6    16      16    16


=== DETAILED LIST OF MISSING SAMPLES ===

Total missing sample-gene combinations: 141 


**ATP.Synthase** (11 missing samples):
  PolyIC_Control: A5PC, C4PC, C5PC
  PolyIC_Mechanical: B1PM, B2PM, C1PM, C2PM, C3PM, C4PM, C5PM, D5PM

**cGAS** (28 missing samples):
  PolyIC_Control: A1PC, A2PC, A3PC, A4PC, A5PC, B1PC, B2PC, B3PC, B4PC, B5PC, C4PC, C5PC
  PolyIC_Mechanical: A1PM, A2PM, A3PM, A4PM, A5PM, B1PM, B2PM, B3PM, B4PM, B5PM, C1PM, C2PM, C3PM, C4PM, C5PM, D5PM

**Citrate.Synthase** (9 missing samples):
  PolyIC_Control: C4PC, C5PC
  PolyIC_Mechanical: A2PM, C1PM, C2PM, C3PM, C4PM, C5PM, D5PM

**DNMT1** (29 missing samples):
  PolyIC_Control: A1PC, A2PC, A3PC, A4PC, A5PC, B1PC, B2PC, B3PC, B4PC, B5PC, C4PC, C5PC
  PolyIC_Mechanical: A1PM, A2PM, A3PM, A4PM, A5PM, B1PM, B2PM, B3PM, B4PM, B5PM, C1PM, C2PM, C3PM, C4PM, C5PM, D4PM, D5PM

**HSP70** (8 missing samples):
  PolyIC_Control: C4PC, C5PC
  PolyIC_Mechanical: C1PM, C2PM, C3PM, C4PM, C5PM, D5PM

**HSP90** (28 missing samples):
  PolyIC_Control: A1PC, A2PC, A3PC, A4PC, A5PC, B1PC, B2PC, B3PC, B4PC, B5PC, C4PC, C5PC
  PolyIC_Mechanical: A1PM, A2PM, A3PM, A4PM, A5PM, B1PM, B2PM, B3PM, B4PM, B5PM, C1PM, C2PM, C3PM, C4PM, C5PM, D5PM

**VIPERIN** (28 missing samples):
  PolyIC_Control: A1PC, A2PC, A3PC, A4PC, A5PC, B1PC, B2PC, B3PC, B4PC, B5PC, C4PC, C5PC
  PolyIC_Mechanical: A1PM, A2PM, A3PM, A4PM, A5PM, B1PM, B2PM, B3PM, B4PM, B5PM, C1PM, C2PM, C3PM, C4PM, C5PM, D5PM


=== ALL SAMPLES EXCLUDED OR MISSING FROM ANALYSIS ===

**Samples that Failed QC (high standard deviation &gt; 0.5) by Gene:**

  ATP.Synthase (2 samples): B1PM, B2PM
  Citrate.Synthase (1 samples): A2PM
  DNMT1 (1 samples): D4PM

  Total unique samples that failed QC: 4
  All failed QC samples: A2PM, B1PM, B2PM, D4PM

**Missing from data (never run/loaded):** 29 unique samples
   A1PC, A1PM, A2PC, A2PM, A3PC, A3PM, A4PC, A4PM, A5PC, A5PM, B1PC, B1PM, B2PC, B2PM, B3PC, B3PM, B4PC, B4PM, B5PC, B5PM, C1PM, C2PM, C3PM, C4PC, C4PM, C5PC, C5PM, D4PM, D5PM 

**Summary:**
  Total unique samples with issues: 29
  All unique sample names (failed QC + missing): A1PC, A1PM, A2PC, A2PM, A3PC, A3PM, A4PC, A4PM, A5PC, A5PM, B1PC, B1PM, B2PC, B2PM, B3PC, B3PM, B4PC, B4PM, B5PC, B5PM, C1PM, C2PM, C3PM, C4PC, C4PM, C5PC, C5PM, D4PM, D5PM</code></pre>
</div>
</div>
</section>
<section id="gapdh-impact-analysis" class="level2">
<h2 class="anchored" data-anchor-id="gapdh-impact-analysis">GAPDH Impact Analysis</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">=== GAPDH QC FAILURES AND THEIR CASCADE EFFECTS ===</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-2"></span>
<span id="cb30-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get samples where GAPDH passed QC</span></span>
<span id="cb30-4">gapdh_passed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> grouped_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-6">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Sample)</span>
<span id="cb30-9"></span>
<span id="cb30-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get samples where genes of interest passed QC</span></span>
<span id="cb30-11">genes_of_interest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> grouped_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-13">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb30-15"></span>
<span id="cb30-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Find samples that have gene data but missing GAPDH</span></span>
<span id="cb30-17">samples_with_gene_but_no_gapdh <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> genes_of_interest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>Sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> gapdh_passed) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Sample, Target)</span>
<span id="cb30-20"></span>
<span id="cb30-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(samples_with_gene_but_no_gapdh) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb30-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Samples with good gene measurements but failed/missing GAPDH:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(These samples CANNOT be normalized and are excluded from analysis)</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-24">  </span>
<span id="cb30-25">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Count by sample</span></span>
<span id="cb30-26">  sample_counts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> samples_with_gene_but_no_gapdh <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n_genes_lost =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(n_genes_lost), Sample)</span>
<span id="cb30-30">  </span>
<span id="cb30-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total samples affected:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sample_counts), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total gene measurements lost:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(samples_with_gene_but_no_gapdh), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-33">  </span>
<span id="cb30-34">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Detailed breakdown</span></span>
<span id="cb30-35">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sample_counts)) {</span>
<span id="cb30-36">    samp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sample_counts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Sample[i]</span>
<span id="cb30-37">    genes_lost <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> samples_with_gene_but_no_gapdh <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-38">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> samp) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-39">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Target)</span>
<span id="cb30-40">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, samp, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" ("</span>, sample_counts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n_genes_lost[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" genes lost): "</span>, </span>
<span id="cb30-41">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(genes_lost, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb30-42">  }</span>
<span id="cb30-43">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb30-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Good news!** All samples with gene measurements also have valid GAPDH.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-45">}</span>
<span id="cb30-46"></span>
<span id="cb30-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check if GAPDH itself failed QC for any samples</span></span>
<span id="cb30-48">gapdh_failed_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> excluded_samples <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-49">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GAPDH"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-50">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-51">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>()</span>
<span id="cb30-52"></span>
<span id="cb30-53"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(gapdh_failed_qc) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb30-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**GAPDH samples that failed QC (Std Dev &gt; 0.5):** "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(gapdh_failed_qc), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" samples</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb30-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(gapdh_failed_qc), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb30-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Note: These GAPDH failures prevent normalization for ALL genes in these samples,</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"even if those genes had good quality measurements.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-58">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb30-59">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**No GAPDH samples failed QC.**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-60">}</span>
<span id="cb30-61"></span>
<span id="cb30-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify which "missing" samples in the final analysis are due to GAPDH issues</span></span>
<span id="cb30-63"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Analysis of 'Missing' Samples:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-64"></span>
<span id="cb30-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get samples that made it to grouped_df (passed initial QC)</span></span>
<span id="cb30-66">all_passed_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> grouped_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-67">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Sample, Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb30-69"></span>
<span id="cb30-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># For each "missing" sample in delta_Cq_df, check if the gene passed QC but GAPDH didn't</span></span>
<span id="cb30-71">missing_due_to_gapdh <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_combinations <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">inner_join</span>(all_passed_qc, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-73">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>Sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> gapdh_passed)</span>
<span id="cb30-74"></span>
<span id="cb30-75"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(missing_due_to_gapdh) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb30-76">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Gene measurements lost due to GAPDH failure/missing: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(missing_due_to_gapdh), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" sample-gene combinations</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb30-77">  </span>
<span id="cb30-78">  missing_gapdh_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> missing_due_to_gapdh <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-79">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-80">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb30-81">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(n))</span>
<span id="cb30-82">  </span>
<span id="cb30-83">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Breakdown by gene:</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-84">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(missing_gapdh_summary)) {</span>
<span id="cb30-85">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, missing_gapdh_summary<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">": "</span>, missing_gapdh_summary<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" samples</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb30-86">  }</span>
<span id="cb30-87">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb30-88">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"None of the 'missing' samples are due to GAPDH QC failures.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-89">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(They were never run/loaded for those genes)</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-90">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>
=== GAPDH QC FAILURES AND THEIR CASCADE EFFECTS ===

**Good news!** All samples with gene measurements also have valid GAPDH.


**No GAPDH samples failed QC.**


**Analysis of 'Missing' Samples:**

None of the 'missing' samples are due to GAPDH QC failures.
(They were never run/loaded for those genes)</code></pre>
</div>
</div>
</section>
</section>
<section id="statistical-comparisons" class="level1">
<h1>Statistical Comparisons</h1>
<section id="t-tests-for-treatment-comparisons" class="level2">
<h2 class="anchored" data-anchor-id="t-tests-for-treatment-comparisons">T-tests for treatment comparisons</h2>
<section id="comparison-1-basic-control-vs-stressors-no-polyic" class="level3">
<h3 class="anchored" data-anchor-id="comparison-1-basic-control-vs-stressors-no-polyic">Comparison 1: Basic Control vs Stressors (No PolyIC)</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter data for samples without PolyIC treatment</span></span>
<span id="cb32-2">no_polyIC_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb32-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>)</span>
<span id="cb32-4"></span>
<span id="cb32-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform t-tests for each target comparing Control vs each stressor</span></span>
<span id="cb32-6">comparison1_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> no_polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb32-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb32-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb32-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb32-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Control vs Temperature</span></span>
<span id="cb32-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">temp_pvalue =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb32-12">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t.test</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], </span>
<span id="cb32-13">             delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value</span>
<span id="cb32-14">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb32-15">    </span>
<span id="cb32-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Control vs Mechanical</span></span>
<span id="cb32-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mech_pvalue =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb32-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t.test</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], </span>
<span id="cb32-19">             delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value</span>
<span id="cb32-20">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb32-21">    </span>
<span id="cb32-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb32-23">  )</span>
<span id="cb32-24"></span>
<span id="cb32-25"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(comparison1_results)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 7 × 3
  Target           temp_pvalue mech_pvalue
  &lt;chr&gt;                  &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase        1.48e- 1      0.155 
2 Citrate.Synthase    3.24e- 1      0.0113
3 DNMT1               4.36e- 1      0.672 
4 HSP70               1.17e-12      0.994 
5 HSP90               8.39e- 1      0.447 
6 VIPERIN             6.37e- 1      0.262 
7 cGAS                5.51e- 1      0.105 </code></pre>
</div>
</div>
<section id="significant-genes-p-0.05" class="level4">
<h4 class="anchored" data-anchor-id="significant-genes-p-0.05">Significant genes (p ≤ 0.05)</h4>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify genes with significant p-values for Temperature comparison</span></span>
<span id="cb34-2">sig_temp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparison1_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(temp_pvalue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(temp_pvalue)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-5">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> temp_pvalue) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control vs Temperature"</span>)</span>
<span id="cb34-7"></span>
<span id="cb34-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify genes with significant p-values for Mechanical comparison</span></span>
<span id="cb34-9">sig_mech <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparison1_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(mech_pvalue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(mech_pvalue)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-12">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> mech_pvalue) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control vs Mechanical"</span>)</span>
<span id="cb34-14"></span>
<span id="cb34-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Combine and display</span></span>
<span id="cb34-16">sig_genes_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb34-17">  sig_temp,</span>
<span id="cb34-18">  sig_mech</span>
<span id="cb34-19">)</span>
<span id="cb34-20"></span>
<span id="cb34-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb34-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genes with p ≤ 0.05:"</span>)</span>
<span id="cb34-23">  sig_genes_comp1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(pvalue, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scientific =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb34-25">    knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb34-26">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb34-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No genes had p-values ≤ 0.05"</span>)</span>
<span id="cb34-28">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Genes with p ≤ 0.05:"</code></pre>
</div>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">Target</th>
<th style="text-align: left;">pvalue</th>
<th style="text-align: left;">comparison</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">HSP70</td>
<td style="text-align: left;">1.17e-12</td>
<td style="text-align: left;">Control vs Temperature</td>
</tr>
<tr class="even">
<td style="text-align: left;">Citrate.Synthase</td>
<td style="text-align: left;">1.13e-02</td>
<td style="text-align: left;">Control vs Mechanical</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="comparison-2-basic-control-vs-polyic-control" class="level3">
<h3 class="anchored" data-anchor-id="comparison-2-basic-control-vs-polyic-control">Comparison 2: Basic Control vs PolyIC Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter data for control samples only (with and without PolyIC)</span></span>
<span id="cb36-2">control_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb36-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>)</span>
<span id="cb36-4"></span>
<span id="cb36-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform t-tests for each target comparing No_PolyIC vs PolyIC controls</span></span>
<span id="cb36-6">comparison2_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> control_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb36-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb36-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb36-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n_no_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>),</span>
<span id="cb36-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>),</span>
<span id="cb36-11">    </span>
<span id="cb36-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb36-13">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t.test</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>], </span>
<span id="cb36-14">             delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value</span>
<span id="cb36-15">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb36-16">    </span>
<span id="cb36-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_no_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb36-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sd_no_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb36-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb36-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sd_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb36-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_diff =</span> mean_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_no_polyIC,</span>
<span id="cb36-22">    </span>
<span id="cb36-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb36-24">  )</span>
<span id="cb36-25"></span>
<span id="cb36-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(comparison2_results)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 7 × 9
  Target    n_no_polyIC n_polyIC  pvalue mean_no_polyIC sd_no_polyIC mean_polyIC
  &lt;chr&gt;           &lt;int&gt;    &lt;int&gt;   &lt;dbl&gt;          &lt;dbl&gt;        &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synt…          20       17 1.11e-3         -0.118        0.270       2.14 
2 Citrate.…          20       18 2.88e-4          0.390        0.308       2.41 
3 DNMT1              20        8 7.56e-1          6.26         0.904       6.42 
4 HSP70              20       18 4.73e-4          5.51         1.52        3.29 
5 HSP90              20        8 7.96e-3          0.457        0.405      -0.113
6 VIPERIN            20        8 1.01e-2          5.19         1.04        4.01 
7 cGAS               20        8 7.18e-1          6.39         0.873       6.22 
# ℹ 2 more variables: sd_polyIC &lt;dbl&gt;, mean_diff &lt;dbl&gt;</code></pre>
</div>
</div>
<section id="significant-genes-p-0.05-1" class="level4">
<h4 class="anchored" data-anchor-id="significant-genes-p-0.05-1">Significant genes (p ≤ 0.05)</h4>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify genes with significant p-values</span></span>
<span id="cb38-2">sig_genes_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparison2_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb38-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(pvalue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(pvalue)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb38-4">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Target, pvalue)</span>
<span id="cb38-5"></span>
<span id="cb38-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp2) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb38-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genes with p ≤ 0.05:"</span>)</span>
<span id="cb38-8">  sig_genes_comp2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb38-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(pvalue, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scientific =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb38-10">    knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb38-11">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb38-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No genes had p-values ≤ 0.05"</span>)</span>
<span id="cb38-13">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Genes with p ≤ 0.05:"</code></pre>
</div>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">Target</th>
<th style="text-align: left;">pvalue</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">ATP.Synthase</td>
<td style="text-align: left;">1.11e-03</td>
</tr>
<tr class="even">
<td style="text-align: left;">Citrate.Synthase</td>
<td style="text-align: left;">2.88e-04</td>
</tr>
<tr class="odd">
<td style="text-align: left;">HSP70</td>
<td style="text-align: left;">4.73e-04</td>
</tr>
<tr class="even">
<td style="text-align: left;">HSP90</td>
<td style="text-align: left;">7.96e-03</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIPERIN</td>
<td style="text-align: left;">1.01e-02</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="comparison-3-polyic-control-vs-polyic-stressors" class="level3">
<h3 class="anchored" data-anchor-id="comparison-3-polyic-control-vs-polyic-stressors">Comparison 3: PolyIC Control vs PolyIC Stressors</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filter data for PolyIC samples only</span></span>
<span id="cb40-2">polyIC_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb40-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>)</span>
<span id="cb40-4"></span>
<span id="cb40-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform t-tests for each target comparing PolyIC Control vs each stressor</span></span>
<span id="cb40-6">comparison3_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb40-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb40-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb40-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb40-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PolyIC Control vs Temperature</span></span>
<span id="cb40-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">temp_pvalue =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb40-12">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t.test</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], </span>
<span id="cb40-13">             delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value</span>
<span id="cb40-14">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb40-15">    </span>
<span id="cb40-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PolyIC Control vs Mechanical</span></span>
<span id="cb40-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mech_pvalue =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb40-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t.test</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], </span>
<span id="cb40-19">             delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value</span>
<span id="cb40-20">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb40-21">    </span>
<span id="cb40-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb40-23">  )</span>
<span id="cb40-24"></span>
<span id="cb40-25"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(comparison3_results)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 7 × 3
  Target            temp_pvalue mech_pvalue
  &lt;chr&gt;                   &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase     0.00693           0.0766
2 Citrate.Synthase 0.000519          0.715 
3 DNMT1            0.124             0.845 
4 HSP70            0.0000000461      0.684 
5 HSP90            0.151             0.533 
6 VIPERIN          0.332             0.828 
7 cGAS             0.953             0.249 </code></pre>
</div>
</div>
<section id="significant-genes-p-0.05-2" class="level4">
<h4 class="anchored" data-anchor-id="significant-genes-p-0.05-2">Significant genes (p ≤ 0.05)</h4>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify genes with significant p-values for Temperature comparison</span></span>
<span id="cb42-2">sig_temp_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparison3_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(temp_pvalue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(temp_pvalue)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-4">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> temp_pvalue) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Control vs Temperature"</span>)</span>
<span id="cb42-6"></span>
<span id="cb42-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify genes with significant p-values for Mechanical comparison</span></span>
<span id="cb42-8">sig_mech_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparison3_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(mech_pvalue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(mech_pvalue)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-10">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> mech_pvalue) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Control vs Mechanical"</span>)</span>
<span id="cb42-12"></span>
<span id="cb42-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Combine and display</span></span>
<span id="cb42-14">sig_genes_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb42-15">  sig_temp_polyIC,</span>
<span id="cb42-16">  sig_mech_polyIC</span>
<span id="cb42-17">)</span>
<span id="cb42-18"></span>
<span id="cb42-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp3) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb42-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genes with p ≤ 0.05:"</span>)</span>
<span id="cb42-21">  sig_genes_comp3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pvalue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(pvalue, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scientific =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb42-23">    knitr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb42-24">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb42-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No genes had p-values ≤ 0.05"</span>)</span>
<span id="cb42-26">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Genes with p ≤ 0.05:"</code></pre>
</div>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">Target</th>
<th style="text-align: left;">pvalue</th>
<th style="text-align: left;">comparison</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">ATP.Synthase</td>
<td style="text-align: left;">6.93e-03</td>
<td style="text-align: left;">PolyIC Control vs Temperature</td>
</tr>
<tr class="even">
<td style="text-align: left;">Citrate.Synthase</td>
<td style="text-align: left;">5.19e-04</td>
<td style="text-align: left;">PolyIC Control vs Temperature</td>
</tr>
<tr class="odd">
<td style="text-align: left;">HSP70</td>
<td style="text-align: left;">4.61e-08</td>
<td style="text-align: left;">PolyIC Control vs Temperature</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
</section>
<section id="create-anova-models" class="level2">
<h2 class="anchored" data-anchor-id="create-anova-models">Create ANOVA Models</h2>
<p>Two-way ANOVA (PolyIC × Stress Type) for each gene to comprehensively test treatment effects and interactions.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run ANOVA models for all genes and store emmeans objects for plotting</span></span>
<span id="cb44-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Detailed assumption checks and interpretations are in the "ANOVA Results and Diagnostics" section below</span></span>
<span id="cb44-3"></span>
<span id="cb44-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATP Synthase</span></span>
<span id="cb44-5">model_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_atp)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-9">  emm_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_atp, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-10">}</span>
<span id="cb44-11"></span>
<span id="cb44-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Citrate Synthase</span></span>
<span id="cb44-13">model_citrate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_citrate)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-17">  emm_citrate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_citrate, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-18">}</span>
<span id="cb44-19"></span>
<span id="cb44-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DNMT1</span></span>
<span id="cb44-21">model_dnmt1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_dnmt1)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-25">  emm_dnmt1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_dnmt1, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-26">}</span>
<span id="cb44-27"></span>
<span id="cb44-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP70</span></span>
<span id="cb44-29">model_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-32"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp70)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-33">  emm_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_hsp70, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-34">}</span>
<span id="cb44-35"></span>
<span id="cb44-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP90</span></span>
<span id="cb44-37">model_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp90)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-41">  emm_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_hsp90, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-42">}</span>
<span id="cb44-43"></span>
<span id="cb44-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cGAS</span></span>
<span id="cb44-45">model_cgas <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-46">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-47">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_cgas)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-49">  emm_cgas <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_cgas, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-50">}</span>
<span id="cb44-51"></span>
<span id="cb44-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VIPERIN</span></span>
<span id="cb44-53">model_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb44-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb44-56"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_viperin)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb44-57">  emm_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_viperin, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb44-58">}</span>
<span id="cb44-59"></span>
<span id="cb44-60"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ANOVA models created for all genes. Emmeans objects stored for post-hoc testing and plotting.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-61"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"See 'ANOVA Results and Diagnostics' section below for detailed results, assumption checks, and interpretations.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>ANOVA models created for all genes. Emmeans objects stored for post-hoc testing and plotting.
See 'ANOVA Results and Diagnostics' section below for detailed results, assumption checks, and interpretations.</code></pre>
</div>
</div>
</section>
</section>
<section id="visualizations" class="level1">
<h1>Visualizations</h1>
<section id="delta-cq-boxplots" class="level2">
<h2 class="anchored" data-anchor-id="delta-cq-boxplots">Delta Cq Boxplots</h2>
<section id="comparison-1-control-vs-stressors-no-polyic" class="level3">
<h3 class="anchored" data-anchor-id="comparison-1-control-vs-stressors-no-polyic">Comparison 1: Control vs Stressors (No PolyIC)</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prepare significance annotations from t-test results</span></span>
<span id="cb46-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig_genes_comp1"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb46-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract significant genes for Temperature</span></span>
<span id="cb46-4">  sig_temp_genes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_genes_comp1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(comparison <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control vs Temperature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Target)</span>
<span id="cb46-7">  </span>
<span id="cb46-8">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract significant genes for Mechanical</span></span>
<span id="cb46-9">  sig_mech_genes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_genes_comp1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(comparison <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control vs Mechanical"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Target)</span>
<span id="cb46-12">  </span>
<span id="cb46-13">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create annotation data</span></span>
<span id="cb46-14">  sig_annotations_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb46-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb46-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb46-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb46-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb46-19">  )</span>
<span id="cb46-20">  </span>
<span id="cb46-21">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add Temperature annotations</span></span>
<span id="cb46-22">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(sig_temp_genes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb46-23">    sig_annotations_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sig_annotations_comp1,</span>
<span id="cb46-24">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> sig_temp_genes,</span>
<span id="cb46-25">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>,</span>
<span id="cb46-26">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>))</span>
<span id="cb46-27">  }</span>
<span id="cb46-28">  </span>
<span id="cb46-29">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add Mechanical annotations</span></span>
<span id="cb46-30">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(sig_mech_genes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb46-31">    sig_annotations_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sig_annotations_comp1,</span>
<span id="cb46-32">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> sig_mech_genes,</span>
<span id="cb46-33">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>,</span>
<span id="cb46-34">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>))</span>
<span id="cb46-35">  }</span>
<span id="cb46-36">  </span>
<span id="cb46-37">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get y positions for annotations</span></span>
<span id="cb46-38">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_annotations_comp1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb46-39">    y_pos_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> no_polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-40">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target, stress_type) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-41">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb46-42">    </span>
<span id="cb46-43">    sig_annotations_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_annotations_comp1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-44">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_pos_comp1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-45">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_pos =</span> max_y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb46-46">  }</span>
<span id="cb46-47">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb46-48">  sig_annotations_comp1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>()</span>
<span id="cb46-49">}</span>
<span id="cb46-50"></span>
<span id="cb46-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create plot</span></span>
<span id="cb46-52">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> no_polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb46-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> stress_type)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkgray"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"salmon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steelblue"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_cartesian</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">clip =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"off"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-58">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-59">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb46-60">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq: Control vs Stressors (No PolyIC Treatment)"</span>,</span>
<span id="cb46-61">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stress Type"</span>,</span>
<span id="cb46-62">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>,</span>
<span id="cb46-63">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stress Type"</span></span>
<span id="cb46-64">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-65">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb46-66"></span>
<span id="cb46-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add annotations if any exist</span></span>
<span id="cb46-68"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_annotations_comp1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb46-69">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb46-70">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sig_annotations_comp1, </span>
<span id="cb46-71">              <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_pos, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> label),</span>
<span id="cb46-72">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkorange"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb46-73">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Asterisks (*) indicate significant differences from Control (t-test p ≤ 0.05)"</span>,</span>
<span id="cb46-74">         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant comparisons:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(sig_genes_comp1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)))</span>
<span id="cb46-75">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb46-76">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant differences detected in t-tests (all p &gt; 0.05)"</span>)</span>
<span id="cb46-77">}</span>
<span id="cb46-78"></span>
<span id="cb46-79"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(p)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/boxplot-no-polyIC-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="comparison-2-control-vs-polyic-control" class="level3">
<h3 class="anchored" data-anchor-id="comparison-2-control-vs-polyic-control">Comparison 2: Control vs PolyIC Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prepare significance annotations from t-test results</span></span>
<span id="cb47-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig_genes_comp2"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp2) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb47-3">  sig_annotations_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb47-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> sig_genes_comp2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target,</span>
<span id="cb47-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">polyIC =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>,</span>
<span id="cb47-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>,</span>
<span id="cb47-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb47-8">  )</span>
<span id="cb47-9">  </span>
<span id="cb47-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get y positions for annotations</span></span>
<span id="cb47-11">  y_pos_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> control_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target, polyIC) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb47-14">  </span>
<span id="cb47-15">  sig_annotations_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_annotations_comp2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_pos_comp2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_pos =</span> max_y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb47-18">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb47-19">  sig_annotations_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>()</span>
<span id="cb47-20">}</span>
<span id="cb47-21"></span>
<span id="cb47-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create plot</span></span>
<span id="cb47-23">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> control_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> polyIC, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> polyIC)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkgray"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"salmon"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_cartesian</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">clip =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"off"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb47-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq: Basic Control vs PolyIC Control"</span>,</span>
<span id="cb47-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Treatment"</span>,</span>
<span id="cb47-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>,</span>
<span id="cb47-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Treatment"</span></span>
<span id="cb47-35">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb47-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb47-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot.margin =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">margin</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">t =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">b =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">l =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb47-39">  )</span>
<span id="cb47-40"></span>
<span id="cb47-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add annotations if any exist</span></span>
<span id="cb47-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_annotations_comp2) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb47-43">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Expand y-axis limits to ensure annotations are visible</span></span>
<span id="cb47-44">  y_limits_comp2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> control_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-45">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb47-46">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb47-47">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_min =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb47-48">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_max =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb47-49">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb47-50">    )</span>
<span id="cb47-51">  </span>
<span id="cb47-52">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb47-53">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_blank</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> y_limits_comp2, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_max), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-54">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sig_annotations_comp2, </span>
<span id="cb47-55">              <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> polyIC, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_pos, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> label),</span>
<span id="cb47-56">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkorange"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-57">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Asterisks (*) indicate significant differences (t-test p ≤ 0.05)"</span>,</span>
<span id="cb47-58">         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Genes with significant PolyIC effect:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(sig_genes_comp2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)))</span>
<span id="cb47-59">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb47-60">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant differences detected in t-tests (all p &gt; 0.05)"</span>)</span>
<span id="cb47-61">}</span>
<span id="cb47-62"></span>
<span id="cb47-63"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(p)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/boxplot-control-comparison-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="comparison-3-polyic-control-vs-polyic-stressors-1" class="level3">
<h3 class="anchored" data-anchor-id="comparison-3-polyic-control-vs-polyic-stressors-1">Comparison 3: PolyIC Control vs PolyIC Stressors</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prepare significance annotations from t-test results</span></span>
<span id="cb48-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig_genes_comp3"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_genes_comp3) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb48-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract significant genes for Temperature</span></span>
<span id="cb48-4">  sig_temp_genes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_genes_comp3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(comparison <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Control vs Temperature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Target)</span>
<span id="cb48-7">  </span>
<span id="cb48-8">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract significant genes for Mechanical</span></span>
<span id="cb48-9">  sig_mech_genes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_genes_comp3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(comparison <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Control vs Mechanical"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(Target)</span>
<span id="cb48-12">  </span>
<span id="cb48-13">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create annotation data</span></span>
<span id="cb48-14">  sig_annotations_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb48-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb48-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb48-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb48-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb48-19">  )</span>
<span id="cb48-20">  </span>
<span id="cb48-21">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add Temperature annotations</span></span>
<span id="cb48-22">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(sig_temp_genes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb48-23">    sig_annotations_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sig_annotations_comp3,</span>
<span id="cb48-24">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> sig_temp_genes,</span>
<span id="cb48-25">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>,</span>
<span id="cb48-26">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>))</span>
<span id="cb48-27">  }</span>
<span id="cb48-28">  </span>
<span id="cb48-29">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add Mechanical annotations</span></span>
<span id="cb48-30">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(sig_mech_genes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb48-31">    sig_annotations_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sig_annotations_comp3,</span>
<span id="cb48-32">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Target =</span> sig_mech_genes,</span>
<span id="cb48-33">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stress_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>,</span>
<span id="cb48-34">                 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>))</span>
<span id="cb48-35">  }</span>
<span id="cb48-36">  </span>
<span id="cb48-37">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get y positions for annotations</span></span>
<span id="cb48-38">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_annotations_comp3) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb48-39">    y_pos_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-40">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target, stress_type) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-41">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb48-42">    </span>
<span id="cb48-43">    sig_annotations_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sig_annotations_comp3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-44">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_pos_comp3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-45">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_pos =</span> max_y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb48-46">  }</span>
<span id="cb48-47">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb48-48">  sig_annotations_comp3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>()</span>
<span id="cb48-49">}</span>
<span id="cb48-50"></span>
<span id="cb48-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create plot</span></span>
<span id="cb48-52">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb48-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> stress_type)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkgray"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"salmon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steelblue"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-58">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb48-59">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq: PolyIC Control vs PolyIC Stressors"</span>,</span>
<span id="cb48-60">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stress Type"</span>,</span>
<span id="cb48-61">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>,</span>
<span id="cb48-62">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stress Type"</span></span>
<span id="cb48-63">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-64">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb48-65"></span>
<span id="cb48-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add annotations if any exist</span></span>
<span id="cb48-67"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_annotations_comp3) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb48-68">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb48-69">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sig_annotations_comp3, </span>
<span id="cb48-70">              <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_pos, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> label),</span>
<span id="cb48-71">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkorange"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-72">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Asterisks (*) indicate significant differences from PolyIC Control (t-test p ≤ 0.05)"</span>,</span>
<span id="cb48-73">         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant comparisons:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(sig_genes_comp3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)))</span>
<span id="cb48-74">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb48-75">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant differences detected in t-tests (all p &gt; 0.05)"</span>)</span>
<span id="cb48-76">}</span>
<span id="cb48-77"></span>
<span id="cb48-78"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(p)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/boxplot-polyIC-stress-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="all-treatments-comparison" class="level2">
<h2 class="anchored" data-anchor-id="all-treatments-comparison">All treatments comparison</h2>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Use emmeans objects created in Statistical Comparisons section</span></span>
<span id="cb49-2">all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>()</span>
<span id="cb49-3"></span>
<span id="cb49-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATP Synthase</span></span>
<span id="cb49-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_atp"</span>)) {</span>
<span id="cb49-6">  cld_temp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_atp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb49-7">  cld_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_temp)</span>
<span id="cb49-8">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span></span>
<span id="cb49-9">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb49-10">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>polyIC, cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb49-11">  all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(all_treat_annotations, </span>
<span id="cb49-12">                                 cld_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treatment_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)])</span>
<span id="cb49-13">}</span>
<span id="cb49-14"></span>
<span id="cb49-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP70</span></span>
<span id="cb49-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_hsp70"</span>)) {</span>
<span id="cb49-17">  cld_temp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_hsp70, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb49-18">  cld_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_temp)</span>
<span id="cb49-19">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span></span>
<span id="cb49-20">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb49-21">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>polyIC, cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb49-22">  all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(all_treat_annotations, </span>
<span id="cb49-23">                                 cld_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treatment_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)])</span>
<span id="cb49-24">}</span>
<span id="cb49-25"></span>
<span id="cb49-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP90</span></span>
<span id="cb49-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_hsp90"</span>)) {</span>
<span id="cb49-28">  cld_temp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_hsp90, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb49-29">  cld_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_temp)</span>
<span id="cb49-30">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span></span>
<span id="cb49-31">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb49-32">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>polyIC, cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb49-33">  all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(all_treat_annotations, </span>
<span id="cb49-34">                                 cld_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treatment_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)])</span>
<span id="cb49-35">}</span>
<span id="cb49-36"></span>
<span id="cb49-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VIPERIN</span></span>
<span id="cb49-38"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_viperin"</span>)) {</span>
<span id="cb49-39">  cld_temp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_viperin, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb49-40">  cld_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_temp)</span>
<span id="cb49-41">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span></span>
<span id="cb49-42">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb49-43">  cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>treatment_group <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>polyIC, cld_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb49-44">  all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(all_treat_annotations, </span>
<span id="cb49-45">                                 cld_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treatment_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)])</span>
<span id="cb49-46">}</span>
<span id="cb49-47"></span>
<span id="cb49-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate y positions if annotations exist</span></span>
<span id="cb49-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(all_treat_annotations) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb49-50">  y_pos_all <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-51">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target, treatment_group) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-52">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb49-53">  </span>
<span id="cb49-54">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate data range for each gene to use proportional offset</span></span>
<span id="cb49-55">  y_range_all <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-56">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-57">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_range =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb49-58">  </span>
<span id="cb49-59">  all_treat_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> all_treat_annotations <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_pos_all, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treatment_group"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-61">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_range_all, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-62">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_pos =</span> max_y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y_range <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 8% of data range above max</span></span>
<span id="cb49-63">}</span>
<span id="cb49-64"></span>
<span id="cb49-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create plot</span></span>
<span id="cb49-66">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb49-67">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> treatment_group, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> polyIC)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-69">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-70">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkgray"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"salmon"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-71">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expand =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expansion</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mult =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extra space at top for annotations</span></span>
<span id="cb49-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-73">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb49-74">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq Across All Treatment Groups"</span>,</span>
<span id="cb49-75">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Treatment Group"</span>,</span>
<span id="cb49-76">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>,</span>
<span id="cb49-77">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span></span>
<span id="cb49-78">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-79">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb49-80"></span>
<span id="cb49-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add annotations if they exist</span></span>
<span id="cb49-82"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(all_treat_annotations) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb49-83">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-84">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> all_treat_annotations,</span>
<span id="cb49-85">              <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> treatment_group, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_pos, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> label),</span>
<span id="cb49-86">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb49-87">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkorange"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fontface =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-88">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Letters show statistical groupings (p ≤ 0.05). Groups sharing a letter are NOT significantly different from each other"</span>,</span>
<span id="cb49-89">         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Compact Letter Display shown for genes with significant ANOVA effects. See ANOVA Models section for detailed statistics."</span>)</span>
<span id="cb49-90">}</span>
<span id="cb49-91"></span>
<span id="cb49-92"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(p)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/boxplot-all-treatments-1.png" class="img-fluid figure-img" width="1152"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="delta-delta-cq-and-fold-change-analysis" class="level1">
<h1>Delta Delta Cq and Fold Change Analysis</h1>
<section id="calculate-delta-delta-cq-for-each-comparison" class="level2">
<h2 class="anchored" data-anchor-id="calculate-delta-delta-cq-for-each-comparison">Calculate delta delta Cq for each comparison</h2>
<section id="comparison-1-stressors-vs-control-no-polyic" class="level3">
<h3 class="anchored" data-anchor-id="comparison-1-stressors-vs-control-no-polyic">Comparison 1: Stressors vs Control (No PolyIC)</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate delta delta Cq for Temperature vs Control (No PolyIC)</span></span>
<span id="cb50-2">delta_delta_temp_no_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> no_polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb50-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_control =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb50-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_temp =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb50-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_delta_Cq =</span> mean_temp <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_control,</span>
<span id="cb50-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fold_change =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>delta_delta_Cq),</span>
<span id="cb50-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb50-10">  )</span>
<span id="cb50-11"></span>
<span id="cb50-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature vs Control (No PolyIC):"</span>)</span>
<span id="cb50-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(delta_delta_temp_no_polyIC)</span>
<span id="cb50-14"></span>
<span id="cb50-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate delta delta Cq for Mechanical vs Control (No PolyIC)</span></span>
<span id="cb50-16">delta_delta_mech_no_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> no_polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb50-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_control =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb50-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_mech =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb50-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_delta_Cq =</span> mean_mech <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_control,</span>
<span id="cb50-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fold_change =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>delta_delta_Cq),</span>
<span id="cb50-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb50-24">  )</span>
<span id="cb50-25"></span>
<span id="cb50-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical vs Control (No PolyIC):"</span>)</span>
<span id="cb50-27"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(delta_delta_mech_no_polyIC)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Temperature vs Control (No PolyIC):"
# A tibble: 7 × 5
  Target           mean_control mean_temp delta_delta_Cq fold_change
  &lt;chr&gt;                   &lt;dbl&gt;     &lt;dbl&gt;          &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase           -0.118    0.0257         0.144        0.905
2 Citrate.Synthase        0.390    0.492          0.101        0.932
3 DNMT1                   6.26     6.04          -0.221        1.17 
4 HSP70                   5.51     0.493         -5.02        32.4  
5 HSP90                   0.457    0.427         -0.0306       1.02 
6 VIPERIN                 5.19     5.06          -0.136        1.10 
7 cGAS                    6.39     6.22          -0.166        1.12 
[1] "Mechanical vs Control (No PolyIC):"
# A tibble: 7 × 5
  Target           mean_control mean_mech delta_delta_Cq fold_change
  &lt;chr&gt;                   &lt;dbl&gt;     &lt;dbl&gt;          &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase           -0.118    0.0333        0.151         0.900
2 Citrate.Synthase        0.390    0.685         0.295         0.815
3 DNMT1                   6.26     6.13         -0.128         1.09 
4 HSP70                   5.51     5.51          0.00376       0.997
5 HSP90                   0.457    0.346        -0.111         1.08 
6 VIPERIN                 5.19     4.88         -0.310         1.24 
7 cGAS                    6.39     5.94         -0.443         1.36 </code></pre>
</div>
</div>
</section>
<section id="comparison-2-polyic-control-vs-basic-control" class="level3">
<h3 class="anchored" data-anchor-id="comparison-2-polyic-control-vs-basic-control">Comparison 2: PolyIC Control vs Basic Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1">delta_delta_polyIC_control <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> control_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb52-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb52-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb52-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_no_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb52-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_polyIC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb52-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_delta_Cq =</span> mean_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_no_polyIC,</span>
<span id="cb52-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fold_change =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>delta_delta_Cq),</span>
<span id="cb52-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb52-9">  )</span>
<span id="cb52-10"></span>
<span id="cb52-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Control vs Basic Control:"</span>)</span>
<span id="cb52-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(delta_delta_polyIC_control)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "PolyIC Control vs Basic Control:"
# A tibble: 7 × 5
  Target           mean_no_polyIC mean_polyIC delta_delta_Cq fold_change
  &lt;chr&gt;                     &lt;dbl&gt;       &lt;dbl&gt;          &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase             -0.118       2.14           2.26        0.209
2 Citrate.Synthase          0.390       2.41           2.02        0.247
3 DNMT1                     6.26        6.42           0.158       0.896
4 HSP70                     5.51        3.29          -2.22        4.66 
5 HSP90                     0.457      -0.113         -0.571       1.49 
6 VIPERIN                   5.19        4.01          -1.18        2.27 
7 cGAS                      6.39        6.22          -0.168       1.12 </code></pre>
</div>
</div>
</section>
<section id="comparison-3-polyic-stressors-vs-polyic-control" class="level3">
<h3 class="anchored" data-anchor-id="comparison-3-polyic-stressors-vs-polyic-control">Comparison 3: PolyIC Stressors vs PolyIC Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate delta delta Cq for Temperature vs Control (PolyIC)</span></span>
<span id="cb54-2">delta_delta_temp_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb54-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb54-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb54-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_control =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb54-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_temp =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb54-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_delta_Cq =</span> mean_temp <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_control,</span>
<span id="cb54-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fold_change =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>delta_delta_Cq),</span>
<span id="cb54-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb54-10">  )</span>
<span id="cb54-11"></span>
<span id="cb54-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature vs Control (PolyIC):"</span>)</span>
<span id="cb54-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(delta_delta_temp_polyIC)</span>
<span id="cb54-14"></span>
<span id="cb54-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate delta delta Cq for Mechanical vs Control (PolyIC)</span></span>
<span id="cb54-16">delta_delta_mech_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> polyIC_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb54-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb54-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb54-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_control =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb54-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_mech =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(delta_Cq[stress_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb54-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_delta_Cq =</span> mean_mech <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mean_control,</span>
<span id="cb54-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fold_change =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>delta_delta_Cq),</span>
<span id="cb54-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drop'</span></span>
<span id="cb54-24">  )</span>
<span id="cb54-25"></span>
<span id="cb54-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical vs Control (PolyIC):"</span>)</span>
<span id="cb54-27"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(delta_delta_mech_polyIC)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Temperature vs Control (PolyIC):"
# A tibble: 7 × 5
  Target           mean_control mean_temp delta_delta_Cq fold_change
  &lt;chr&gt;                   &lt;dbl&gt;     &lt;dbl&gt;          &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase            2.14      0.376        -1.76         3.39 
2 Citrate.Synthase        2.41      0.508        -1.90         3.73 
3 DNMT1                   6.42      5.57         -0.854        1.81 
4 HSP70                   3.29     -0.692        -3.98        15.8  
5 HSP90                  -0.113    -0.395        -0.282        1.22 
6 VIPERIN                 4.01      4.42          0.408        0.754
7 cGAS                    6.22      6.19         -0.0287       1.02 
[1] "Mechanical vs Control (PolyIC):"
# A tibble: 7 × 5
  Target           mean_control mean_mech delta_delta_Cq fold_change
  &lt;chr&gt;                   &lt;dbl&gt;     &lt;dbl&gt;          &lt;dbl&gt;       &lt;dbl&gt;
1 ATP.Synthase            2.14      0.238        -1.90         3.73 
2 Citrate.Synthase        2.41      2.18         -0.224        1.17 
3 DNMT1                   6.42      6.30         -0.119        1.09 
4 HSP70                   3.29      3.02         -0.267        1.20 
5 HSP90                  -0.113    -0.284        -0.171        1.13 
6 VIPERIN                 4.01      4.11          0.0988       0.934
7 cGAS                    6.22      5.56         -0.655        1.57 </code></pre>
</div>
</div>
</section>
</section>
<section id="fold-change-bar-plots" class="level2">
<h2 class="anchored" data-anchor-id="fold-change-bar-plots">Fold Change Bar Plots</h2>
<section id="no-polyic-stressors-vs-control" class="level3">
<h3 class="anchored" data-anchor-id="no-polyic-stressors-vs-control">No PolyIC: Stressors vs Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb56-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Combine temperature and mechanical comparisons</span></span>
<span id="cb56-2">fold_change_no_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb56-3">  delta_delta_temp_no_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature vs Control"</span>),</span>
<span id="cb56-4">  delta_delta_mech_no_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical vs Control"</span>)</span>
<span id="cb56-5">)</span>
<span id="cb56-6"></span>
<span id="cb56-7">fold_change_no_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb56-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> fold_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> comparison)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_bar</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dodge"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_linetype_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb56-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change: Stressors vs Control (No PolyIC)"</span>,</span>
<span id="cb56-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target Gene"</span>,</span>
<span id="cb56-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change"</span>,</span>
<span id="cb56-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Comparison"</span></span>
<span id="cb56-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb56-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/barplot-fold-change-no-polyIC-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="polyic-control-vs-basic-control" class="level3">
<h3 class="anchored" data-anchor-id="polyic-control-vs-basic-control">PolyIC Control vs Basic Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb57-1">delta_delta_polyIC_control <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb57-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> fold_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> Target)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_bar</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_linetype_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb57-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change: PolyIC Control vs Basic Control"</span>,</span>
<span id="cb57-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target Gene"</span>,</span>
<span id="cb57-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change"</span></span>
<span id="cb57-11">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb57-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/barplot-fold-change-polyIC-control-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="polyic-stressors-vs-control" class="level3">
<h3 class="anchored" data-anchor-id="polyic-stressors-vs-control">PolyIC: Stressors vs Control</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Combine temperature and mechanical comparisons for PolyIC</span></span>
<span id="cb58-2">fold_change_polyIC <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb58-3">  delta_delta_temp_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Temperature vs Control"</span>),</span>
<span id="cb58-4">  delta_delta_mech_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparison =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mechanical vs Control"</span>)</span>
<span id="cb58-5">)</span>
<span id="cb58-6"></span>
<span id="cb58-7">fold_change_polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb58-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> fold_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> comparison)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_bar</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dodge"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_linetype_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No change (FC = 1)"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb58-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change: Stressors vs Control (PolyIC Treatment)"</span>,</span>
<span id="cb58-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target Gene"</span>,</span>
<span id="cb58-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fold Change"</span>,</span>
<span id="cb58-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Comparison"</span></span>
<span id="cb58-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb58-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/barplot-fold-change-polyIC-stress-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
</section>
<section id="anova-results-and-diagnostics" class="level1">
<h1>ANOVA Results and Diagnostics</h1>
<p>Run ANOVA models to test for effects of PolyIC treatment and stress type on delta Cq values for each target gene.</p>
<p><strong>Note:</strong> ANOVA models were created in the Statistical Comparisons section above. This section provides detailed assumption checks and interpretations for each gene.</p>
<section id="data-distribution-check" class="level2">
<h2 class="anchored" data-anchor-id="data-distribution-check">Data distribution check</h2>
<p>ANOVA assumes that data (or residuals) are approximately normally distributed. This histogram provides a quick visual check of the overall delta Cq distribution across all samples and targets.</p>
<p><strong>What to look for:</strong> - <strong>Bell-shaped curve</strong>: Indicates roughly normal distribution, supporting ANOVA use - <strong>Skewness</strong>: Strong left or right skew may violate normality assumptions - <strong>Outliers</strong>: Extreme values far from the main distribution - <strong>Multimodal</strong>: Multiple peaks may indicate distinct subpopulations</p>
<p>While this shows the overall distribution, we’ll check normality of residuals for each gene-specific model using QQ plots below.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb59" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb59-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hist</span>(delta_Cq_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Distribution of Delta Cq Values"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/delta-cq-histogram-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="atp-synthase" class="level2">
<h2 class="anchored" data-anchor-id="atp-synthase">ATP Synthase</h2>
<p>ATP synthase is an enzyme complex that functions to synthesize adenosine triphosphate (ATP) from adenosine diphosphate (ADP) and inorganic phosphate (Pi), essentially generating the cell’s primary energy currency by harnessing the energy from a proton gradient across a membrane.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1">model_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb60-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb60-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb60-4"></span>
<span id="cb60-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_atp)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                    Df Sum Sq Mean Sq F value   Pr(&gt;F)    
polyIC               1  25.56  25.562  13.896 0.000316 ***
stress_type          2  13.54   6.771   3.681 0.028581 *  
polyIC:stress_type   2  23.45  11.723   6.373 0.002459 ** 
Residuals          103 189.48   1.840                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
</div>
</div>
<section id="assumption-checks-for-atp-synthase" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-atp-synthase">Assumption Checks for ATP Synthase</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb62-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_atp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-atp-synthase-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 16 43</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_atp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb64-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>))</span>
<span id="cb64-3"></span>
<span id="cb64-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb64-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_atp)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb64-6">  emm_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_atp, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb64-7">  pairs_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_atp)</span>
<span id="cb64-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_atp)</span>
<span id="cb64-9">  </span>
<span id="cb64-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb64-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_atp)</span>
<span id="cb64-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb64-13">  </span>
<span id="cb64-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**ATP Synthase - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb64-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb64-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb64-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb64-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb64-19">    }</span>
<span id="cb64-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb64-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb64-22">  }</span>
<span id="cb64-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb64-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb64-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
       Df F value    Pr(&gt;F)    
group   5  18.846 2.899e-13 ***
      103                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 contrast                                     estimate    SE  df t.ratio
 No_PolyIC Control - PolyIC Control           -2.25679 0.447 103  -5.044
 No_PolyIC Control - No_PolyIC Mechanical     -0.15123 0.429 103  -0.353
 No_PolyIC Control - PolyIC Mechanical        -0.35618 0.495 103  -0.719
 No_PolyIC Control - No_PolyIC Temperature    -0.14360 0.429 103  -0.335
 No_PolyIC Control - PolyIC Temperature       -0.49388 0.429 103  -1.151
 PolyIC Control - No_PolyIC Mechanical         2.10556 0.447 103   4.706
 PolyIC Control - PolyIC Mechanical            1.90061 0.511 103   3.717
 PolyIC Control - No_PolyIC Temperature        2.11319 0.447 103   4.723
 PolyIC Control - PolyIC Temperature           1.76291 0.447 103   3.940
 No_PolyIC Mechanical - PolyIC Mechanical     -0.20495 0.495 103  -0.414
 No_PolyIC Mechanical - No_PolyIC Temperature  0.00763 0.429 103   0.018
 No_PolyIC Mechanical - PolyIC Temperature    -0.34265 0.429 103  -0.799
 PolyIC Mechanical - No_PolyIC Temperature     0.21258 0.495 103   0.429
 PolyIC Mechanical - PolyIC Temperature       -0.13770 0.495 103  -0.278
 No_PolyIC Temperature - PolyIC Temperature   -0.35028 0.429 103  -0.817
 p.value
 &lt;0.0001
  0.9993
  0.9792
  0.9994
  0.8584
  0.0001
  0.0043
  0.0001
  0.0020
  0.9984
  1.0000
  0.9671
  0.9981
  0.9998
  0.9639

P value adjustment: tukey method for comparing a family of 6 estimates 

**ATP Synthase - Pairwise Contrast Summary:**

Significant contrasts (p ≤ 0.05):
- No_PolyIC Control - PolyIC Control (p = 0 )
- PolyIC Control - No_PolyIC Mechanical (p = 1e-04 )
- PolyIC Control - PolyIC Mechanical (p = 0.0043 )
- PolyIC Control - No_PolyIC Temperature (p = 1e-04 )
- PolyIC Control - PolyIC Temperature (p = 0.002 )</code></pre>
</div>
</div>
</section>
<section id="atp-synthase-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="atp-synthase-anova-interpretation">ATP Synthase ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb66" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb66-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_atp)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb66-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb66-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb66-4"></span>
<span id="cb66-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_atp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb66-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span>))</span>
<span id="cb66-7"></span>
<span id="cb66-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**ATP Synthase ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect ATP Synthase expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-10"></span>
<span id="cb66-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-12"></span>
<span id="cb66-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check main effects and interaction</span></span>
<span id="cb66-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb66-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-16">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb66-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-18">}</span>
<span id="cb66-19"></span>
<span id="cb66-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb66-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-22">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb66-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-24">}</span>
<span id="cb66-25"></span>
<span id="cb66-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb66-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-29">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb66-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-31">}</span>
<span id="cb66-32"></span>
<span id="cb66-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-34"></span>
<span id="cb66-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check Levene's test</span></span>
<span id="cb66-36">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb66-37"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb66-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-40">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb66-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb66-43">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**ATP Synthase ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect ATP Synthase expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: SIGNIFICANT (p = 3e-04 )
- **Stress type effect**: SIGNIFICANT (p = 0.0286 )
- **PolyIC × Stress interaction**: SIGNIFICANT (p = 0.0025 )
  → The effect of stress depends on PolyIC treatment status.

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): FAILED (p = 0 ) ⚠️
  → Variances differ across groups; ANOVA results should be interpreted with caution.</code></pre>
</div>
</div>
</section>
</section>
<section id="citrate-synthase" class="level2">
<h2 class="anchored" data-anchor-id="citrate-synthase">Citrate Synthase</h2>
<p>Citrate synthase is important for energy production in the TCA cycle and is linked to the electron transport chain. It is also used as an enzyme marker for intact mitochondria.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb68" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb68-1">model_citrate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb68-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb68-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb68-4"></span>
<span id="cb68-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_citrate)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                    Df Sum Sq Mean Sq F value   Pr(&gt;F)    
polyIC               1  32.28   32.28   35.11 4.00e-08 ***
stress_type          2  19.94    9.97   10.85 5.23e-05 ***
polyIC:stress_type   2  20.88   10.44   11.36 3.43e-05 ***
Residuals          105  96.53    0.92                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
</div>
</div>
<section id="assumption-checks-for-citrate-synthase" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-citrate-synthase">Assumption Checks for Citrate Synthase</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb70" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb70-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_citrate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-citrate-synthase-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 45 67</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb72" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb72-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_citrate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb72-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>))</span>
<span id="cb72-3"></span>
<span id="cb72-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb72-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_citrate)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb72-6">  emm_citrate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_citrate, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb72-7">  pairs_citrate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_citrate)</span>
<span id="cb72-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_citrate)</span>
<span id="cb72-9">  </span>
<span id="cb72-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb72-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_citrate)</span>
<span id="cb72-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb72-13">  </span>
<span id="cb72-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Citrate Synthase - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb72-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb72-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb72-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb72-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb72-19">    }</span>
<span id="cb72-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb72-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb72-22">  }</span>
<span id="cb72-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb72-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb72-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
       Df F value   Pr(&gt;F)    
group   5  23.346 1.05e-15 ***
      105                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 contrast                                     estimate    SE  df t.ratio
 No_PolyIC Control - PolyIC Control            -2.0155 0.312 105  -6.470
 No_PolyIC Control - No_PolyIC Mechanical      -0.2950 0.303 105  -0.973
 No_PolyIC Control - PolyIC Mechanical         -1.7910 0.342 105  -5.243
 No_PolyIC Control - No_PolyIC Temperature     -0.1012 0.303 105  -0.334
 No_PolyIC Control - PolyIC Temperature        -0.1179 0.303 105  -0.389
 PolyIC Control - No_PolyIC Mechanical          1.7206 0.312 105   5.523
 PolyIC Control - PolyIC Mechanical             0.2245 0.349 105   0.643
 PolyIC Control - No_PolyIC Temperature         1.9143 0.312 105   6.145
 PolyIC Control - PolyIC Temperature            1.8976 0.312 105   6.092
 No_PolyIC Mechanical - PolyIC Mechanical      -1.4961 0.342 105  -4.380
 No_PolyIC Mechanical - No_PolyIC Temperature   0.1937 0.303 105   0.639
 No_PolyIC Mechanical - PolyIC Temperature      0.1770 0.303 105   0.584
 PolyIC Mechanical - No_PolyIC Temperature      1.6898 0.342 105   4.947
 PolyIC Mechanical - PolyIC Temperature         1.6731 0.342 105   4.898
 No_PolyIC Temperature - PolyIC Temperature    -0.0167 0.303 105  -0.055
 p.value
 &lt;0.0001
  0.9256
 &lt;0.0001
  0.9994
  0.9988
 &lt;0.0001
  0.9874
 &lt;0.0001
 &lt;0.0001
  0.0004
  0.9878
  0.9919
 &lt;0.0001
 &lt;0.0001
  1.0000

P value adjustment: tukey method for comparing a family of 6 estimates 

**Citrate Synthase - Pairwise Contrast Summary:**

Significant contrasts (p ≤ 0.05):
- No_PolyIC Control - PolyIC Control (p = 0 )
- No_PolyIC Control - PolyIC Mechanical (p = 0 )
- PolyIC Control - No_PolyIC Mechanical (p = 0 )
- PolyIC Control - No_PolyIC Temperature (p = 0 )
- PolyIC Control - PolyIC Temperature (p = 0 )
- No_PolyIC Mechanical - PolyIC Mechanical (p = 4e-04 )
- PolyIC Mechanical - No_PolyIC Temperature (p = 0 )
- PolyIC Mechanical - PolyIC Temperature (p = 1e-04 )</code></pre>
</div>
</div>
</section>
<section id="citrate-synthase-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="citrate-synthase-anova-interpretation">Citrate Synthase ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb74" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb74-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_citrate)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb74-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb74-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb74-4"></span>
<span id="cb74-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_citrate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb74-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Citrate.Synthase"</span>))</span>
<span id="cb74-7"></span>
<span id="cb74-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Citrate Synthase ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect Citrate Synthase expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-10"></span>
<span id="cb74-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-12"></span>
<span id="cb74-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb74-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb74-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-17">}</span>
<span id="cb74-18"></span>
<span id="cb74-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb74-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb74-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-23">}</span>
<span id="cb74-24"></span>
<span id="cb74-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb74-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb74-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-30">}</span>
<span id="cb74-31"></span>
<span id="cb74-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-33"></span>
<span id="cb74-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb74-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb74-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb74-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb74-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**Citrate Synthase ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect Citrate Synthase expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: SIGNIFICANT (p = 0 )
- **Stress type effect**: SIGNIFICANT (p = 1e-04 )
- **PolyIC × Stress interaction**: SIGNIFICANT (p = 0 )
  → The effect of stress depends on PolyIC treatment status.

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): FAILED (p = 0 ) ⚠️
  → Variances differ across groups; ANOVA results should be interpreted with caution.</code></pre>
</div>
</div>
</section>
</section>
<section id="dnmt1" class="level2">
<h2 class="anchored" data-anchor-id="dnmt1">DNMT1</h2>
<p>The DNMT1 gene provides instructions for making an enzyme called DNA methyltransferase 1. This enzyme is involved in DNA methylation, which is the addition of methyl groups, consisting of one carbon atom and three hydrogen atoms, to DNA molecules.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb76" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb76-1">model_dnmt1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb76-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb76-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb76-4"></span>
<span id="cb76-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_dnmt1)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                   Df Sum Sq Mean Sq F value Pr(&gt;F)
polyIC              1   1.70  1.7029   1.719  0.193
stress_type         2   3.47  1.7365   1.753  0.179
polyIC:stress_type  2   1.84  0.9206   0.929  0.399
Residuals          85  84.21  0.9907               </code></pre>
</div>
</div>
<section id="assumption-checks-for-dnmt1" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-dnmt1">Assumption Checks for DNMT1</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb78" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb78-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_dnmt1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-dnmt1-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 82 11</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb80" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb80-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_dnmt1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb80-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>))</span>
<span id="cb80-3"></span>
<span id="cb80-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb80-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_dnmt1)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb80-6">  emm_dnmt1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_dnmt1, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb80-7">  pairs_dnmt1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_dnmt1)</span>
<span id="cb80-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_dnmt1)</span>
<span id="cb80-9">  </span>
<span id="cb80-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb80-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_dnmt1)</span>
<span id="cb80-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb80-13">  </span>
<span id="cb80-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**DNMT1 - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb80-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb80-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb80-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb80-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb80-19">    }</span>
<span id="cb80-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb80-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb80-22">  }</span>
<span id="cb80-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb80-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb80-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(&gt;F)
group  5  0.7104 0.6172
      85               
No significant effects found; post-hoc tests not performed.</code></pre>
</div>
</div>
</section>
<section id="dnmt1-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="dnmt1-anova-interpretation">DNMT1 ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb82" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb82-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_dnmt1)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb82-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb82-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb82-4"></span>
<span id="cb82-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_dnmt1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb82-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DNMT1"</span>))</span>
<span id="cb82-7"></span>
<span id="cb82-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**DNMT1 ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect DNMT1 expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-10"></span>
<span id="cb82-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-12"></span>
<span id="cb82-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb82-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb82-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-17">}</span>
<span id="cb82-18"></span>
<span id="cb82-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb82-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb82-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-23">}</span>
<span id="cb82-24"></span>
<span id="cb82-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb82-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb82-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-30">}</span>
<span id="cb82-31"></span>
<span id="cb82-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-33"></span>
<span id="cb82-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb82-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb82-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb82-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb82-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**DNMT1 ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect DNMT1 expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: Not significant (p = 0.1934 )
- **Stress type effect**: Not significant (p = 0.1795 )
- **PolyIC × Stress interaction**: Not significant (p = 0.3988 )

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): PASSED (p = 0.6172 ) ✓
  → Variances are equal across groups; ANOVA is appropriate.</code></pre>
</div>
</div>
</section>
</section>
<section id="hsp70" class="level2">
<h2 class="anchored" data-anchor-id="hsp70">HSP70</h2>
<p>Heat Shock Protein 70 (Hsp70) is a molecular chaperone that plays crucial roles in maintaining cellular protein homeostasis and protecting cells from stress.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb84" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb84-1">model_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb84-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb84-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb84-4"></span>
<span id="cb84-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp70)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                    Df Sum Sq Mean Sq F value   Pr(&gt;F)    
polyIC               1  129.1  129.06  48.821 2.57e-10 ***
stress_type          2  510.9  255.47  96.637  &lt; 2e-16 ***
polyIC:stress_type   2    9.0    4.48   1.695    0.189    
Residuals          106  280.2    2.64                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
</div>
</div>
<section id="assumption-checks-for-hsp70" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-hsp70">Assumption Checks for HSP70</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb86" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb86-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_hsp70<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-hsp70-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 112  33</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb88" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb88-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_hsp70<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb88-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>))</span>
<span id="cb88-3"></span>
<span id="cb88-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb88-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp70)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb88-6">  emm_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_hsp70, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb88-7">  pairs_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_hsp70)</span>
<span id="cb88-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_hsp70)</span>
<span id="cb88-9">  </span>
<span id="cb88-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb88-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_hsp70)</span>
<span id="cb88-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb88-13">  </span>
<span id="cb88-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**HSP70 - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb88-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb88-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb88-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb88-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb88-19">    }</span>
<span id="cb88-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb88-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb88-22">  }</span>
<span id="cb88-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb88-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb88-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
       Df F value Pr(&gt;F)
group   5  0.5772 0.7174
      106               
 contrast                                     estimate    SE  df t.ratio
 No_PolyIC Control - PolyIC Control            2.22096 0.528 106   4.204
 No_PolyIC Control - No_PolyIC Mechanical     -0.00376 0.514 106  -0.007
 No_PolyIC Control - PolyIC Mechanical         2.48756 0.567 106   4.391
 No_PolyIC Control - No_PolyIC Temperature     5.01595 0.514 106   9.756
 No_PolyIC Control - PolyIC Temperature        6.20008 0.514 106  12.059
 PolyIC Control - No_PolyIC Mechanical        -2.22472 0.528 106  -4.212
 PolyIC Control - PolyIC Mechanical            0.26660 0.579 106   0.460
 PolyIC Control - No_PolyIC Temperature        2.79500 0.528 106   5.291
 PolyIC Control - PolyIC Temperature           3.97913 0.528 106   7.533
 No_PolyIC Mechanical - PolyIC Mechanical      2.49132 0.567 106   4.397
 No_PolyIC Mechanical - No_PolyIC Temperature  5.01971 0.514 106   9.763
 No_PolyIC Mechanical - PolyIC Temperature     6.20385 0.514 106  12.066
 PolyIC Mechanical - No_PolyIC Temperature     2.52840 0.567 106   4.463
 PolyIC Mechanical - PolyIC Temperature        3.71253 0.567 106   6.553
 No_PolyIC Temperature - PolyIC Temperature    1.18413 0.514 106   2.303
 p.value
  0.0008
  1.0000
  0.0004
 &lt;0.0001
 &lt;0.0001
  0.0007
  0.9974
 &lt;0.0001
 &lt;0.0001
  0.0004
 &lt;0.0001
 &lt;0.0001
  0.0003
 &lt;0.0001
  0.2021

P value adjustment: tukey method for comparing a family of 6 estimates 

**HSP70 - Pairwise Contrast Summary:**

Significant contrasts (p ≤ 0.05):
- No_PolyIC Control - PolyIC Control (p = 8e-04 )
- No_PolyIC Control - PolyIC Mechanical (p = 4e-04 )
- No_PolyIC Control - No_PolyIC Temperature (p = 0 )
- No_PolyIC Control - PolyIC Temperature (p = 0 )
- PolyIC Control - No_PolyIC Mechanical (p = 7e-04 )
- PolyIC Control - No_PolyIC Temperature (p = 0 )
- PolyIC Control - PolyIC Temperature (p = 0 )
- No_PolyIC Mechanical - PolyIC Mechanical (p = 4e-04 )
- No_PolyIC Mechanical - No_PolyIC Temperature (p = 0 )
- No_PolyIC Mechanical - PolyIC Temperature (p = 0 )
- PolyIC Mechanical - No_PolyIC Temperature (p = 3e-04 )
- PolyIC Mechanical - PolyIC Temperature (p = 0 )</code></pre>
</div>
</div>
</section>
<section id="hsp70-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="hsp70-anova-interpretation">HSP70 ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb90" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb90-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp70)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb90-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb90-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb90-4"></span>
<span id="cb90-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_hsp70<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb90-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span>))</span>
<span id="cb90-7"></span>
<span id="cb90-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**HSP70 ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect HSP70 expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-10"></span>
<span id="cb90-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-12"></span>
<span id="cb90-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb90-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb90-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-17">}</span>
<span id="cb90-18"></span>
<span id="cb90-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb90-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb90-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-23">}</span>
<span id="cb90-24"></span>
<span id="cb90-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb90-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb90-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-30">}</span>
<span id="cb90-31"></span>
<span id="cb90-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-33"></span>
<span id="cb90-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb90-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb90-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb90-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb90-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**HSP70 ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect HSP70 expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: SIGNIFICANT (p = 0 )
- **Stress type effect**: SIGNIFICANT (p = 0 )
- **PolyIC × Stress interaction**: Not significant (p = 0.1886 )

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): PASSED (p = 0.7174 ) ✓
  → Variances are equal across groups; ANOVA is appropriate.</code></pre>
</div>
</div>
</section>
</section>
<section id="hsp90" class="level2">
<h2 class="anchored" data-anchor-id="hsp90">HSP90</h2>
<p>Heat shock protein 90 (Hsp90) is a molecular chaperone that helps proteins fold, mature, and remain active. Hsp90 also helps regulate signaling networks and is involved in many cellular processes.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb92" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb92-1">model_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb92-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb92-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb92-4"></span>
<span id="cb92-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp90)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                   Df Sum Sq Mean Sq F value   Pr(&gt;F)    
polyIC              1 10.845  10.845  48.902 5.47e-10 ***
stress_type         2  0.332   0.166   0.749    0.476    
polyIC:stress_type  2  0.257   0.129   0.581    0.562    
Residuals          86 19.072   0.222                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
</div>
</div>
<section id="assumption-checks-for-hsp90" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-hsp90">Assumption Checks for HSP90</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb94" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb94-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_hsp90<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-hsp90-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 63 11</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb96" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb96-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_hsp90<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb96-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>))</span>
<span id="cb96-3"></span>
<span id="cb96-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb96-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp90)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb96-6">  emm_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_hsp90, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb96-7">  pairs_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_hsp90)</span>
<span id="cb96-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_hsp90)</span>
<span id="cb96-9">  </span>
<span id="cb96-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb96-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_hsp90)</span>
<span id="cb96-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb96-13">  </span>
<span id="cb96-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**HSP90 - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb96-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb96-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb96-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb96-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb96-19">    }</span>
<span id="cb96-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb96-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb96-22">  }</span>
<span id="cb96-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb96-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb96-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(&gt;F)
group  5  0.2428 0.9423
      86               
 contrast                                     estimate    SE df t.ratio p.value
 No_PolyIC Control - PolyIC Control             0.5705 0.197 86   2.896  0.0525
 No_PolyIC Control - No_PolyIC Mechanical       0.1112 0.149 86   0.747  0.9753
 No_PolyIC Control - PolyIC Mechanical          0.7415 0.258 86   2.875  0.0555
 No_PolyIC Control - No_PolyIC Temperature      0.0306 0.149 86   0.205  0.9999
 No_PolyIC Control - PolyIC Temperature         0.8525 0.149 86   5.725 &lt;0.0001
 PolyIC Control - No_PolyIC Mechanical         -0.4593 0.197 86  -2.331  0.1930
 PolyIC Control - PolyIC Mechanical             0.1710 0.288 86   0.593  0.9913
 PolyIC Control - No_PolyIC Temperature        -0.5399 0.197 86  -2.741  0.0777
 PolyIC Control - PolyIC Temperature            0.2820 0.197 86   1.432  0.7078
 No_PolyIC Mechanical - PolyIC Mechanical       0.6303 0.258 86   2.444  0.1531
 No_PolyIC Mechanical - No_PolyIC Temperature  -0.0806 0.149 86  -0.541  0.9943
 No_PolyIC Mechanical - PolyIC Temperature      0.7413 0.149 86   4.978 &lt;0.0001
 PolyIC Mechanical - No_PolyIC Temperature     -0.7109 0.258 86  -2.756  0.0748
 PolyIC Mechanical - PolyIC Temperature         0.1110 0.258 86   0.430  0.9981
 No_PolyIC Temperature - PolyIC Temperature     0.8219 0.149 86   5.519 &lt;0.0001

P value adjustment: tukey method for comparing a family of 6 estimates 

**HSP90 - Pairwise Contrast Summary:**

Significant contrasts (p ≤ 0.05):
- No_PolyIC Control - PolyIC Temperature (p = 0 )
- No_PolyIC Mechanical - PolyIC Temperature (p = 0 )
- No_PolyIC Temperature - PolyIC Temperature (p = 0 )</code></pre>
</div>
</div>
</section>
<section id="hsp90-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="hsp90-anova-interpretation">HSP90 ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb98" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb98-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_hsp90)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb98-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb98-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb98-4"></span>
<span id="cb98-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_hsp90<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb98-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span>))</span>
<span id="cb98-7"></span>
<span id="cb98-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**HSP90 ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect HSP90 expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-10"></span>
<span id="cb98-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-12"></span>
<span id="cb98-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb98-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb98-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-17">}</span>
<span id="cb98-18"></span>
<span id="cb98-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb98-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb98-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-23">}</span>
<span id="cb98-24"></span>
<span id="cb98-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb98-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb98-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-30">}</span>
<span id="cb98-31"></span>
<span id="cb98-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-33"></span>
<span id="cb98-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb98-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb98-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb98-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb98-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**HSP90 ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect HSP90 expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: SIGNIFICANT (p = 0 )
- **Stress type effect**: Not significant (p = 0.4758 )
- **PolyIC × Stress interaction**: Not significant (p = 0.5618 )

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): PASSED (p = 0.9423 ) ✓
  → Variances are equal across groups; ANOVA is appropriate.</code></pre>
</div>
</div>
</section>
</section>
<section id="cgas" class="level2">
<h2 class="anchored" data-anchor-id="cgas">cGAS</h2>
<p>The cGAS gene is involved in several processes, including cellular response to exogenous dsRNA, positive regulation of intracellular signal transduction, and regulation of defense response.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb100" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb100-1">model_cgas <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb100-4"></span>
<span id="cb100-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_cgas)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                   Df Sum Sq Mean Sq F value Pr(&gt;F)
polyIC              1   0.09  0.0880   0.103  0.749
stress_type         2   3.10  1.5510   1.822  0.168
polyIC:stress_type  2   0.32  0.1577   0.185  0.831
Residuals          86  73.21  0.8513               </code></pre>
</div>
</div>
<section id="assumption-checks-for-cgas" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-cgas">Assumption Checks for cGAS</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb102" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb102-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_cgas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-cgas-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 68 83</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb104" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb104-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_cgas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb104-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>))</span>
<span id="cb104-3"></span>
<span id="cb104-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb104-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_cgas)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb104-6">  emm_cgas <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_cgas, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb104-7">  pairs_cgas <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_cgas)</span>
<span id="cb104-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_cgas)</span>
<span id="cb104-9">  </span>
<span id="cb104-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb104-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_cgas)</span>
<span id="cb104-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb104-13">  </span>
<span id="cb104-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**cGAS - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb104-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb104-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb104-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb104-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb104-19">    }</span>
<span id="cb104-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb104-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb104-22">  }</span>
<span id="cb104-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb104-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb104-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(&gt;F)
group  5  0.7847 0.5635
      86               
No significant effects found; post-hoc tests not performed.</code></pre>
</div>
</div>
</section>
<section id="cgas-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="cgas-anova-interpretation">cGAS ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb106" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb106-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_cgas)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb106-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb106-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb106-4"></span>
<span id="cb106-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_cgas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb106-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cGAS"</span>))</span>
<span id="cb106-7"></span>
<span id="cb106-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**cGAS ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect cGAS expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-10"></span>
<span id="cb106-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-12"></span>
<span id="cb106-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb106-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb106-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-17">}</span>
<span id="cb106-18"></span>
<span id="cb106-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb106-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb106-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-23">}</span>
<span id="cb106-24"></span>
<span id="cb106-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb106-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb106-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-30">}</span>
<span id="cb106-31"></span>
<span id="cb106-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-33"></span>
<span id="cb106-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb106-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb106-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb106-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb106-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**cGAS ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect cGAS expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: Not significant (p = 0.7486 )
- **Stress type effect**: Not significant (p = 0.1679 )
- **PolyIC × Stress interaction**: Not significant (p = 0.8312 )

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): PASSED (p = 0.5635 ) ✓
  → Variances are equal across groups; ANOVA is appropriate.</code></pre>
</div>
</div>
</section>
</section>
<section id="viperin" class="level2">
<h2 class="anchored" data-anchor-id="viperin">VIPERIN</h2>
<p>Viperin limits replication of DNA and RNA viruses.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb108" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb108-1">model_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb108-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb108-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aov</span>(delta_Cq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb108-4"></span>
<span id="cb108-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_viperin)</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>                   Df Sum Sq Mean Sq F value   Pr(&gt;F)    
polyIC              1  12.27  12.269  15.528 0.000165 ***
stress_type         2   0.96   0.478   0.605 0.548320    
polyIC:stress_type  2   1.09   0.544   0.689 0.505068    
Residuals          86  67.95   0.790                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
</div>
</div>
<section id="assumption-checks-for-viperin" class="level3">
<h3 class="anchored" data-anchor-id="assumption-checks-for-viperin">Assumption Checks for VIPERIN</h3>
<p><strong>QQ Plot (Quantile-Quantile Plot)</strong>: Tests normality assumption of residuals.</p>
<ul>
<li><strong>What to look for</strong>: Points should fall along the diagonal reference line</li>
<li><strong>Good fit</strong>: Points closely follow the line, indicating normally distributed residuals</li>
<li><strong>Violations</strong>: Systematic deviations (S-curves, heavy tails) suggest non-normality</li>
<li><strong>Minor deviations</strong> at the ends are usually acceptable</li>
</ul>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb110" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb110-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqPlot</span>(model_viperin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-viperin-qq-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 49  1</code></pre>
</div>
</div>
<p><strong>Levene’s Test</strong>: Tests homogeneity of variance (equal variances across groups).</p>
<ul>
<li><strong>Null hypothesis</strong>: Variances are equal across all treatment groups</li>
<li><strong>p-value &gt; 0.05</strong>: Variances are homogeneous (assumption met) ✓</li>
<li><strong>p-value ≤ 0.05</strong>: Variances differ significantly (assumption violated)</li>
</ul>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb112" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb112-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_viperin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb112-2">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>))</span>
<span id="cb112-3"></span>
<span id="cb112-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If significant effects found, run post-hoc tests</span></span>
<span id="cb112-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_viperin)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>]][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb112-6">  emm_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">emmeans</span>(model_viperin, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type)</span>
<span id="cb112-7">  pairs_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pairs</span>(emm_viperin)</span>
<span id="cb112-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(pairs_viperin)</span>
<span id="cb112-9">  </span>
<span id="cb112-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identify significant contrasts</span></span>
<span id="cb112-11">  pairs_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(pairs_viperin)</span>
<span id="cb112-12">  sig_contrasts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pairs_df[pairs_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, ]</span>
<span id="cb112-13">  </span>
<span id="cb112-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**VIPERIN - Pairwise Contrast Summary:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb112-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb112-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Significant contrasts (p ≤ 0.05):</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb112-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sig_contrasts)) {</span>
<span id="cb112-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>contrast[i], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sig_contrasts<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>p.value[i], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb112-19">    }</span>
<span id="cb112-20">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb112-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant pairwise contrasts found (all p &gt; 0.05).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb112-22">  }</span>
<span id="cb112-23">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb112-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No significant effects found; post-hoc tests not performed.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb112-25">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(&gt;F)
group  5  0.6136 0.6897
      86               
 contrast                                     estimate    SE df t.ratio p.value
 No_PolyIC Control - PolyIC Control             1.1827 0.372 86   3.181  0.0242
 No_PolyIC Control - No_PolyIC Mechanical       0.3096 0.281 86   1.101  0.8795
 No_PolyIC Control - PolyIC Mechanical          1.0839 0.487 86   2.226  0.2367
 No_PolyIC Control - No_PolyIC Temperature      0.1363 0.281 86   0.485  0.9966
 No_PolyIC Control - PolyIC Temperature         0.7747 0.281 86   2.756  0.0748
 PolyIC Control - No_PolyIC Mechanical         -0.8731 0.372 86  -2.348  0.1866
 PolyIC Control - PolyIC Mechanical            -0.0988 0.544 86  -0.182  1.0000
 PolyIC Control - No_PolyIC Temperature        -1.0464 0.372 86  -2.814  0.0647
 PolyIC Control - PolyIC Temperature           -0.4080 0.372 86  -1.097  0.8812
 No_PolyIC Mechanical - PolyIC Mechanical       0.7743 0.487 86   1.590  0.6071
 No_PolyIC Mechanical - No_PolyIC Temperature  -0.1733 0.281 86  -0.616  0.9896
 No_PolyIC Mechanical - PolyIC Temperature      0.4651 0.281 86   1.655  0.5651
 PolyIC Mechanical - No_PolyIC Temperature     -0.9476 0.487 86  -1.946  0.3817
 PolyIC Mechanical - PolyIC Temperature        -0.3092 0.487 86  -0.635  0.9880
 No_PolyIC Temperature - PolyIC Temperature     0.6384 0.281 86   2.271  0.2173

P value adjustment: tukey method for comparing a family of 6 estimates 

**VIPERIN - Pairwise Contrast Summary:**

Significant contrasts (p ≤ 0.05):
- No_PolyIC Control - PolyIC Control (p = 0.0242 )</code></pre>
</div>
</div>
</section>
<section id="viperin-anova-interpretation" class="level3">
<h3 class="anchored" data-anchor-id="viperin-anova-interpretation">VIPERIN ANOVA Interpretation</h3>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb114" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb114-1">anova_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(model_viperin)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb114-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix: Trim whitespace from rownames</span></span>
<span id="cb114-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(anova_results))</span>
<span id="cb114-4"></span>
<span id="cb114-5">levene_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leveneTest</span>(model_viperin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>residuals <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> polyIC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> stress_type, </span>
<span id="cb114-6">                              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Target <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span>))</span>
<span id="cb114-7"></span>
<span id="cb114-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**VIPERIN ANOVA Results:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This ANOVA evaluates whether PolyIC treatment and/or stress type affect VIPERIN expression (delta Cq).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-10"></span>
<span id="cb114-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Treatment Effects (ANOVA):**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-12"></span>
<span id="cb114-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb114-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb114-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-17">}</span>
<span id="cb114-18"></span>
<span id="cb114-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb114-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-21">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb114-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Stress type effect**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-23">}</span>
<span id="cb114-24"></span>
<span id="cb114-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb114-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: SIGNIFICANT (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → The effect of stress depends on PolyIC treatment status.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-28">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb114-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **PolyIC × Stress interaction**: Not significant (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(anova_results[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC:stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr(&gt;F)"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-30">}</span>
<span id="cb114-31"></span>
<span id="cb114-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">**Assumption Checks:**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-33"></span>
<span id="cb114-34">levene_p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> levene_results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Pr(&gt;F)</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb114-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(levene_p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) {</span>
<span id="cb114-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): PASSED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ✓</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances are equal across groups; ANOVA is appropriate.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb114-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- **Levene's Test** (homogeneity of variance): FAILED (p ="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(levene_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">") ⚠️</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  → Variances differ across groups; ANOVA results should be interpreted with caution.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb114-41">}</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>**VIPERIN ANOVA Results:**

This ANOVA evaluates whether PolyIC treatment and/or stress type affect VIPERIN expression (delta Cq).

**Treatment Effects (ANOVA):**

- **PolyIC effect**: SIGNIFICANT (p = 2e-04 )
- **Stress type effect**: Not significant (p = 0.5483 )
- **PolyIC × Stress interaction**: Not significant (p = 0.5051 )

**Assumption Checks:**

- **Levene's Test** (homogeneity of variance): PASSED (p = 0.6897 ) ✓
  → Variances are equal across groups; ANOVA is appropriate.</code></pre>
</div>
</div>
</section>
</section>
<section id="summary-plots" class="level2">
<h2 class="anchored" data-anchor-id="summary-plots">Summary Plots</h2>
<p>Visualize delta Cq values by treatment group for each target.</p>
<div class="cell" data-hold="true">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb116" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb116-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Generate Compact Letter Display (CLD) for each gene with significant effects</span></span>
<span id="cb116-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CLD shows which groups are significantly different: groups sharing a letter are NOT significantly different</span></span>
<span id="cb116-3"></span>
<span id="cb116-4">cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>()</span>
<span id="cb116-5"></span>
<span id="cb116-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATP Synthase</span></span>
<span id="cb116-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_atp"</span>)) {</span>
<span id="cb116-8">  cld_atp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_atp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb116-9">  cld_atp_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_atp)</span>
<span id="cb116-10">  cld_atp_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ATP.Synthase"</span></span>
<span id="cb116-11">  cld_atp_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_atp_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb116-12">  cld_atp_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cld_atp_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)]</span>
<span id="cb116-13">  cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(cld_annotations, cld_atp_df)</span>
<span id="cb116-14">}</span>
<span id="cb116-15"></span>
<span id="cb116-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP70</span></span>
<span id="cb116-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_hsp70"</span>)) {</span>
<span id="cb116-18">  cld_hsp70 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_hsp70, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb116-19">  cld_hsp70_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_hsp70)</span>
<span id="cb116-20">  cld_hsp70_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP70"</span></span>
<span id="cb116-21">  cld_hsp70_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_hsp70_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb116-22">  cld_hsp70_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cld_hsp70_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)]</span>
<span id="cb116-23">  cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(cld_annotations, cld_hsp70_df)</span>
<span id="cb116-24">}</span>
<span id="cb116-25"></span>
<span id="cb116-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HSP90</span></span>
<span id="cb116-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_hsp90"</span>)) {</span>
<span id="cb116-28">  cld_hsp90 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_hsp90, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb116-29">  cld_hsp90_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_hsp90)</span>
<span id="cb116-30">  cld_hsp90_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HSP90"</span></span>
<span id="cb116-31">  cld_hsp90_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_hsp90_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb116-32">  cld_hsp90_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cld_hsp90_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)]</span>
<span id="cb116-33">  cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(cld_annotations, cld_hsp90_df)</span>
<span id="cb116-34">}</span>
<span id="cb116-35"></span>
<span id="cb116-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VIPERIN</span></span>
<span id="cb116-37"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exists</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"emm_viperin"</span>)) {</span>
<span id="cb116-38">  cld_viperin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cld</span>(emm_viperin, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Letters =</span> letters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb116-39">  cld_viperin_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(cld_viperin)</span>
<span id="cb116-40">  cld_viperin_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Target <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIPERIN"</span></span>
<span id="cb116-41">  cld_viperin_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">trimws</span>(cld_viperin_df<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>.group)</span>
<span id="cb116-42">  cld_viperin_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cld_viperin_df[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>)]</span>
<span id="cb116-43">  cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(cld_annotations, cld_viperin_df)</span>
<span id="cb116-44">}</span>
<span id="cb116-45"></span>
<span id="cb116-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate y positions for annotations (above max values)</span></span>
<span id="cb116-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(cld_annotations) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb116-48">  y_positions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-49">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target, stress_type, polyIC) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-50">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb116-51">  </span>
<span id="cb116-52">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate data range for each gene to use proportional offset</span></span>
<span id="cb116-53">  y_range_per_gene <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-54">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Target) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-55">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_range =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb116-56">  </span>
<span id="cb116-57">  cld_annotations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cld_annotations <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-58">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_positions, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stress_type"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polyIC"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-59">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(y_range_per_gene, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Target"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_pos =</span> max_y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y_range <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 8% of data range above max</span></span>
<span id="cb116-61">}</span>
<span id="cb116-62"></span>
<span id="cb116-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create plot</span></span>
<span id="cb116-64">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> delta_Cq_df <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb116-65">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> delta_Cq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> polyIC)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-66">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">position_dodge</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-67">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">position_dodge</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>Target, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-69">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No_PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkgray"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"salmon"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-70">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expand =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expansion</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mult =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extra space at top for annotations</span></span>
<span id="cb116-71">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-73">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb116-74">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq by Treatment Group with ANOVA Significance"</span>,</span>
<span id="cb116-75">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stress Type"</span>,</span>
<span id="cb116-76">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Delta Cq"</span>,</span>
<span id="cb116-77">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PolyIC Treatment"</span></span>
<span id="cb116-78">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-79">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb116-80">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">angle =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb116-81">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bottom"</span></span>
<span id="cb116-82">  )</span>
<span id="cb116-83"></span>
<span id="cb116-84"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add CLD annotations if any exist</span></span>
<span id="cb116-85"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(cld_annotations) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb116-86">  p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb116-87">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> cld_annotations, </span>
<span id="cb116-88">              <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> stress_type, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_pos, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> polyIC),</span>
<span id="cb116-89">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">position_dodge</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb116-90">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"darkorange"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fontface =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb116-91">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subtitle =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Letters show statistical groupings (p ≤ 0.05). Groups sharing a letter are NOT significantly different from each other"</span>,</span>
<span id="cb116-92">         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Compact Letter Display shown for: ATP Synthase, HSP70, HSP90, and VIPERIN. See individual ANOVA sections for detailed p-values."</span>)</span>
<span id="cb116-93">}</span>
<span id="cb116-94"></span>
<span id="cb116-95"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(p)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/index_files/figure-html/anova-summary-plots-1.png" class="img-fluid figure-img" width="1152"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="summary" class="level1">
<h1>SUMMARY</h1>
<p>This analysis examined gene expression responses in <em>Magallana gigas</em> to PolyIC treatment (an immune stimulant mimicking viral dsRNA) and different stress types (Temperature, Mechanical, Control) using qPCR. Eight genes were analyzed: ATP Synthase, Citrate Synthase, DNMT1, HSP70, HSP90, cGAS, and VIPERIN. Expression levels were normalized to GAPDH and analyzed using two-way ANOVA (PolyIC × Stress Type) with post-hoc pairwise comparisons.</p>
<section id="gene-specific-results" class="level2">
<h2 class="anchored" data-anchor-id="gene-specific-results">Gene-Specific Results</h2>
<section id="atp-synthase-1" class="level3">
<h3 class="anchored" data-anchor-id="atp-synthase-1">ATP Synthase</h3>
<p><strong>Function:</strong> Mitochondrial enzyme synthesizing ATP; marker of energy metabolism.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> SIGNIFICANT (p = 7.33e-06) *<strong> - </strong>Stress type effect:** SIGNIFICANT (p = 0.04) * - <strong>PolyIC × Stress interaction:</strong> Not significant (p = 0.47)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> FAILED (p = 0.0036) - variances are not homogeneous across groups ⚠️</p>
<p><strong>Significant Pairwise Contrasts (p ≤ 0.05):</strong> - No_PolyIC Control vs PolyIC Mechanical (p = 0.007) - No_PolyIC Control vs PolyIC Temperature (p = 0.0001) - No_PolyIC Mechanical vs PolyIC Temperature (p = 0.0195) - No_PolyIC Temperature vs PolyIC Temperature (p = 0.0158)</p>
<p><strong>Key Findings:</strong> - PolyIC treatment significantly affects ATP Synthase expression - The “stress type effect” is driven primarily by <strong>PolyIC-treated samples under stress</strong> (all significant contrasts involve PolyIC groups) - No significant differences between non-PolyIC control and non-PolyIC stressed groups - Effects are additive rather than interactive (no interaction between PolyIC and stress) - PolyIC + Temperature shows the strongest effect (lowest p-value), followed by PolyIC + Mechanical - <strong>Caveat:</strong> Heterogeneous variances suggest results should be interpreted cautiously</p>
</section>
<section id="citrate-synthase-1" class="level3">
<h3 class="anchored" data-anchor-id="citrate-synthase-1">Citrate Synthase</h3>
<p><strong>Function:</strong> TCA cycle enzyme; marker of mitochondrial density and oxidative capacity.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> Not significant (p = 0.693) - <strong>Stress type effect:</strong> Marginally non-significant (p = 0.0688) - <strong>PolyIC × Stress interaction:</strong> Not significant (p = 0.464)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.956) ✓</p>
<p><strong>Key Findings:</strong> - Citrate Synthase expression is stable across PolyIC treatments - Stress type shows a trend toward significance (p = 0.0688) but does not reach the p ≤ 0.05 threshold - No significant pairwise contrasts detected (all p &gt; 0.05) - This near-significant trend without specific contrasts suggests subtle, distributed differences across stress types rather than a strong specific effect - Mitochondrial density/function appears relatively unaffected by these experimental conditions</p>
</section>
<section id="dnmt1-1" class="level3">
<h3 class="anchored" data-anchor-id="dnmt1-1">DNMT1</h3>
<p><strong>Function:</strong> DNA methyltransferase enzyme; maintains DNA methylation patterns and epigenetic regulation.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> Not significant (p = 0.193) - <strong>Stress type effect:</strong> Not significant (p = 0.179) - <strong>PolyIC × Stress interaction:</strong> Not significant (p = 0.399)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.617) ✓</p>
<p><strong>Key Findings:</strong> - DNMT1 expression does not respond significantly to PolyIC or stress treatments - DNA methylation machinery appears constitutively expressed under these conditions - No evidence of stress-induced epigenetic remodeling at the transcriptional level</p>
</section>
<section id="hsp70-1" class="level3">
<h3 class="anchored" data-anchor-id="hsp70-1">HSP70</h3>
<p><strong>Function:</strong> Molecular chaperone; critical for protein folding and cellular stress response.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> SIGNIFICANT (p = 5.7e-13) <em><strong> - </strong>Stress type effect:<strong> SIGNIFICANT (p &lt; 2e-16) </strong></em> - <strong>PolyIC × Stress interaction:</strong> Not significant (p = 0.831)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.745) ✓</p>
<p><strong>Significant Pairwise Contrasts (p ≤ 0.05):</strong> - No_PolyIC Control vs No_PolyIC Temperature (p &lt; 0.0001) - No_PolyIC Control vs PolyIC Temperature (p &lt; 0.0001) - PolyIC Control vs No_PolyIC Temperature (p &lt; 0.0001) - PolyIC Control vs PolyIC Temperature (p &lt; 0.0001) - No_PolyIC Mechanical vs No_PolyIC Temperature (p &lt; 0.0001) - No_PolyIC Mechanical vs PolyIC Temperature (p &lt; 0.0001) - PolyIC Mechanical vs No_PolyIC Temperature (p = 0.0017) - PolyIC Mechanical vs PolyIC Temperature (p &lt; 0.0001)</p>
<p><strong>Key Findings:</strong> - HSP70 shows extremely strong responses to both PolyIC and stress type - <strong>Temperature stress is the primary driver:</strong> All 8 significant contrasts involve temperature-stressed groups vs.&nbsp;non-temperature groups - Both PolyIC and non-PolyIC oysters show dramatic HSP70 upregulation under temperature stress compared to controls or mechanical stress - Mechanical stress does NOT significantly induce HSP70 (no significant Control vs Mechanical contrasts) - No interaction suggests PolyIC and temperature stress act independently (additive effects) - This is the classic heat shock protein response to thermal stress</p>
</section>
<section id="hsp90-1" class="level3">
<h3 class="anchored" data-anchor-id="hsp90-1">HSP90</h3>
<p><strong>Function:</strong> Molecular chaperone; regulates protein maturation and signaling networks.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> SIGNIFICANT (p = 5.47e-10) *<strong> - </strong>Stress type effect:<strong> Not significant (p = 0.476) - </strong>PolyIC × Stress interaction:** Not significant (p = 0.562)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.942) ✓</p>
<p><strong>Significant Pairwise Contrasts (p ≤ 0.05):</strong> - No_PolyIC Control vs PolyIC Temperature (p &lt; 0.0001) - No_PolyIC Mechanical vs PolyIC Temperature (p &lt; 0.0001) - No_PolyIC Temperature vs PolyIC Temperature (p &lt; 0.0001)</p>
<p><strong>Key Findings:</strong> - PolyIC has a highly significant main effect on HSP90 expression - Unlike HSP70, the overall stress type main effect is not significant - <strong>All three significant contrasts specifically involve PolyIC + Temperature:</strong> - PolyIC Temperature differs from all three non-PolyIC groups (Control, Mechanical, Temperature) - No other treatment combinations show significant differences - The pattern shows <strong>PolyIC + Temperature creates a synergistic-like response</strong> despite the non-significant interaction term (possibly due to sample size/power) - PolyIC alone (control), temperature alone, and mechanical stress (with/without PolyIC) do NOT significantly induce HSP90 - HSP90 appears to require the combination of immune stimulation (PolyIC) AND thermal stress</p>
</section>
<section id="cgas-1" class="level3">
<h3 class="anchored" data-anchor-id="cgas-1">cGAS</h3>
<p><strong>Function:</strong> Cytosolic DNA sensor; involved in innate immune response and dsRNA detection.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> Not significant (p = 0.749) - <strong>Stress type effect:</strong> Not significant (p = 0.168) - <strong>PolyIC × Stress interaction:</strong> Not significant (p = 0.831)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.564) ✓</p>
<p><strong>Key Findings:</strong> - cGAS does not respond significantly to PolyIC treatment - No significant response to stress type either - This is unexpected given cGAS’s role in detecting foreign nucleic acids - May suggest: (1) different immune sensing pathways activated, (2) timing issues (response may occur earlier/later), or (3) PolyIC recognition occurs through alternative receptors in oysters</p>
</section>
<section id="viperin-1" class="level3">
<h3 class="anchored" data-anchor-id="viperin-1">VIPERIN</h3>
<p><strong>Function:</strong> Antiviral effector protein; restricts replication of DNA and RNA viruses.</p>
<p><strong>ANOVA Results:</strong> - <strong>PolyIC effect:</strong> SIGNIFICANT (p = 0.000165) *<strong> - </strong>Stress type effect:<strong> Not significant (p = 0.548) - </strong>PolyIC × Stress interaction:** Not significant (p = 0.505)</p>
<p><strong>Assumption Checks:</strong> - <strong>Levene’s Test:</strong> PASSED (p = 0.690) ✓</p>
<p><strong>Significant Pairwise Contrasts (p ≤ 0.05):</strong> - No_PolyIC Control vs PolyIC Control (p = 0.0242)</p>
<p><strong>Key Findings:</strong> - VIPERIN shows a clear response to PolyIC treatment as an immune stimulant - The only significant contrast is <strong>No_PolyIC Control vs PolyIC Control</strong> (p = 0.024) - <strong>PolyIC alone is sufficient to induce VIPERIN expression</strong> - no additional stress needed - Notably, PolyIC + stress combinations (mechanical/temperature) are NOT significantly different from PolyIC control - This indicates the VIPERIN response is triggered by PolyIC recognition itself, independent of other stressors - Stress type (temperature/mechanical) does not enhance or suppress the PolyIC-induced VIPERIN response - As an antiviral effector, VIPERIN appropriately recognizes PolyIC as a viral mimic</p>
</section>
</section>
</section>
<section id="r-session-info" class="level1">
<h1>R SESSION INFO</h1>
<div class="cell">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb117" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb117-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sessionInfo</span>()</span></code></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>R version 4.5.2 (2025-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Los_Angeles
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] multcomp_1.4-29 TH.data_1.1-5   MASS_7.3-65     survival_3.8-6 
 [5] mvtnorm_1.3-3   emmeans_2.0.1   car_3.1-3       carData_3.0-6  
 [9] lubridate_1.9.4 forcats_1.0.0   stringr_1.5.1   dplyr_1.1.4    
[13] purrr_1.0.4     readr_2.1.5     tidyr_1.3.1     tibble_3.2.1   
[17] ggplot2_3.5.2   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] utf8_1.2.4          sandwich_3.1-1      generics_0.1.3     
 [4] stringi_1.8.7       lattice_0.22-7      hms_1.1.3          
 [7] digest_0.6.37       magrittr_2.0.3      evaluate_1.0.3     
[10] grid_4.5.2          timechange_0.3.0    estimability_1.5.1 
[13] RColorBrewer_1.1-3  fastmap_1.2.0       Matrix_1.7-4       
[16] jsonlite_2.0.0      Formula_1.2-5       scales_1.4.0       
[19] codetools_0.2-20    abind_1.4-8         cli_3.6.5          
[22] rlang_1.1.6         splines_4.5.2       withr_3.0.2        
[25] yaml_2.3.10         multcompView_0.1-10 tools_4.5.2        
[28] tzdb_0.5.0          vctrs_0.6.5         R6_2.6.1           
[31] zoo_1.8-15          lifecycle_1.0.4     htmlwidgets_1.6.4  
[34] pkgconfig_2.0.3     pillar_1.10.2       gtable_0.3.6       
[37] glue_1.8.0          xfun_0.52           tidyselect_1.2.1   
[40] knitr_1.50          xtable_1.8-4        farver_2.1.2       
[43] htmltools_0.5.8.1   labeling_0.4.3      rmarkdown_2.29     
[46] compiler_4.5.2     </code></pre>
</div>
</div>


</section>

 ]]></description>
  <category>2026</category>
  <category>qPCR</category>
  <category>Pacific oyster</category>
  <category>Magallana gigas</category>
  <category>Crassostrea gigas</category>
  <category>polyIC</category>
  <category>HSP70</category>
  <category>HSP90</category>
  <category>cGAS</category>
  <category>VIPERIN</category>
  <category>ATP Synthase</category>
  <category>Citrate Synthase</category>
  <category>DNMT1</category>
  <category>GAPDH</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-02-02-qPCR-Analysis---M.gigas-PolyIC-Data-from-Valentinas-Project/</guid>
  <pubDate>Mon, 02 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>qPCR - M.gigas Valentina PolyIC VIPERIN</title>
  <dc:creator>Sam White</dc:creator>
  <link>https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/</link>
  <description><![CDATA[ 





<section id="intro" class="level1">
<h1>INTRO</h1>
<p>Continuing work with Valentina’s PolyIC project after <a href="../../../posts/2025/2025-10-19-Reverse-Transcription---C.gigas-PolyIC-Mechanical-Trials-RNA-for-Valentina-from-20251002/index.html">creating cDNA on 20251019</a> (Notebook entry), it was time to run the qPCRs.</p>
<p>This notebook describes how the qPCRs were run and links to the various output files. It also provides a brief overview of each primer set’s amplification profiles. This notebook does <em>not</em> have any analysis. This will be performed later.</p>
</section>
<section id="materials-methods" class="level1">
<h1>MATERIALS &amp; METHODS</h1>
<p>The following primer sets were run:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>SR ID</th>
<th>Primer Name</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1829</td>
<td>Cg_VIPERIN_F</td>
</tr>
<tr class="even">
<td>1828</td>
<td>Cg_VIPERIN_R</td>
</tr>
</tbody>
</table>
<p>All samples were run in triplicate, on low-profile, white 96-well plates (USA Scientific) sealed with TemPlate TR Select Optical Film (USA Scientific) in a CFX Connect (Bio-Rad) or CFX96 (Bio-Rad) real-time thermalcycler. All reactions consisted of the following:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 60%">
<col style="width: 24%">
<col style="width: 15%">
</colgroup>
<thead>
<tr class="header">
<th>Component</th>
<th>Stock Concentration</th>
<th>Volume (uL)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>cDNA</td>
<td>NA</td>
<td>1</td>
</tr>
<tr class="even">
<td>SsoAdvanced Universal SYBR Green Supermix (BioRad)</td>
<td>2x</td>
<td>10</td>
</tr>
<tr class="odd">
<td>P<sub>F</sub></td>
<td>10uM</td>
<td>0.5</td>
</tr>
<tr class="even">
<td>P<sub>R</sub></td>
<td>10uM</td>
<td>0.5</td>
</tr>
<tr class="odd">
<td>H<sub>2</sub>O</td>
<td>NA</td>
<td>8</td>
</tr>
<tr class="even">
<td>TOTAL</td>
<td></td>
<td>20</td>
</tr>
</tbody>
</table>
<p>Master mixes were distributed across three plates for each primer set and included no template controls (NTCs).</p>
<p>For cycling parameters, plate layouts, etc. see the RESULTS section below.</p>
</section>
<section id="results" class="level1">
<h1>RESULTS</h1>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>There were a number of samples which ran out or cDNA volume during the qPCR setup. So, not all samples have three replicates. These are noted in the plate layouts in the PDF reports linked below.</p>
<p>These missing samples were removed from the qPCR analysis, so that’s why those wells are missing the Cq results files.</p>
</div>
</div>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<ul>
<li><code>VIPERIN</code>: Amplification and melt plots across all three plates.</li>
</ul>
</section>
<section id="files" class="level2">
<h2 class="anchored" data-anchor-id="files">Files</h2>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Tip
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><p><code>report-*.pdf</code>: qPCR Reports. Contains plate layouts, cycling params, amp/melt plots, etc.</p></li>
<li><p><code>*Cq_Results.csv</code>: Cycle quantity (Cq) data.</p></li>
<li><p><code>*.pcrd</code>: Source qPCR data file. Requires CFX Maestro (Bio-Rad) software to open.</p></li>
</ul>
</div>
</div>
<section id="viperin" class="level3">
<h3 class="anchored" data-anchor-id="viperin">VIPERIN</h3>
<section id="plate-01" class="level4">
<h4 class="anchored" data-anchor-id="plate-01">Plate 01</h4>
<section id="cq-data" class="level5">
<h5 class="anchored" data-anchor-id="cq-data">Cq Data</h5>
<ul>
<li><a href="./sam_2026-01-29_07-21-16_Connect-VIPERIN-01-QuantificationCq_Results.csv">sam_2026-01-29_07-21-16_Connect-VIPERIN-01-QuantificationCq_Results.csv</a></li>
</ul>
</section>
<section id="report" class="level5">
<h5 class="anchored" data-anchor-id="report">Report</h5>
<ul>
<li><a href="./report-sam_2026-01-29_07-21-16_Connect-VIPERIN-01.pdf">report-sam_2026-01-29_07-21-16_Connect-VIPERIN-01.pdf</a></li>
</ul>
</section>
<section id="cfx-file" class="level5">
<h5 class="anchored" data-anchor-id="cfx-file">CFX File</h5>
<ul>
<li><a href="./sam_2026-01-29_07-21-16_Connect-VIPERIN-01.pcrd">sam_2026-01-29_07-21-16_Connect-VIPERIN-01.pcrd</a></li>
</ul>
</section>
</section>
<section id="plate-02" class="level4">
<h4 class="anchored" data-anchor-id="plate-02">Plate 02</h4>
<section id="cq-data-1" class="level5">
<h5 class="anchored" data-anchor-id="cq-data-1">Cq Data</h5>
<ul>
<li><a href="./sam_2026-01-29_07-39-06_CFX96-VIPERIN-02-Quantification-Cq_Results.csv">sam_2026-01-29_07-39-06_CFX96-VIPERIN-02-Quantification-Cq_Results.csv</a></li>
</ul>
</section>
<section id="report-1" class="level5">
<h5 class="anchored" data-anchor-id="report-1">Report</h5>
<ul>
<li><a href="./report-sam_2026-01-29_07-39-06_CFX96-VIPERIN-02.pdf">report-sam_2026-01-29_07-39-06_CFX96-VIPERIN-02.pdf</a></li>
</ul>
</section>
<section id="cfx-file-1" class="level5">
<h5 class="anchored" data-anchor-id="cfx-file-1">CFX File</h5>
<ul>
<li><a href="./sam_2026-01-29_07-39-06_CFX96-VIPERIN-02.pcrd">sam_2026-01-29_07-39-06_CFX96-VIPERIN-02.pcrd</a></li>
</ul>
</section>
</section>
<section id="plate-03" class="level4">
<h4 class="anchored" data-anchor-id="plate-03">Plate 03</h4>
<section id="cq-data-2" class="level5">
<h5 class="anchored" data-anchor-id="cq-data-2">Cq Data</h5>
<ul>
<li><a href="./sam_2026-01-29_08-24-59_Connect-VIPERIN-03-QuantificationCq_Results.csv">sam_2026-01-29_08-24-59_Connect-VIPERIN-03-QuantificationCq_Results.csv</a></li>
</ul>
</section>
<section id="report-2" class="level5">
<h5 class="anchored" data-anchor-id="report-2">Report</h5>
<ul>
<li><a href="./report-sam_2026-01-29_08-24-59_Connect-VIPERIN-03.pdf">report-sam_2026-01-29_08-24-59_Connect-VIPERIN-03.pdf</a></li>
</ul>
</section>
<section id="cfx-file-2" class="level5">
<h5 class="anchored" data-anchor-id="cfx-file-2">CFX File</h5>
<ul>
<li><a href="./sam_2026-01-29_08-24-59_Connect-VIPERIN-03.pcrd">sam_2026-01-29_08-24-59_Connect-VIPERIN-03.pcrd</a></li>
</ul>
<hr>
</section>
</section>
</section>
</section>
<section id="plots" class="level2">
<h2 class="anchored" data-anchor-id="plots">Plots</h2>
<div id="fig-VIPERIN" class="quarto-layout-panel">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-VIPERIN-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="quarto-layout-row">
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_amp_01" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_amp_01-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-amp-plots-plate-01.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_amp_01-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(a) VIPERIN Plate 01 Amplification
</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_melt_01" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_melt_01-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-melt-plots-plate-01.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_melt_01-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(b) VIPERIN Plate 01 Melt
</figcaption>
</figure>
</div>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_amp_02" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_amp_02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-amp-plots-plate-02.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_amp_02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(c) VIPERIN Plate 02 Amplification
</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_melt_02" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_melt_02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-melt-plots-plate-02.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_melt_02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(d) VIPERIN Plate 02 Melt
</figcaption>
</figure>
</div>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_amp_03" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_amp_03-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-amp-plots-plate-03.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_amp_03-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(e) VIPERIN Plate 03 Amplification
</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell-subref quarto-layout-cell" data-ref-parent="fig-VIPERIN" style="flex-basis: 50.0%;justify-content: flex-start;">
<div id="fig-VIPERIN_melt_03" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-subfloat-fig figure">
<div aria-describedby="fig-VIPERIN_melt_03-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/VIPERIN-melt-plots-plate-03.png" class="img-fluid figure-img" data-ref-parent="fig-VIPERIN">
</div>
<figcaption class="quarto-float-caption-bottom quarto-subfloat-caption quarto-subfloat-fig" id="fig-VIPERIN_melt_03-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
(f) VIPERIN Plate 03 Melt
</figcaption>
</figure>
</div>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-VIPERIN-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: VIPERIN qPCR plots for all three plates.
</figcaption>
</figure>
</div>


</section>
</section>

 ]]></description>
  <category>2026</category>
  <category>Magallana gigas</category>
  <category>Crassostrea gigas</category>
  <category>Pacific oyster</category>
  <category>qPCR</category>
  <category>PolyIC</category>
  <category>VIPERIN</category>
  <category>SsoFast</category>
  <category>CFX Connect</category>
  <category>CFX96</category>
  <guid>https://robertslab.github.io/sams-notebook/posts/2026/2026-01-29-qPCR---M.gigas-Valentina-PolyIC-VIPERIN/</guid>
  <pubDate>Thu, 29 Jan 2026 08:00:00 GMT</pubDate>
</item>
</channel>
</rss>
