-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bulk_RNA_seq_Report.Rmd
995 lines (774 loc) · 33.1 KB
/
Bulk_RNA_seq_Report.Rmd
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
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
---
author: "Owen Hoare"
date: "`r Sys.Date()`"
output:
html_document:
theme: cerulean
toc: TRUE
toc_float: TRUE
toc_depth: 6
fig_width: 12
fig_height: 8
fig_caption: true
code_folding: hide
pdf_document: default
---
---
title: `r paste("Measles and Toca Virus Evaluation - Bulk RNA_seq", sep ="<BR>")`
---
### Run informations {.tabset .tabset-fade}
#### Run
<center>
```{r runInfo_run}
library( pander)
pander( c( 'Date' = as.character( Sys.Date()),
'Experiment' = EXPERIMENT_NAME));
```
</center>
#### Parameters
```{r runInfo_params}
listParams = as.list( paramsEnv);
pander(listParams[order(names(listParams))]); # Show params in alphabetical order
```
</center>
#### R
```{r runInfo_r}
pander( sessionInfo());
```
```{r, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::read_chunk(path = file.path( WORKING_DIR, "DEGSeq2.R"))
```
```{r eval=T, error=TRUE, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Load_libraries>>
```
[//]: # "Load the data"
```{r dataLoadpreProcess, fig.dim = c(15,10), echo=FALSE, message=FALSE, warning=FALSE}
<<loadData>>
```
<br /><br />
### CIBERSORTx Analysis and Visualization SingleR {.tabset .tabset-fade}
Let's take a look at CIBERSORTx deconvolution on our mouse PNOC bulk RNA-seq data using
our scRNA-seq as our reference to do the cell type classification. This was run in
relative cell fraction mode.
```{r CIBERSORTx, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<CIBERSORTx_PCA>>
```
<br />
#### Basic Heatmap Matrix SingleR
CIBERSORTx Heatmap SingleR
```{r CIBERSORTx_heatmap, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Heatmap>>
```
<br />
#### Heatmap with correlation SingleR
CIBERSORTx Correlation Heatmap SingleR
```{r CIBERSORTx_correlation_heatmap, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Correlation_Heatmap>>
```
<br />
#### Dotplot with correlation and p-values SingleR
CIBERSORTx Correlation dotplots with pvalues SingleR
```{r CIBERSORTx_correlation_heatmap_pvalues, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Correlation_Heatmap_pvalues>>
```
<br />
#### CIBERSORTx cell fraction summary SingleR
CIBERSORTx cell fraction results SingleR
```{r CIBERSORTx_cell_fraction_Result, message=FALSE, fig.dim = c(30,20), warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_cell_fraction_results>>
```
<br />
#### CIBERSORTx cell fraction summary barplot SingleR
CIBERSORTx cell fraction barplot SingleR
```{r CIBERSORTx_cell_fraction_barplots, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis', fig.dim = c(15,10)}
<<CIBERSORTx_cell_fraction_barplot>>
```
<br />
#### CIBERSORTx cell fraction boxplots SingleR
CIBERSORTx cell fraction boxplots SingleR
```{r CIBERSORTx_cell_fraction_boxplots, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis', fig.dim = c(20,10)}
<<CIBERSORTx_cell_fraction_boxplot>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### CIBERSORTx Analysis and Visualization Virus {.tabset .tabset-fade}
Now let's do the same thing but for the viral cell fraction.
```{r CIBERSORTx2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<CIBERSORTx_PCA2>>
```
<br />
#### Basic Heatmap Matrix Virus
CIBERSORTx Heatmap Virus
```{r CIBERSORTx_heatmap2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Heatmap2>>
```
<br />
#### Heatmap with correlation Virus
CIBERSORTx Correlation Heatmap Virus
```{r CIBERSORTx_correlation_heatmap2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Correlation_Heatmap2>>
```
<br />
#### Dotplot with correlation and p-values Virus
CIBERSORTx Correlation dotplots with pvalues Virus
```{r CIBERSORTx_correlation_heatmap_pvalues2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_Correlation_Heatmap_pvalues2>>
```
<br />
#### CIBERSORTx cell fraction summary Virus
CIBERSORTx cell fraction results Virus
```{r CIBERSORTx_cell_fraction_Result_Virus, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<CIBERSORTx_cell_fraction_results2>>
```
<br />
#### CIBERSORTx cell fraction summary barplot Virus
CIBERSORTx cell fraction barplot Virus
```{r CIBERSORTx_cell_fraction_barplots2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis', fig.dim = c(15,10)}
<<CIBERSORTx_cell_fraction_barplot2>>
```
<br />
#### CIBERSORTx cell fraction boxplots Virus
CIBERSORTx cell fraction boxplots Virus
```{r CIBERSORTx_cell_fraction_boxplots2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis', fig.dim = c(15,10)}
<<CIBERSORTx_cell_fraction_boxplot2>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
```{r Prepare_Data, eval=T, error=TRUE, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<PrepareData>>
```
### Measles Control vs Measles Virus Post Treatment {.tabset .tabset-fade}
Let's perform differential expression tests for each contrast using DESeq2
```{r Differential_Expression, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Run_DESeq2>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvMT,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables}
<<Print_Tables>>
```
#### Measles Control vs Heat Inactivated MV
```{r Differential_Expression1, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Contrast1>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop1, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvMHI,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables1}
<<Print_Tables1>>
```
#### Measles Control vs Mid treatment MV
```{r Differential_Expression2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Contrast2>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvM_MT,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables2}
<<Print_Tables2>>
```
#### Toca Control vs Post treatment Toca
```{r Differential_Expression3, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Contrast3>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop3, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvPTT,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables3}
<<Print_Tables3>>
```
#### Toca Control vs Heat Inactivated Toca
```{r Differential_Expression4, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Contrast4>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop4, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvHIT,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables4}
<<Print_Tables4>>
```
#### Toca Control vs Mid treatment Toca
```{r Differential_Expression5, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Contrast5>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop5, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(CvMTT,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables5}
<<Print_Tables5>>
```
Ending the tabset section
### {.toc-ignore}
<br /><br /><br /><br />
### DEGSeq2 Analysis and Visualization MV {.tabset .tabset-fade}
Let's take a look at some differential gene expression analysis using the DESeq2 package
and I will set it using the likelihood ration option to compare all 8 contrasts.
Then I will interrogate the biology that underpins these genes.
```{r DEGSeq2_Analysis_Run, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<DEGSeq2_Analysis>>
```
<br />
#### Dispersion Plots
Dispersion Plot
```{r Dispersion_Plot, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<DispersionPlot>>
```
<br />
#### MA Plots Control vs MV Post Treatment
MAPlots Control vs MV Post Treatment
```{r MA_Plots, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<MAPlots>>
```
<br />
#### MA Plots Control vs MV Post Treatment Significant Genes
MA Plots Control vs MV Post Treatment Most Significant Genes
```{r MAPlots_Significant_Gene, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<MAPlots_Significant_Genes>>
```
<br />
#### Volcano Plots Control vs MV Post Treatment Significant Genes
Volcano Plots Control vs MV Post Treatment Most Significant Genes
```{r Volcano_Plot, message=FALSE, fig.dim = c(25,20), warning=FALSE, autodep=T, include=T, results='asis'}
<<VolcanoPlot>>
```
<br />
#### Count Plot for Top Marker Gene
Volcano Plots Control vs MV Post Treatment Most Significant Genes
```{r PlotCounts, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<PlotCounts>>
```
<br />
#### Heatmap Control vs MV Post Treatment Most Significant Genes
Heatmap Control vs MV Post Treatment Top Genes (2FC padj < 0.05)
```{r Heatmap_Top_Genes, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<HeatmapTopGenes>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### GSEA and Pathway Analysis MV {.tabset .tabset-fade}
Here I will examine the pathways associated with the differentially expressed genes comparing the
control measles virus samples vs post treatment (20 days after infection) with measles virus.
```{r GO_Pathway_Enrichment_MV, fig.dim = c(15,10), warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
<<GO_Pathway_Analysis_MV>>
```
<br />
#### Enrichment Plots Control vs MV Post Treatment
Enrichment Plot MV
```{r E_MapPlot_MV, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<EMapPlot_MV>>
```
<br />
#### cMap Plots Control vs MV Post Treatment
cMap Plot Control vs MV Post Treatment
```{r c_MapPlot_MV, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<cMapPlot_MV>>
```
<br />
#### RidgePlot Control vs MV Post Treatment
Ridge Plot Control vs MV Post Treatment
```{r RidglePlotMV, fig.dim = c(15,15), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<RidglePlot_MV>>
```
<br />
#### GSEA TopPathway MV
GSEA Top Pathway MV
```{r GSEATopPathway_MV, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<GSEA_TopPathway_MV>>
```
<br />
#### Total Publised Papers on this Pathway
Total Publised Papers on this Pathway Since 2010
```{r Published_Papers, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Published_Articles_MV>>
```
<br />
```{r KEGGPaths, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathways>>
```
<br />
#### KEGG TopPathway MV
KEGG Top Pathway MV
```{r KEGG_Pathways_MV, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_TopPathway_MV>>
```
<br />
#### KEGG Pathway Enrichment Control vs MV Post Treatment
KEGG Pathways Enriched Control vs MV Post Treatment
```{r KEGG_Paths_Enrichment, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathway_Enrichment>>
```
<br />
#### cNet KEGG Pathway Enrichment
cNet KEGG Pathway Enrichments
```{r cnet_Pathway_Enrich, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<cnet_KEGG_Pathway_Enrichment>>
```
<br />
#### RidglePlots KEGG Pathway Enrichment
RidglePlots Pathway KEGG Enrichments
```{r cnet_KEGG_Pathway_Enrich, message=FALSE, fig.dim = c(15,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<RidgePlot_KEGG_Pathway_Enrichment>>
```
<br />
#### Top KEGG Pathway Enrichment
Top KEGG Pathway Enriched
```{r Top_KEGG_Pathway_Enriched, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<Top_KEGG_Pathway_Enrichment>>
```
<br />
#### Full Measles KEGG Pathway
Measles KEGG Pathway
```{r Measles_KEGG_Pathways, message=FALSE, fig.dim = c(20,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<Measles_KEGG_Pathway>>
knitr::include_graphics("/media/owen/Backup Plus/UCSF_Project/02_PROCESSED_DATA/PNOC/ANALYSIS/Bulk_RNA/01_Input_Data/Mouse/mmu05162.pathview.png")
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### DEGSeq2 Analysis and Visualization Toca {.tabset .tabset-fade}
Now I will pull out the differentially expressed genes associated with control vs Toca virus post treatment.
The same logic applies as in my previous analysis.
```{r DEGSeq2_Analysis_Toca_2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<DEGSeq2_Analysis_Toca2>>
```
#### MA Plots Control vs Toca Post Treatment
MAPlots Control vs Toca Post Treatment
```{r MA_Plots2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<MAPlots2>>
```
<br />
#### MA Plots Control vs Toca Post Treatment Significant Genes
MA Plots Control vs Toca Post Treatment Most Significant Genes
```{r MAPlots_Significant_Gene2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<MAPlots_Significant_Genes2>>
```
<br />
#### Volcano Plots Control vs MV Post Treatment Significant Genes
Volcano Plots Control vs Toca Post Treatment Most Significant Genes
```{r Volcano_Plot2, message=FALSE, fig.dim = c(25,20), warning=FALSE, autodep=T, include=T, results='asis'}
<<VolcanoPlot2>>
```
<br />
#### Count Plot for Top Marker Gene
Volcano Plots Control vs Toca Post Treatment Most Significant Genes
```{r PlotCounts2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<PlotCounts2>>
```
<br />
#### Heatmap Control vs Toca Post Treatment Most Significant Genes
Heatmap Control vs Toca Post Treatment Top Genes (2FC padj < 0.05)
```{r Heatmap_Top_Genes2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<HeatmapTopGenes2>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### GSEA and Pathway Analysis Toca {.tabset .tabset-fade}
```{r GO_Pathway_Enrichment_MV2, fig.dim = c(15,10), warning=FALSE, message=FALSE, echo=FALSE, results='asis'}
<<GO_Pathway_Analysis_MV2>>
```
<br />
#### Enrichment Plots Control vs Toca Post Treatment
Enrichment Plot Toca
```{r E_MapPlot_MV2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<EMapPlot_MV2>>
```
<br />
#### cMap Plots Control vs Toca Post Treatment
cMap Plot Control vs MV Post Treatment
```{r c_MapPlot_MV2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<cMapPlot_MV2>>
```
<br />
#### RidgePlot Control vs Toca Post Treatment
Ridge Plot Control vs MV Post Treatment
```{r RidglePlotMV2, fig.dim = c(15,15), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<RidglePlot_MV2>>
```
<br />
#### GSEA TopPathway Toca
GSEA Top Pathway Toca
```{r GSEATopPathway_MV2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<GSEA_TopPathway_MV2>>
```
<br />
#### Total Publised Papers on this Pathway
Total Published Papers on this Pathway Since 2010
```{r Published_Papers2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Published_Articles_MV2>>
```
<br />
```{r KEGGPaths2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathways2>>
```
<br />
#### KEGG TopPathway Toca
KEGG Top Pathway Toca
```{r KEGG_Pathways_MV2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_TopPathway_MV2>>
```
<br />
#### KEGG Pathway Enrichment Control vs Toca Post Treatment
KEGG Pathways Enriched Control vs Toca Post Treatment
```{r KEGG_Paths_Enrichment2, fig.dim = c(15,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathway_Enrichment2>>
```
<br />
#### cNet KEGG Pathway Enrichment Toca
cNet KEGG Pathway Enrichments Toca
```{r cnet_Pathway_Enrich2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<cnet_KEGG_Pathway_Enrichment2>>
```
<br />
#### RidglePlots KEGG Pathway Enrichment Toca
RidglePlots Pathway KEGG Enrichments Toca
```{r cnet_KEGG_Pathway_Enrich2, message=FALSE, fig.dim = c(15,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<RidgePlot_KEGG_Pathway_Enrichment2>>
```
<br />
#### Top KEGG Pathway Enrichment Toca
Top KEGG Pathway Enriched Toca
```{r Top_KEGG_Pathway_Enriched2, message=FALSE, fig.dim = c(15,10), warning=FALSE, autodep=T, include=T, results='asis'}
<<Top_KEGG_Pathway_Enrichment2>>
```
<br />
#### Full Herpes Simplex Virus KEGG Pathway
Measles KEGG Pathway
```{r Measles_KEGG_Pathways2, message=FALSE, fig.dim = c(20,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<Measles_KEGG_Pathway2>>
knitr::include_graphics("/media/owen/Backup Plus/UCSF_Project/02_PROCESSED_DATA/PNOC/ANALYSIS/Bulk_RNA/01_Input_Data/Mouse/mmu05168.pathview.png")
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### Survival Analysis of Mouse Infected with Measles Virus {.tabset .tabset-fade}
Here I will assess if injecting the mouse with measles or Toca virus has any survival benefit.
I will compare 2 groups with 6 contrasts. The first survival curve will look at measles virus
with control vs heat inactivated virus and subsequently 20 days post treatment. The same comparisons will
be done for the Toca visus to see which virus works best and promoted prolonged survival.
```{r SurvivalCurve_MV, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Survival_Analysis_MV_Infected_Virus>>
```
<br />
#### Forest Plot of Mouse Infected with MV Virus
Now I will make a forest plot to summarize my results and see if tumor weight is also a factor
in driving poor prognosis. The results indicate that post viral treatment is an independent prognostic factor.
```{r SurvivalForestMV, fig.dim = c(18,6), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<ForestPlot_MV_Infected_Virus>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### Survival Analysis of Mouse Infected with Toca Virus {.tabset .tabset-fade}
Now let's do the same analysis but only look at the effected of treating the mice with Toca virus.
```{r SurvivalCurve_Toca, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Survival_Analysis_Toca_Infected_Virus>>
```
<br />
#### Forest Plot of Mouse Infected with Toca Virus
Again I will make a forest plot to summarize my results and see if tumor weight is also a factor
in driving poor prognosis. The results indicate the post viral treatment is an independent prognostic factor.
```{r SurvivalForestToca, fig.dim = c(18,6), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<ForestPlot_Toca_Infected_Virus>>
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### Volcano3D Plots Measels Virus Re-examining differential expression {.tabset .tabset-fade}
The Volcano3D plots adds an extra dimension to our analysis. Here I can perform a differential gene expression analysis using
the same DEGSeq2 package. However, here I can make 3 contrast together. That is control, heat inactivated virus and post treatment.
I will do one set for measeles virus alone and seperately for Toca virus. Here I will exclude mid-treatment as this is the least informative group
given I already did this in my previous analysis. Volcano3D will allow us to pick on some new genes potentially missed by using DESeq2 alone.
```{r Volcano3DMV, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV>>
```
<br />
#### Volcano3D MV Plots
```{r Volcano3D_MV_DEGPlots, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_DEGPlot>>
```
<br />
#### Volcano3D MV Radial Plots
```{r Volcano3D_MV_DEGP_RadialPlots, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_DEGP_RadialPlot>>
```
<br />
#### Volcano3D MV Boxplots Top Genes
```{r Volcano3D_MV_Boxplot, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_Boxplots>>
```
<br />
#### Volcano2D MV Top DEG Plots
```{r Volcano2D_MV_DEGPlot, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_DEGPlots>>
```
<br />
#### Volcano3D MV GO Pathways
```{r Volcano2D_MV_GOPathway, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_GOPathways>>
```
<br />
#### Volcano3D MV Enrichment Plots
```{r Volcano2D_MV_GO_Enrichments, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_GO_Enrichment>>
```
<br />
#### Volcano3D DEG Measles Virus
Let's perform differential expression tests for each contrast using DESeq2
```{r MeaslesDEGVolcano3D1, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<MeaslesDEGVolcano3D>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop6, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(measles,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "Control_MV", "Mid_treatment_MV", "Post_treatment_MV", "x", "y", "r", "angle", "z", "pvalue", "col", "col", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables6}
<<Print_TablesMV>>
```
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### Volcano3D Plots Toca Virus Re-examining differential expression {.tabset .tabset-fade}
Now I will do the same but this time for Toca virus. Aagin I will use 3 contrasts
control, heat inactivated and post treatment to make the comparison. Once again I will investigate the
biology of these different genes and pathways.
```{r Volcano3DMV2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV2>>
```
<br />
#### Volcano3D Toca Plots
```{r Volcano3D_MV_DEGPlots2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_DEGPlot2>>
```
<br />
#### Volcano3D Toca Radial Plots
```{r Volcano3D_MV_DEGP_RadialPlots2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_DEGP_RadialPlot2>>
```
<br />
#### Volcano3D Toca Boxplots Top Genes
```{r Volcano3D_MV_Boxplot2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano3D_MV_Boxplots2>>
```
<br />
#### Volcano2D Toca Top DEG Plots
```{r Volcano2D_MV_DEGPlot2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_DEGPlots2>>
```
<br />
#### Volcano3D Toca GO Pathways
```{r Volcano2D_MV_GOPathway2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_GOPathways2>>
```
<br />
#### Volcano3D Toca Enrichment Plots
```{r Volcano2D_MV_GO_Enrichments2, fig.dim = c(15,10), echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Volcano2D_MV_GO_Enrichment2>>
```
<br />
#### Volcano3D DEG Toca Virus
Let's perform differential expression tests for each contrast using DESeq2
```{r MeaslesDEGVolcano3D2, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<TocaDEGVolcano3D>>
cat('\n', '<br>', '\n\n')
```
```{r EmptyDT_initialising_datatable_in_for_loop7, message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
datatable(Toca,
class = "compact",
filter="top",
rownames = FALSE,
colnames = c("gene", "Control_Toca", "Mid_treatment_Toca", "Post_treatment_Toca", "x", "y", "r", "angle", "z", "pvalue", "col", "col", "significant"),
extensions = c('Buttons'),
options = list(
pageLength = 15,
dom = 'Bfrtip',
buttons = c('excel','csv','pdf','copy')
))
# this empty datatable is necessary to allow the printing of datatables in the loop (next chunk)
```
```{r MarkerGenes_datatables7}
<<Print_TablesToca>>
```
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
### Interrogating Reasons For Low Viral Uptake {.tabset .tabset-fade}
Here I will look at specific markers of phagocytosis to see if the immune system
is responsible for clearing the virus before it had a chance to infect the cells. If so this may
hinder the immune response and may help explain the reason for such a low detection rate of the virus.
To test the correlation between cell type fraction from CIBERSORTx and gene expression I will use a
spearman ranked correlation.
```{r LowViralUptake, echo=FALSE, optipng='-o7', message=FALSE, warning=FALSE}
<<Interrogating_low_viral_uptake>>
```
<br />
#### Correlation Plots of Phagocyte Markers
Correlation Plots of Phagocytes Genes
```{r Interrogating_phagocyte_markers_correlation1, fig.dim = c(25,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Interrogating_phagocyte_markers_correlation>>
```
<br />
#### Boxplots of Phagocyte Markers
Boxplots of Phagocyte Genes
```{r Interrogating_phagocyte_markers_boxplots1, fig.dim = c(15,15), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Interrogating_phagocyte_markers_boxplots>>
```
<br />
#### Correlation Plots of Immunoglobulin and Apoptotic Markers
Correlation Plots of Immunoglobulin and Apoptotic Genes
```{r Interrogating_immunoglobulin_apoptotic_markers_correlation1, fig.dim = c(25,10), message=FALSE, warning=FALSE, autodep=T, include=T, results='asis'}
<<Interrogating_immunoglobulin_apoptotic_markers_correlation>>
```
<br />
#### Boxplots of Immunoglobulin and Apoptotic Markers
Boxplots of Immunoglobulin and Apoptotic Genes
```{r Interrogating_immunoglobulin_apoptotic_markers_boxplots, message=FALSE, fig.dim = c(15,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<Interrogating_immunoglobulin_apoptotic_markers_boxplots>>
```
<br />
#### Full Phagocytosis KEGG Pathway
Phagocytosis KEGG Pathway using DEG from MV control and MV post-treatment
```{r KEGG_Pathway_Phagocytosis1, message=FALSE, fig.dim = c(20,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathway_Phagocytosis>>
knitr::include_graphics("/media/owen/Backup Plus/UCSF_Project/02_PROCESSED_DATA/PNOC/ANALYSIS/Bulk_RNA/01_Input_Data/Mouse/mmu04666.pathview.png")
```
<br />
#### Full Apoptosis KEGG Pathway
Apoptosis KEGG Pathway using DEG from MV control and MV post-treatment
```{r KEGG_Pathway_Apoptosis1, message=FALSE, fig.dim = c(20,15), warning=FALSE, autodep=T, include=T, results='asis'}
<<KEGG_Pathway_Apoptosis>>
knitr::include_graphics("/media/owen/Backup Plus/UCSF_Project/02_PROCESSED_DATA/PNOC/ANALYSIS/Bulk_RNA/01_Input_Data/Mouse/mmu04210.pathview.png")
```
<br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />
<!-- Ending the tabset section -->
### {.toc-ignore}
<br /><br />