-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05-RNA-Exhaustion-Public.Rmd
49 lines (36 loc) · 1.32 KB
/
05-RNA-Exhaustion-Public.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
---
title: "05-RNA-Exhaustion-Public"
author: "Alexander Kirchmair"
params:
data: ../data/public
---
```{r setup, include=FALSE}
library(GEOquery)
library(DESeq2)
library(datamisc)
dir.create(params$data, showWarnings = FALSE)
```
## Download data
```{r}
geo <- getGEO("GSE210534", GSEMatrix = FALSE, destdir = params$data)
geosupp <- getGEOSuppFiles("GSE210534", baseDir = params$data)
gunzip(rownames(geosupp))
```
## Differential expression analysis
```{r}
data <- readRDS(fp(params$data, "GSE210534/GSE210534_ensdb_105_dge_list_final.rds"))
data$gene_counts <- collapse(data$counts[data$genes$SYMBOL != "",], ids = data$genes$SYMBOL[data$genes$SYMBOL != ""], average_by = sum)
data$contrasts <- list(TeffvsTrest = c("SampleGroup", "Teff", "Trest"),
TexvsTrest = c("SampleGroup", "Tex", "Trest"),
TtumorvsTrest = c("SampleGroup", "Ttumor", "Trest"),
TexvsTtumor = c("SampleGroup", "Tex", "Ttumor"),
TexvsTeff = c("SampleGroup", "Tex", "Teff"))
data$DE <- runDESeq2(as.matrix(round(data$gene_counts)),
ncores = 1,
design = data$samples,
formula = ~ SampleGroup + Donor,
contrasts = data$contrasts)
```
```{r}
saveRDS(data, "../data/GSE210534_data.rds")
```