-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoReport.html
569 lines (541 loc) · 37.3 KB
/
DemoReport.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.2.335">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Solomon Chak">
<meta name="dcterms.date" content="2023-04-26">
<title>Demo Report</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script src="DemoReport_files/libs/clipboard/clipboard.min.js"></script>
<script src="DemoReport_files/libs/quarto-html/quarto.js"></script>
<script src="DemoReport_files/libs/quarto-html/popper.min.js"></script>
<script src="DemoReport_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="DemoReport_files/libs/quarto-html/anchor.min.js"></script>
<link href="DemoReport_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="DemoReport_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="DemoReport_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="DemoReport_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="DemoReport_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
</head>
<body>
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#introduction" id="toc-introduction" class="nav-link active" data-scroll-target="#introduction"><span class="toc-section-number">1</span> Introduction</a></li>
<li><a href="#methods-results" id="toc-methods-results" class="nav-link" data-scroll-target="#methods-results"><span class="toc-section-number">2</span> Methods & Results</a>
<ul class="collapse">
<li><a href="#differential-expressed-transcripts" id="toc-differential-expressed-transcripts" class="nav-link" data-scroll-target="#differential-expressed-transcripts"><span class="toc-section-number">2.1</span> Differential expressed transcripts</a></li>
<li><a href="#transcribed-transposable-elements" id="toc-transcribed-transposable-elements" class="nav-link" data-scroll-target="#transcribed-transposable-elements"><span class="toc-section-number">2.2</span> Transcribed transposable elements</a></li>
<li><a href="#are-there-more-tes-in-differentially-expressed-transcripts" id="toc-are-there-more-tes-in-differentially-expressed-transcripts" class="nav-link" data-scroll-target="#are-there-more-tes-in-differentially-expressed-transcripts"><span class="toc-section-number">2.3</span> Are there more TEs in differentially expressed transcripts?</a></li>
</ul></li>
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion"><span class="toc-section-number">3</span> Conclusion</a></li>
<li><a href="#grading-rubric" id="toc-grading-rubric" class="nav-link" data-scroll-target="#grading-rubric"><span class="toc-section-number">4</span> Grading rubric</a></li>
</ul>
</nav>
</div>
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Demo Report</h1>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-contents">
<p>Solomon Chak </p>
</div>
</div>
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">April 26, 2023</p>
</div>
</div>
</div>
</header>
<p>You can download (right-click & save as) a copy of the .qmd <a href="https://raw.githubusercontent.com/solomonchak/R_Intro/e19fd875f25bfaa276c09545d07f3d1d273539a8/DemoReport.qmd">here</a> that generated this page and use it as a template for your report. Your report should be “firstname_report.qmd”. It’ll be converted to “firstname_report.html” when you have rendered it.</p>
<section id="introduction" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Introduction</h1>
<p>See <a href="https://solomonchak.github.io/R_Intro/Project_Day1.html">here</a> for the background of the project.</p>
<p>Here, we hypothesize that TEs are contributing to the differentiation between queens and workers in eusocial shrimps. We expect to find more TEs in differentially expressed (DE) genes than in non-DE genes.</p>
<div class="callout-important callout callout-style-simple no-icon callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Modify and include this paragraph in your report:
</div>
</div>
<div class="callout-body-container callout-body">
<p>We expect … [describe the patterns in the data that would support the hypothesis.]</p>
<p>Apart from the contribution of all TEs, we will also test whether [your assigned TE] has a significant contribution to worker-queen differentiation. [Add 1-2 sentences about your assigned TE based on a <a href="https://scholar.google.com/">scholar search</a> and add the proper in-text citation with a link to the publication.]</p>
</div>
</div>
</section>
<section id="methods-results" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Methods & Results</h1>
<p>From the eusocial shrimp <em>Synalpheus elizabethae</em>, we obtained RNA-seq data from three queens and three workers. The transcriptome is assembled with Trinity (<a href="https://www.nature.com/articles/nprot.2013.084">Haas et al. 2013</a>) and transposable elements were identified with Repeat Masker (<a href="https://currentprotocols.onlinelibrary.wiley.com/doi/10.1002/0471250953.bi0410s25">Tarailo-Graovac and Chen 2009</a>). We performed differential gene expression analysis using Galaxy (<a href="https://currentprotocols.onlinelibrary.wiley.com/doi/abs/10.1002/0471142727.mb1910s89">Blankenberg et al. 2010</a>) and DESeq2 (<a href="https://genomebiology.biomedcentral.com/articles/10.1186/s13059-014-0550-8?ref=https://githubhelp.com">Love et al. 2014</a>). All statistical analyses were performed in R and detailed below.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"tidyr"</span>)</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"dplyr"</span>)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"ggpubr"</span>)</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"stringr"</span>)</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"plyr"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<section id="differential-expressed-transcripts" class="level2" data-number="2.1">
<h2 data-number="2.1" class="anchored" data-anchor-id="differential-expressed-transcripts"><span class="header-section-number">2.1</span> Differential expressed transcripts</h2>
<p>Among 29,833 transcripts that were shared among the six samples, 122 are up regulated and 141 are down regulated.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Read Galaxy output</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>df <span class="ot">=</span> <span class="fu">read.delim</span>(<span class="at">file =</span> <span class="st">"input.matrix.Q_vs_W.DESeq2.txt"</span>, <span class="at">row.names =</span> <span class="cn">NULL</span>)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="co"># rename the first column</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">names</span>(df)[<span class="dv">1</span>] <span class="ot">=</span> <span class="st">"seqid"</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Report nrow</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="fu">paste</span>(<span class="st">"Number of total transcript = "</span>, <span class="fu">nrow</span>(df)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Number of total transcript = 29833"</code></pre>
</div>
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co"># MA plot</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggmaplot</span>(df, <span class="at">size =</span> <span class="fl">0.5</span>) </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="DemoReport_files/figure-html/unnamed-chunk-2-1.png" class="img-fluid" width="672"></p>
</div>
</div>
</section>
<section id="transcribed-transposable-elements" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="transcribed-transposable-elements"><span class="header-section-number">2.2</span> Transcribed transposable elements</h2>
<p>From the transcriptome, 8,970 transcripts contained transposable elements. The more abundant TE class was DNA transposons, followed by LTR and LINE, with SINE being the least abundant.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Load results from Repeat Masker</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>df_transcript_te <span class="ot">=</span> <span class="fu">read.table</span>(<span class="st">"Elizabethae_Assembly_Trinity.fasta.out"</span>, <span class="at">header =</span> F, <span class="at">skip =</span> <span class="dv">3</span>, <span class="at">fill =</span> T ,<span class="at">col.names =</span> <span class="fu">c</span>(<span class="st">"SW_score"</span>, <span class="st">"perc_div"</span>, <span class="st">"perc_del"</span>, <span class="st">"perc_inc"</span>, <span class="st">"seqid"</span>, <span class="st">"start"</span>, <span class="st">"end"</span>, <span class="st">"left"</span>, <span class="st">"strand"</span>,<span class="st">"repeat"</span>, <span class="st">"TE_class_family"</span>, <span class="st">"TE_start"</span>, <span class="st">"TE_end"</span>, <span class="st">"TE_left"</span>, <span class="st">"ID"</span>, <span class="st">"duplicate"</span>), )</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Some columns have numbers in () that needs to be removed.</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>df_transcript_te<span class="sc">$</span>left <span class="ot">=</span> <span class="fu">gsub</span>(<span class="st">"[()]"</span>,<span class="st">""</span>,df_transcript_te<span class="sc">$</span>left)</span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>df_transcript_te<span class="sc">$</span>TE_start <span class="ot">=</span> <span class="fu">gsub</span>(<span class="st">"[()]"</span>,<span class="st">""</span>,df_transcript_te<span class="sc">$</span>TE_start)</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a>df_transcript_te<span class="sc">$</span>TE_left <span class="ot">=</span> <span class="fu">gsub</span>(<span class="st">"[()]"</span>,<span class="st">""</span>,df_transcript_te<span class="sc">$</span>TE_left)</span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Remove duplicates generated by Repeat Masker</span></span>
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a>df_transcript_te <span class="ot">=</span> <span class="fu">filter</span>(df_transcript_te, <span class="sc">!</span>duplicate<span class="sc">==</span><span class="st">"*"</span>)</span>
<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a><span class="co"># Keep first entry for each seqid</span></span>
<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a>df_transcript_te <span class="ot">=</span> <span class="fu">group_modify</span>((<span class="fu">group_by</span>(df_transcript_te, seqid)), <span class="sc">~</span>.x[<span class="dv">1</span>,])</span>
<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a><span class="co"># Get TE_class & TE_family from TE_class_family</span></span>
<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a>df_transcript_te<span class="sc">$</span>TE_class <span class="ot">=</span> <span class="fu">str_split</span>(df_transcript_te<span class="sc">$</span>TE_class_family, <span class="st">"/"</span>, <span class="at">simplify=</span> T)[,<span class="dv">1</span>] </span>
<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a>df_transcript_te<span class="sc">$</span>TE_family <span class="ot">=</span> <span class="fu">str_split</span>(df_transcript_te<span class="sc">$</span>TE_class_family, <span class="st">"/"</span>, <span class="at">simplify=</span> T)[,<span class="dv">2</span>] </span>
<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a><span class="co"># Keep only the four major classes of TE (DNA, LINE, LTR and SINE).</span></span>
<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a>df_transcript_te <span class="ot">=</span> <span class="fu">filter</span>(df_transcript_te, TE_class<span class="sc">%in%</span><span class="fu">c</span>(<span class="st">"DNA"</span>, <span class="st">"LINE"</span>, <span class="st">"LTR"</span>, <span class="st">"SINE"</span>))</span>
<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a><span class="co"># Calculate TE length</span></span>
<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a>df_transcript_te <span class="ot">=</span> <span class="fu">mutate</span>(df_transcript_te, <span class="at">TE_length =</span> <span class="fu">abs</span>(end <span class="sc">-</span> start)<span class="sc">+</span><span class="dv">1</span>)</span>
<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a><span class="co"># Report nrow</span></span>
<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="fu">paste</span>(<span class="st">"Number of TEs identified = "</span>, <span class="fu">nrow</span>(df_transcript_te)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Number of TEs identified = 8970"</code></pre>
</div>
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Plot TE distribution</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(df_transcript_te, <span class="fu">aes</span>(TE_class)) <span class="sc">+</span> </span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_bar</span>() <span class="sc">+</span> </span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">coord_flip</span>() <span class="sc">+</span> </span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_bw</span>(<span class="at">base_size=</span><span class="dv">14</span>) <span class="sc">+</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">y =</span> <span class="st">"TE Class"</span>, <span class="at">x =</span> <span class="st">"Count"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="DemoReport_files/figure-html/unnamed-chunk-3-1.png" class="img-fluid" width="672"></p>
</div>
</div>
<div class="callout-important callout callout-style-simple no-icon callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Your Report
</div>
</div>
<div class="callout-body-container callout-body">
<p>Your report should skip 2.1 and 2.2 and begin with prediction 2, and then prediction 3. Use a section header that is informative (i.e., don’t use “Prediction 2” as the title).</p>
<p>However, for Quarto to run, you still need to include all the code chunks from above. Modify the line<br>
{r}</p>
<p>to be (***type this, do not copy! the '' will be messed up when you copy&paste)<br>
{r, echo=FALSE, warning=FALSE, message=FALSE, fig.show=‘hide’, results=‘hide’}</p>
<p>so that it will run behind the scene but not display the results or figures.</p>
</div>
</div>
</section>
<section id="are-there-more-tes-in-differentially-expressed-transcripts" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="are-there-more-tes-in-differentially-expressed-transcripts"><span class="header-section-number">2.3</span> Are there more TEs in differentially expressed transcripts?</h2>
<p>If TEs are contributing to the evolution of the worker-queen differentiation, we expect to find more TEs in differentially expressed (DE) genes than in non-DE genes. Therefore, we performed a Chi-sqared test of independence on the binomial predictor variable DE (DE vs. NS, for differentially expressed vs. non-significant) against the response variable TE (TE vs. not, for having TE vs. not).</p>
<p>The results showed that the variables DE and TE are independent (Chi-squared = 2.160, d.f. = 1, p = 0.142). This means that the proportions of transcripts having TEs or not are not statistically different between transcripts that are and are not differentially expressed between queens and workers</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Combine the df and df_transcript_te data sets</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>df_tranTE <span class="ot">=</span> <span class="fu">left_join</span>(df, df_transcript_te, <span class="st">"seqid"</span>)</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Create DE and TE columns</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>df_tranTE <span class="ot">=</span> <span class="fu">mutate</span>(df_tranTE, </span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="at">DE =</span> <span class="fu">case_when</span>(padj <span class="sc"><</span> <span class="fl">0.05</span> <span class="sc">~</span> <span class="st">'DE'</span>, </span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> padj <span class="sc">>=</span> <span class="fl">0.05</span> <span class="sc">~</span> <span class="st">'NS'</span>),</span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> <span class="at">TE =</span> <span class="fu">case_when</span>(TE_class <span class="sc">%in%</span> <span class="fu">c</span>(<span class="st">"DNA"</span>, </span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> <span class="st">"LTR"</span>, </span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a> <span class="st">"LINE"</span>, </span>
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a> <span class="st">"SINE"</span>) <span class="sc">~</span> <span class="st">'TE'</span>,</span>
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a> <span class="at">.default =</span> <span class="st">'Not'</span>)</span>
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-15"><a href="#cb8-15" aria-hidden="true" tabindex="-1"></a><span class="co"># Chi-squared test</span></span>
<span id="cb8-16"><a href="#cb8-16" aria-hidden="true" tabindex="-1"></a><span class="fu">chisq.test</span>(<span class="fu">table</span>(df_tranTE<span class="sc">$</span>TE, df_tranTE<span class="sc">$</span>DE))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>
Pearson's Chi-squared test with Yates' continuity correction
data: table(df_tranTE$TE, df_tranTE$DE)
X-squared = 2.1595, df = 1, p-value = 0.1417</code></pre>
</div>
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Plot </span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(<span class="at">data =</span> df_tranTE, <span class="fu">aes</span>(<span class="at">x =</span> TE, <span class="at">fill =</span> TE)) <span class="sc">+</span> </span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_bar</span>() <span class="sc">+</span> </span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">facet_grid</span>(DE<span class="sc">~</span>., <span class="at">scales =</span> <span class="st">"free_y"</span>) <span class="sc">+</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">"Transposable Elements"</span>, <span class="at">y =</span> <span class="st">"Count"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="DemoReport_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid" width="672"></p>
</div>
</div>
<p>Further, we tested and showed that TE class (DNA, LTR, LINE, and SINE) did not affect the variable DE (Chi-squared = 1.204, d.f. = 3, p = 0.752).</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">chisq.test</span>(<span class="fu">with</span>(df_tranTE, <span class="fu">table</span>(TE_class, DE)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning in chisq.test(with(df_tranTE, table(TE_class, DE))): Chi-squared
approximation may be incorrect</code></pre>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Pearson's Chi-squared test
data: with(df_tranTE, table(TE_class, DE))
X-squared = 1.2042, df = 3, p-value = 0.752</code></pre>
</div>
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(<span class="at">data =</span> df_tranTE, <span class="fu">aes</span>(<span class="at">x =</span> DE)) <span class="sc">+</span> </span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_bar</span>() <span class="sc">+</span> </span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">facet_wrap</span>(<span class="sc">~</span>TE_class, <span class="at">scales =</span> <span class="st">"free_y"</span>) <span class="sc">+</span></span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">""</span>, <span class="at">y =</span> <span class="st">"Count"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="DemoReport_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid" width="672"></p>
</div>
</div>
</section>
</section>
<section id="conclusion" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Conclusion</h1>
<p>In summary, we found that transcripts that have TEs are not more differentially expressed. Also, the class of TE does not affect whether a transcribe is differentially expressed. These results do not support the hypothesis that TEs are contributing to the evolution of the worker-queen differentiation.</p>
<p>Although the results did not support the conclusion, the dichotomous classification of transcripts into merely differentially expressed or not may conceal important pattern in the strength of differential expression. Further analysis should consider using a continuous variable based on the fold change of differential expression.</p>
<div class="callout-important callout callout-style-simple no-icon callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Your conclusion
</div>
</div>
<div class="callout-body-container callout-body">
<p>Your conclusion should briefly summarize the results from predictions 2 and 3. There is no need to report statistics here. Most importantly, you should relate your results to the hypothesis.</p>
<p>Include a brief discussion of unexpected results or discrepancy between results.</p>
</div>
</div>
</section>
<section id="grading-rubric" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Grading rubric</h1>
<div class="callout-note callout callout-style-simple 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>Total = 150 points.</p>
<table class="table">
<colgroup>
<col style="width: 38%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th style="text-align: center;">Excellent</th>
<th style="text-align: center;">Accetpable</th>
<th style="text-align: center;">Does not meet expectation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Introduction: Expected pattern</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">1</td>
</tr>
<tr class="even">
<td>Introduction: TE background</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">3</td>
</tr>
<tr class="odd">
<td>Prediction 1</td>
<td style="text-align: center;">40</td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">10</td>
</tr>
<tr class="even">
<td>Prediction 2</td>
<td style="text-align: center;">40</td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">10</td>
</tr>
<tr class="odd">
<td>Interpretation of p values</td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">5</td>
</tr>
<tr class="even">
<td>Relating results to hypothesis</td>
<td style="text-align: center;">20</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">5</td>
</tr>
<tr class="odd">
<td>Discussion</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">3</td>
</tr>
<tr class="even">
<td>Clear annotation of codes, grammar and clarity of texts</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">1</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</main>
<!-- /main column -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const clipboard = new window.ClipboardJS('.code-copy-button', {
target: function(trigger) {
return trigger.previousElementSibling;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
const findCites = (el) => {
const parentEl = el.parentElement;
if (parentEl) {
const cites = parentEl.dataset.cites;
if (cites) {
return {
el,
cites: cites.split(' ')
};
} else {
return findCites(el.parentElement)
}
} else {
return undefined;
}
};
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const citeInfo = findCites(ref);
if (citeInfo) {
tippyHover(citeInfo.el, function() {
var popup = window.document.createElement('div');
citeInfo.cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
}
});
</script>
</div> <!-- /content -->
</body></html>