-
Notifications
You must be signed in to change notification settings - Fork 3
/
human-diehl-nafld.Rmd
158 lines (129 loc) · 4.27 KB
/
human-diehl-nafld.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
---
title: "NAFLD patient cohort by Diehl et al."
author: "Christian H. Holland"
date: "2020-12-20"
output:
workflowr::wflow_html:
code_folding: hide
editor_options:
chunk_output_type: console
---
```{r chunk-setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
autodep = TRUE,
cache = TRUE
)
```
## Introduction
Here we analysis a patient cohort covering patients with mild and advanced NAFLD generated by [Diehl et al.](https://doi.org/10.1002/hep.26661).
## Libraries and sources
These libraries and sources are used for this analysis.
```{r libs-and-src, message=FALSE, warning=FALSE, cache=FALSE}
library(hgu133plus2.db)
library(tidyverse)
library(tidylog)
library(here)
library(oligo)
library(annotate)
library(GEOquery)
library(limma)
library(biobroom)
library(janitor)
library(msigdf) # remotes::install_github("ToledoEM/msigdf@v7.1")
library(AachenColorPalette)
library(cowplot)
library(lemon)
options("tidylog.display" = list(print))
source(here("code/utils-microarray.R"))
source(here("code/utils-utils.R"))
source(here("code/utils-plots.R"))
```
Definition of global variables that are used throughout this analysis.
```{r analysis-specific-params, cache=FALSE}
# i/o
data_path <- "data/human-diehl-nafld"
output_path <- "output/human-diehl-nafld"
# graphical parameters
# fontsize
fz <- 9
```
## Data processing
### Load .CEL files and quality control
The array quality is controlled based on the relative log expression values (RLE) and the normalized unscaled standard errors (NUSE).
```{r load-cel-files}
# load cel files and check quality
platforms <- readRDS(here("data/annotation/platforms.rds"))
raw_eset <- list.celfiles(here(data_path), listGzipped = T, full.names = T) %>%
read.celfiles() %>%
ma_qc()
```
### Normalization and probe annotation
Probe intensities are normalized with the `rma()` function. Probes are annotated with HGNC symbols.
```{r normalization-and-annotation}
eset <- rma(raw_eset)
# annotate microarray probes with hgnc symbols
expr <- ma_annotate(eset, platforms)
# remove file extension ".CEL.gz"
colnames(expr) <- str_remove(colnames(expr), ".CEL.gz")
# save normalized expression
saveRDS(expr, here(output_path, "normalized_expression.rds"))
```
### Build meta data
Meta information are downloaded from GEO with the accession ID [GSE49541](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE49541).
```{r build-meta-data}
# build meta data
df <- getGEO("GSE49541")
meta <- df$GSE49541_series_matrix.txt.gz %>%
pData() %>%
rownames_to_column("sample") %>%
as_tibble() %>%
dplyr::select(sample, class = `Stage:ch1`) %>%
mutate(
class = str_extract(class, "[:alpha:]*"),
class = factor(class, levels = c("mild", "advanced"))
)
# save meta data
saveRDS(meta, here(output_path, "meta_data.rds"))
```
## Exploratory analysis
### PCA of normalized data
PCA plot of normalized expression data contextualized based on the NAFLD stage. Only the top 1000 most variable genes are used as features.
```{r pca-norm-data}
expr <- readRDS(here(output_path, "normalized_expression.rds"))
meta <- readRDS(here(output_path, "meta_data.rds"))
pca_result <- do_pca(expr, meta, top_n_var_genes = 1000)
saveRDS(pca_result, here(output_path, "pca_result.rds"))
plot_pca(pca_result, feature = "class") +
my_theme()
```
## Differential gene expression analysis
### Running limma
Differential gene expression analysis via limma with the aim to identify the signature of advanced NAFLD with respect to early stages.
```{r running-limma}
# load expression and meta data
expr <- readRDS(here(output_path, "normalized_expression.rds"))
meta <- readRDS(here(output_path, "meta_data.rds"))
stopifnot(colnames(expr) == meta$sample)
# build design matrix
design <- model.matrix(~ 0 + class, data = meta)
rownames(design) <- meta$sample
colnames(design) <- levels(meta$class)
# define contrasts
contrasts <- makeContrasts(
advanced_vs_mild = advanced - mild,
levels = design
)
limma_result <- run_limma(expr, design, contrasts) %>%
assign_deg()
saveRDS(limma_result, here(output_path, "limma_result.rds"))
```
### Volcano plots
Volcano plots visualizing the signature of advanced NAFLD with respect to early stages.
```{r volcano-plots}
df <- readRDS(here(output_path, "limma_result.rds"))
df %>%
plot_volcano() +
my_theme(grid = "y", fsize = fz)
```