This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
04_gene_plots.R
134 lines (116 loc) · 3.04 KB
/
04_gene_plots.R
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
source("_setup.R")
data_dir <- file.path("data", Sys.Date())
loadData(bcb, dds, res, resTbl, rld, dir = "data/2018-02-20")
# Prefer the rlog counts (rld.rda) for gene plots
# rlog = "regularized log" (log2 scale)
# help("rlog", "DESeq2")
print(rld)
gene2symbol <- gene2symbol(bcb)
# Define the color palette
# color <- scale_color_viridis(discrete = TRUE)
color <- scale_color_manual(values = c(control = "black", ALS = "red"))
# TDP-43 plots =================================================================
# TDP-43 = TARDBP
# The y-axis scale of the TPM counts is easier to see here
TARDBP <- "ENSG00000120948"
pdf("tpm_tdp-43.pdf", width = 8, height = 8)
plotGene(
bcb,
normalized = "tpm",
genes = TARDBP,
interestingGroups = "category",
color = color)
plotGene(
bcb,
normalized = "tpm",
genes = TARDBP,
interestingGroups = "sampleName")
dev.off()
# Manuscript genes of interest =================================================
manuscript_down <- c(
TARDBP,
STMN2 = "ENSG00000104435",
ELAVL3 = "ENSG00000196361",
HBEGF = "ENSG00000113070",
PFKP = "ENSG00000067057",
RCAN1 = "ENSG00000159200",
SMAD6 = "ENSG00000137834",
SELPLG = "ENSG00000110876",
GDF6 = "ENSG00000156466"
)
pdf("tpm_manuscript_down_grid.pdf", width = 9, height = 9)
plotGene(
bcb,
normalized = "tpm",
genes = manuscript_down,
interestingGroups = "category",
color = color,
return = "grid")
dev.off()
pdf("tpm_manuscript_down_wide.pdf", width = 9, height = 6)
plotGene(
bcb,
normalized = "tpm",
genes = manuscript_down,
interestingGroups = "category",
color = color,
return = "wide")
dev.off()
manuscript_up <- c(
ALOX5AP = "ENSG00000132965",
NAT8L = "ENSG00000185818"
)
pdf("tpm_manuscript_up_grid.pdf", width = 6, height = 3)
plotGene(
bcb,
normalized = "tpm",
genes = manuscript_up,
interestingGroups = "category",
color = color,
return = "grid")
dev.off()
pdf("tpm_manuscript_up_wide.pdf", width = 4, height = 6)
plotGene(
bcb,
normalized = "tpm",
genes = manuscript_up,
interestingGroups = "category",
color = color,
return = "wide")
dev.off()
saveData(manuscript_down, manuscript_up, dir = data_dir)
# Top DEGs ========================================================
deg_down <- head(resTbl$degLFCDown$ensgene, 9)
deg_up <- head(resTbl$degLFCUp$ensgene, 9)
pdf("tpm_top_deg_grid.pdf", width = 9, height = 9)
plotGene(
bcb,
genes = deg_down,
normalized = "tpm",
interestingGroups = "category",
color = color,
return = "grid")
plotGene(
bcb,
genes = deg_up,
normalized = "tpm",
interestingGroups = "category",
color = color,
return = "grid")
dev.off()
pdf("tpm_top_deg_wide.pdf", width = 9, height = 6)
plotGene(
bcb,
genes = deg_down,
normalized = "tpm",
interestingGroups = "category",
color = color,
return = "wide")
plotGene(
bcb,
genes = deg_up,
normalized = "tpm",
interestingGroups = "category",
color = color,
return = "wide")
dev.off()