-
Notifications
You must be signed in to change notification settings - Fork 0
/
figure3.R
187 lines (127 loc) · 6.25 KB
/
figure3.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/usr/bin/env Rscript
#######################################################################################
#
# FIGURE 3: MULTIMODAL PROFILING REVEALS TUMOR-INTRINSIC ADAPTATIONS TO CDK4/6i
#
#######################################################################################
# Source function libraries
source('function_scripts/load_htan_data.R')
source('function_scripts/heatmap_functions.R')
source('function_scripts/load_marker_sets.R')
###################################
#
# LOAD DATA
#
###################################
source_dir <- '/Users/eggerj/OneDrive - Oregon Health & Science University/SMMART_HR+/Manuscript/Supp-Tables-Data/source_data'
# Meta table
meta.htan <- load_meta(fn.dir = source_dir)
# GSVA enrichment scores (RNA-seq)
gsva.htan <- load_gsva(meta.htan, fn.dir = source_dir)
# Gene expression (RNA-seq)
# Viper regulator activity (RNA-seq)
# Protein/phosphoprotein abundance (RPPA)
# mIHC
#########################################################################
#
# DEFINE SAMPLE SETS USING HTAN IDS
#
#########################################################################
htan.paired <- c("HTA9-1_Bx1", "HTA9-1_Bx2", "HTA9-1_Bx4", "HTA9-1_Bx5",
"HTA9-2_Bx1", "HTA9-2_Bx2",
"HTA9-3_Bx1", "HTA9-3_Bx2",
"HTA9-14_Bx1", "HTA9-14_Bx2", "HTA9-14_Bx3",
"HTA9-15_Bx1", "HTA9-15_Bx2")
htan.onProgression <- c("HTA9-1_Bx2", "HTA9-1_Bx5",
"HTA9-2_Bx2",
"HTA9-3_Bx2",
"HTA9-14_Bx2", "HTA9-14_Bx3",
"HTA9-15_Bx2")
#########################################################################
#
# LOAD AND CONSTRUCT ANNOTATION OBJECTS FOR HEATMAPS AND ONCOPLOTS
#
#########################################################################
# Load list of all annotations
annotations.htan <- make_heatmap_annotations(meta.htan)
# List of legends for heatmaps showing delta between pairs during therapy
lgds.change <- make_heatmap_legends(meta.htan, select_samples = htan.onProgression)
# Annotations for delta heatmaps
# TODO: May not have to define separate annotations if all legends will be merged
top_annotations.change.htan <- list(annotations.htan$onProgAnno %v%
annotations.htan$erAnno %v%
annotations.htan$responseAnno,
list(lgds.change$opAstrLgd,
lgds.change$onProgLgd,
lgds.change$responseLgd))
btm_annotations.change.htan <- list(annotations.htan$pamChangeAnno %v%
annotations.htan$htanPointer %v%
annotations.htan$biopPairAnno,
list(lgds.change$pamChangeLgd))
############################################################
#
# LOAD TABLES FOR GENE AND PATHWAY SETS
#
############################################################
source('~/Documents/CompBio/HRplus_Project/manuscript_repo/HTAN_HR_Figures/function_scripts/load_marker_sets.R')
####################################################################################
#
# FIGURE 3A: TRANSCRIPTIONAL GENE SET VARIATION ANALYSIS (GSVA) OF EXTRINSIC
# PATHWAYS DURING CDK4/6I THERAPY AND PROGRESSION
#
####################################################################################
# Extrinsic pathways from Mann-Whitney test (p < 0.1)
gsva_pws.extrinsic <- c("Activated CD8 T cell", "ALLOGRAFT_REJECTION", "Antigen Presentation",
"COMPLEMENT", "Gamma delta T cell", "iDC", "IL2_STAT5_SIGNALING",
"IL6_JAK_STAT3_SIGNALING", "INFLAMMATORY_RESPONSE", "INTERFERON_ALPHA_RESPONSE",
"INTERFERON_GAMMA_RESPONSE", "KEGG_JAK_STAT_SIGNALING_PATHWAY",
"NK CD56dim cells", "REACTOME_PD_1_SIGNALING", "Regulatory T cell",
"T Cell Inflamed GEP", "Tem cells")
# CLUSTER HEATMAP USING CHANGE ACROSS CDK4/6i
ht.fn <- paste(results_dir.test, "gsva_test_heatmap.png", sep = '/')
# TODO: Change function name
make_heatmap(gsva.htan,
meta.htan,
select_samples = htan.onProgression,
top_anno = top_annotations.change.htan,
btm_anno = btm_annotations.change.htan,
category_table = gsva_cats.htan,
bar_anno = 'CytoChange',
cluster_columns = TRUE,
select_features = gsva_pws.extrinsic,
show_column_annotation_legend = FALSE,
heatmap_width = unit(7.5, 'in'),
heatmap_height = unit(6, 'in'),
add_width = 0.5,
res = 100,
split_column_by_dendrogram = 2,
compute_change = TRUE,
lgd_name = 'Activity Change',
split_by_cat = TRUE,
fn = ht.fn
)
##########################################################################
#
# FIGURE 3B: INTEGRATED HEATMAP OF EXTRINSIC RNA AND PROTEIN
# CHANGES DURING CDK4/6I THERAPY AND PROGRESSION
#
##########################################################################
###############################################################################################
#
# FIGURE 3C: Cell densities reported for all CD45+ immune cells and individual immune
# cell type populations across pre-treatment (Bx1, white) and on-progression
# (Bx2, dark grey) biopsies for all biopsy pairs using mIHC
#
###############################################################################################
#####################################################################################
#
# FIGURE 3D: Psuedocolored mIHC whole slide image and select regions of interest
# of 9-15 Bx2 showing spatial heterogeneity of CD8 marker (magenta)
#
#####################################################################################
####################################################################################
#
# FIGURE 3E: Spatial heterogeneity and cytotoxic function of
# CD8+ T cells during CDK4/6i therapy and progression
#
####################################################################################