|
a |
|
b/FigS6E_CoMMpass_CGA_heatmap.R |
|
|
1 |
|
|
|
2 |
# Plot heatmap of CGA expression in CoMMpass data (Figure S6E) |
|
|
3 |
|
|
|
4 |
library(ComplexHeatmap) |
|
|
5 |
library(circlize) |
|
|
6 |
library(RColorBrewer) |
|
|
7 |
library(grid) |
|
|
8 |
library(dplyr) |
|
|
9 |
|
|
|
10 |
# load data |
|
|
11 |
load("MM_COMPASS_FM.Rdata") |
|
|
12 |
load("GSVA_MM_COMPASS_scores.Rdata") |
|
|
13 |
|
|
|
14 |
# read correlation results |
|
|
15 |
cor <- read.table("TableS6_CoMMpass_MM_nCGA_correlations.tsv", sep = "\t", header = TRUE) |
|
|
16 |
|
|
|
17 |
# only samples with gexp data |
|
|
18 |
fm <- fm[, !is.na(fm["N:GEXP:KRAS",])] |
|
|
19 |
|
|
|
20 |
# order fm by subtype |
|
|
21 |
subtypes <- rep("CCND1", length(fm)) |
|
|
22 |
subtypes[fm["B:SAMP:cancermap_subtypes_WHSC1_FGFR3_Ig",]==1] <- "FGFR3" |
|
|
23 |
subtypes[fm["B:SAMP:cancermap_subtypes_Hyperdiploid",]==1] <- "Hyperdiploid(gain(11q)" |
|
|
24 |
subtypes[fm["B:SAMP:cancermap_subtypes_Hyperdiploid_amp1q",]==1] <- "Hyperdiploid/gain(1q)" |
|
|
25 |
subtypes[fm["B:SAMP:cancermap_subtypes_MAF_Ig",]==1] <- "MAF" |
|
|
26 |
subtypes[fm["B:SAMP:cancermap_subtypes_TRAF3_Aberrated",]==1] <- "TRAF3" |
|
|
27 |
subtypes[fm["B:SAMP:cancermap_cluster_CGA_Prolif",]==1] <- "CGA/Proliferative" |
|
|
28 |
|
|
|
29 |
subtypes_order <- order(subtypes, fm["N:SAMP:nCGA",]) |
|
|
30 |
fm <- fm[,subtypes_order] |
|
|
31 |
|
|
|
32 |
# create matrix with selected alterations |
|
|
33 |
cga <- as.character(read.table("cga.txt")[,1]) |
|
|
34 |
|
|
|
35 |
feats <- paste0("N:GEXP:", cga) |
|
|
36 |
mat <- fm[feats,] |
|
|
37 |
mat <- mat[!is.na(mat[,1]),] # remove CGA genes not found |
|
|
38 |
|
|
|
39 |
mat_scaled <- t(apply(mat, 1, scale)) |
|
|
40 |
colnames(mat_scaled) <- colnames(mat) |
|
|
41 |
rownames(mat_scaled) <- gsub("N:GEXP:", "", rownames(mat_scaled)) |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
# create heatmap annotations |
|
|
45 |
annot <- data.frame(subtype = subtypes[subtypes_order]) |
|
|
46 |
|
|
|
47 |
ha1 <- HeatmapAnnotation(df = annot, col = list(subtype = structure(brewer.pal(length(unique(annot$subtype)), "Set1"), |
|
|
48 |
names = as.character(unique(annot$subtype)))), |
|
|
49 |
|
|
|
50 |
CGA = anno_barplot(as.numeric(fm["N:SAMP:nCGA",]), |
|
|
51 |
bar_width = 0.75, |
|
|
52 |
border = FALSE, |
|
|
53 |
axis = TRUE, |
|
|
54 |
axis_param = list(gp = gpar(fontsize = 5, lwd = 0.5)), |
|
|
55 |
gp = gpar(col = NA, fill = "#a52a2a"), |
|
|
56 |
ylim = c(0, 13)), |
|
|
57 |
|
|
|
58 |
Proliferation = anno_barplot(as.numeric(fm["N:CLIN:Prolif_Index",]), |
|
|
59 |
bar_width = 0.75, |
|
|
60 |
border = FALSE, |
|
|
61 |
axis = TRUE, |
|
|
62 |
axis_param = list(gp = gpar(fontsize = 5, lwd = 0.5)), |
|
|
63 |
gp = gpar(col = NA, fill = "grey20")), |
|
|
64 |
|
|
|
65 |
Mutations = anno_barplot(as.numeric(fm["N:CLIN:NS_Non_IG_Variants",]), |
|
|
66 |
bar_width = 0.75, |
|
|
67 |
border = FALSE, |
|
|
68 |
axis = TRUE, |
|
|
69 |
axis_param = list(gp = gpar(fontsize = 5, lwd = 0.5)), |
|
|
70 |
gp = gpar(col = NA, fill = "grey20"), |
|
|
71 |
ylim = c(0, 900)), |
|
|
72 |
|
|
|
73 |
gap = unit(0.75, "mm"), |
|
|
74 |
annotation_legend_param = list(subtype = list(title = "Subtype", title_gp = gpar(fontsize = 5), |
|
|
75 |
labels_gp = gpar(fontsize = 5), grid_height = unit(0.2, "cm"), grid_width = unit(2, "mm"))), |
|
|
76 |
height = unit(1.5, "cm"), |
|
|
77 |
simple_anno_size_adjust = T, |
|
|
78 |
show_annotation_name = F |
|
|
79 |
) |
|
|
80 |
|
|
|
81 |
alt <- data.frame(ccnd1 = as.character(fm["B:CNVR:RNASeq_CCND1_Ig_translocation",]), |
|
|
82 |
fgfr3 = as.character(fm["B:CNVR:RNASeq_WHSC1_Ig_translocation",]), |
|
|
83 |
hyperdiploid = as.character(fm["B:CNVR:Hyperdiploid_Call",]), |
|
|
84 |
maf = as.character(fm["B:CNVR:RNASeq_MAF_Ig_translocation",]), |
|
|
85 |
traf3 = as.character(fm["B:GNAB:TRAF3",]), |
|
|
86 |
nras = as.character(fm[c("B:GNAB:NRAS"),]), |
|
|
87 |
traf3_cnv = as.numeric(fm["N:CNVR:TRAF3",]), |
|
|
88 |
gain11q = as.numeric(fm["N:CNVR:11q23",]), |
|
|
89 |
gain1q = as.numeric(fm["N:CNVR:1q21",]) |
|
|
90 |
) |
|
|
91 |
|
|
|
92 |
green <- structure(c("darkgreen", "#EDEDED", "grey50"), names = c("1", "0", "NA")) |
|
|
93 |
blackgrey <- structure(c("black", "#EDEDED", "grey50"), names = c("1", "0", "NA")) |
|
|
94 |
ramp <- colorRamp2(seq(-1, 1, length.out = 11), rev(brewer.pal(11, "PuOr"))) |
|
|
95 |
|
|
|
96 |
ha2 = HeatmapAnnotation(df = alt, col = list(ccnd1 = green, |
|
|
97 |
fgfr3 = green, |
|
|
98 |
hyperdiploid = green, |
|
|
99 |
maf = green, |
|
|
100 |
traf3 = blackgrey, |
|
|
101 |
nras = blackgrey, |
|
|
102 |
traf3_cnv = ramp, |
|
|
103 |
gain11q = ramp, |
|
|
104 |
gain1q = ramp), |
|
|
105 |
height = unit(1.75, "cm"), |
|
|
106 |
simple_anno_size_adjust = T, |
|
|
107 |
show_legend = F, |
|
|
108 |
show_annotation_name = F, |
|
|
109 |
gap = unit(0, "mm")) |
|
|
110 |
|
|
|
111 |
# make heatmap |
|
|
112 |
ht <- Heatmap(mat_scaled, |
|
|
113 |
name = "heatmap", |
|
|
114 |
col = colorRamp2(seq(-3, 3, length.out = 11), rev(brewer.pal(11, "RdBu"))), |
|
|
115 |
use_raster = T, |
|
|
116 |
top_annotation = ha1, |
|
|
117 |
bottom_annotation = ha2, |
|
|
118 |
row_names_side = "right", |
|
|
119 |
row_names_gp = gpar(fontsize = 5), |
|
|
120 |
show_column_names = FALSE, |
|
|
121 |
show_column_dend = FALSE, |
|
|
122 |
cluster_columns = FALSE, |
|
|
123 |
cluster_rows = TRUE, |
|
|
124 |
show_row_dend = FALSE, |
|
|
125 |
row_title_gp = gpar(fontsize = 5), |
|
|
126 |
show_heatmap_legend = T, |
|
|
127 |
heatmap_legend_param = list(title = "Expression (log2)\nZ-score", |
|
|
128 |
title_gp = gpar(fontsize = 5), |
|
|
129 |
labels_gp = gpar(fontsize = 5), |
|
|
130 |
grid_height = unit(0.2, "cm"), |
|
|
131 |
grid_width = unit(2, "mm")) |
|
|
132 |
) |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
# print heatmap |
|
|
136 |
pdf("FigureS6E_CoMMpass_CGA_heatmap.pdf", height = 3.25, width = 5) |
|
|
137 |
draw(ht) |
|
|
138 |
decorate_annotation("CGA", { |
|
|
139 |
grid.text("CGAs expressed", unit(0, "npc") + unit(0.15, "cm"), 0.5, |
|
|
140 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
141 |
}) |
|
|
142 |
decorate_annotation("Proliferation", { |
|
|
143 |
grid.text("Prolif. index", unit(0, "npc") + unit(0.15, "cm"), 0.5, |
|
|
144 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
145 |
}) |
|
|
146 |
decorate_annotation("Mutations", { |
|
|
147 |
grid.text("Mutations", unit(0, "npc") + unit(0.15, "cm"), 0.5, |
|
|
148 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
149 |
}) |
|
|
150 |
decorate_annotation("ccnd1", { |
|
|
151 |
grid.text("CCND1", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
152 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
153 |
}) |
|
|
154 |
decorate_annotation("fgfr3", { |
|
|
155 |
grid.text("FGFR3/MMSET", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
156 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
157 |
}) |
|
|
158 |
decorate_annotation("hyperdiploid", { |
|
|
159 |
grid.text("Hyperdiploid", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
160 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
161 |
}) |
|
|
162 |
decorate_annotation("maf", { |
|
|
163 |
grid.text("MAF", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
164 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
165 |
}) |
|
|
166 |
decorate_annotation("traf3", { |
|
|
167 |
grid.text("TRAF3", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
168 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
169 |
}) |
|
|
170 |
decorate_annotation("nras", { |
|
|
171 |
grid.text("NRAS", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
172 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
173 |
}) |
|
|
174 |
decorate_annotation("traf3_cnv", { |
|
|
175 |
grid.text("TRAF3", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
176 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
177 |
}) |
|
|
178 |
decorate_annotation("gain11q", { |
|
|
179 |
grid.text("11q23", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
180 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
181 |
}) |
|
|
182 |
decorate_annotation("gain1q", { |
|
|
183 |
grid.text("1q21", unit(0, "npc") + unit(7.1, "cm"), 0.1, |
|
|
184 |
default.units = "npc", just = c("left", "bottom"), gp = gpar(fontsize = 5)) |
|
|
185 |
}) |
|
|
186 |
|
|
|
187 |
dev.off() |