-
Notifications
You must be signed in to change notification settings - Fork 1
/
03_differential_expression.Rmd
99 lines (89 loc) · 3.53 KB
/
03_differential_expression.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
---
title: "Differential Expression for TNSeq of Spyogenes. (2017)"
author: "atb"
date: "`r Sys.Date()`"
output:
html_document:
code_download: true
code_folding: show
fig_caption: true
fig_height: 7
fig_width: 7
highlight: default
keep_md: false
mode: selfcontained
number_sections: true
self_contained: true
theme: readable
toc: true
toc_float:
collapsed: false
smooth_scroll: false
---
<style>
body .main-container {
max-width: 1600px;
}
</style>
```{r options, include=FALSE}
## These are the options I tend to favor
library("hpgltools")
tt <- devtools::load_all("~/hpgltools")
knitr::opts_knit$set(progress=TRUE,
verbose=TRUE,
width=90,
echo=TRUE)
knitr::opts_chunk$set(error=TRUE,
fig.width=8,
fig.height=8,
dpi=96)
options(digits=4,
stringsAsFactors=FALSE,
knitr.duplicate.label="allow")
ggplot2::theme_set(ggplot2::theme_bw(base_size=10))
set.seed(1)
previous_file <- "02_sample_estimation.Rmd"
ver <- "20180717"
tmp <- sm(loadme(filename=paste0(gsub(pattern="\\.Rmd", replace="", x=previous_file), "-v", ver, ".rda.xz")))
rmd_file <- "03_differential_expression.Rmd"
```
# Differential Expression, Spyogenes: `r ver`
This worksheet performs a set of pairwise comparisons of the counts for this tnseq experiment
given the sva surrogate adjustments.
This is being performed via limma/edger/deseq2, which one may rightly argue is not
entirely appropriate for TNSeq data. On the other hand, as a general metric of
changing fitness, it provides some interesting information.
```{r initial_estimation, fig.show="hide"}
initial_diff <- all_pairwise(input=rpmi_filt, model_batch="fsva")
keepers <- list("t2t1" = c("rpmi_t2", "thy_t1"),
"t3t1" = c("rpmi_t3", "thy_t1"),
"t2zn" = c("rpmi_t2_highzn", "rpmi_t2_lowzn"),
"t3zn" = c("rpmi_t3_highzn", "rpmi_t3_lowzn"),
## "t2cu" = c("rpmi_t2_highcu", "rpmi_t2_lowcu"),
## "t3cu" = c("rpmi_t3_highcu", "rpmi_t3_lowcu"),
"time_highzn" = c("rpmi_t3_highzn", "rpmi_t2_highzn"),
"time_lowzn" = c("rpmi_t3_lowzn", "rpmi_t2_lowzn"),
## "time_highcu" = c("rpmi_t3_highcu", "rpmi_t2_highcu"),
## "time_lowcu" = c("rpmi_t3_lowcu", "rpmi_t2_lowcu"),
"t2_rpmi_highzn" = c("rpmi_t2_highzn", "rpmi_t2"),
"t3_rpmi_highzn" = c("rpmi_t3_highzn", "rpmi_t3"),
"t2_rpmi_lowzn" = c("rpmi_t2_lowzn", "rpmi_t2"),
"t3_rpmi_lowzn" = c("rpmi_t3_lowzn", "rpmi_t3")
## "t2_rpmi_highcu" = c("rpmi_t2_highcu", "rpmi_t2"),
## "t3_rpmi_highcu" = c("rpmi_t3_highcu", "rpmi_t3"),
## "t2_rpmi_lowcu" = c("rpmi_t2_lowcu", "rpmi_t2"),
## "t3_rpmi_lowcu" = c("rpmi_t3_lowcu", "rpmi_t3"))
)
initial_write <- combine_de_tables(all_pairwise_result=initial_diff,
excel=paste0("excel/initial_diff-v", ver, ".xlsx"),
keepers=keepers)
sig_write <- sm(extract_significant_genes(initial_write,
excel=paste0("excel/significant-v", ver, ".xlsx")))
```
```{r saveme}
message(paste0("This is hpgltools commit: ", get_git_commit()))
pander::pander(sessionInfo())
this_save <- paste0(gsub(pattern="\\.Rmd", replace="", x=rmd_file), "-v", ver, ".rda.xz")
message(paste0("Saving to ", this_save))
tmp <- sm(saveme(filename=this_save))
```