2
2
output : html_document
3
3
---
4
4
5
- # Dealing with confounders (Reads)
5
+ ## Dealing with confounders (Reads)
6
6
7
7
``` {r, echo=FALSE}
8
8
library(knitr)
@@ -30,9 +30,9 @@ reads.qc <- computeSumFactors(reads.qc, sizes = 15, clusters = qclust)
30
30
reads.qc <- normalize(reads.qc)
31
31
```
32
32
33
- ## Remove Unwanted Variation
33
+ ### Remove Unwanted Variation
34
34
35
- ### RUVg
35
+ #### RUVg
36
36
37
37
``` {r, message=FALSE, warning=FALSE}
38
38
ruvg <- RUVg(counts(reads.qc), erccs, k = 1)
@@ -45,7 +45,7 @@ assay(reads.qc, "ruvg10") <- log2(
45
45
)
46
46
```
47
47
48
- ### RUVs
48
+ #### RUVs
49
49
50
50
``` {r}
51
51
scIdx <- matrix(-1, ncol = max(table(reads.qc$individual)), nrow = 3)
@@ -66,7 +66,7 @@ assay(reads.qc, "ruvs10") <- log2(
66
66
)
67
67
```
68
68
69
- ### Combat
69
+ #### Combat
70
70
71
71
``` {r, eval = TRUE, message = FALSE}
72
72
combat_data <- logcounts(reads.qc)
@@ -98,7 +98,7 @@ assay(reads.qc, "combat_tf") <- ComBat(
98
98
)
99
99
```
100
100
101
- ### mnnCorrect
101
+ #### mnnCorrect
102
102
103
103
``` {r}
104
104
do_mnn <- function(data.qc) {
@@ -143,7 +143,7 @@ assay(reads.qc, "mnn") <- cbind(indi1, indi2, indi3);
143
143
#)
144
144
```
145
145
146
- ### GLM
146
+ #### GLM
147
147
148
148
``` {r}
149
149
glm_fun <- function(g, batch, indi) {
@@ -188,7 +188,7 @@ indi3 <- do_glm(reads.qc[, reads.qc$individual == "NA19239"])
188
188
assay(reads.qc, "glm_indi") <- cbind(indi1, indi2, indi3);
189
189
```
190
190
191
- ### Effectiveness 1
191
+ #### Effectiveness 1
192
192
193
193
``` {r}
194
194
for(n in assayNames(reads.qc)) {
@@ -205,7 +205,7 @@ for(n in assayNames(reads.qc)) {
205
205
}
206
206
```
207
207
208
- ### Effectiveness 2
208
+ #### Effectiveness 2
209
209
210
210
``` {r}
211
211
res <- list()
@@ -216,7 +216,7 @@ par(mar=c(6,4,1,1))
216
216
boxplot(res, las=2)
217
217
```
218
218
219
- ### Effectiveness 3
219
+ #### Effectiveness 3
220
220
221
221
``` {r}
222
222
for(n in assayNames(reads.qc)) {
@@ -239,7 +239,7 @@ for(n in assayNames(reads.qc)) {
239
239
}
240
240
```
241
241
242
- ### Effectiveness 4
242
+ #### Effectiveness 4
243
243
244
244
``` {r, message = FALSE}
245
245
compare_kBET_results <- function(sce){
@@ -294,7 +294,7 @@ ggplot(dod, aes(Normalisation, Individual, fill=kBET)) +
294
294
ggtitle("Effect of batch regression methods per individual")
295
295
```
296
296
297
- ### sessionInfo()
297
+ #### sessionInfo()
298
298
299
299
``` {r echo=FALSE}
300
300
sessionInfo()
0 commit comments