-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbiomarker_analysis_truncated.R
226 lines (203 loc) · 9.3 KB
/
biomarker_analysis_truncated.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# biomarker analysis - excluding non-solid tissues and truncated
library(PharmacoGx); library(SummarizedExperiment); library(knitr); library(readxl)
# loading PSets
CTRPv2 <- readRDS("../code/PSets/CTRPv2.rds")
GDSC2 <- readRDS("../code/PSets/GDSC2.rds")
CCLE <- readRDS("../code/PSets/CCLE.rds")
gCSI <- readRDS("../code/PSets/gCSI.rds")
GDSC1 <- readRDS("../code/PSets/GDSC1.rds")
# intersect PSets by common drugs
common <- PharmacoGx::intersectPSet(list('gCSI' = gCSI, 'GDSC2' = GDSC2, 'CTRPv2' = CTRPv2, 'GDSCv1' = GDSC1), intersectOn = c("drugs"))
ctrp <- common[["CTRPv2"]] # no molprof info available
gdsc2 <- common[["GDSC2"]]
gcsi <- common[["gCSI"]]
gdsc1 <- common[["GDSCv1"]]
rm(common)
common_drugs <- rownames(ctrp@drug)
#use uniprot id from biomarker list to get ensembl genes
gene_map <- read_excel("genes_annotations.xls")
genes <- na.omit(gene_map$ensemblvar)
# mapping between CCLE and CTRPv2 cell lines
ccle_celllines <- CCLE@molecularProfiles[["Kallisto_0.46.1.rnaseq"]]@colData@listData[["Cell_Line"]]
ctrp_celllines <- ctrp@cell$cellid
ccle_molprof <- as.data.frame(CCLE@molecularProfiles[["Kallisto_0.46.1.rnaseq"]]@colData@listData)
common_celllines <- subset(ccle_molprof, ctrp_celllines %in% ccle_celllines) # rnaseq info for cell lines tested in CTRPv2
rownames(common_celllines) <- common_celllines$cellid
ctrp@molecularProfiles[["Kallisto_0.46.1.rnaseq"]] <- CCLE@molecularProfiles[["Kallisto_0.46.1.rnaseq"]]
#remove non-solid tissues
ctrp_non_haema <- ctrp@cell[-which(ctrp@cell$tissueid == "Lymphoid" | ctrp@cell$tissueid == "Myeloid" | ctrp@cell$tissueid == "Other" ),]
#truncate
for (i in 1:length(ctrp@sensitivity$profiles$ic50_recomputed)) {
t1 <- ctrp@sensitivity$profiles$ic50_recomputed[i]
t2 <- ctrp@sensitivity$info$chosen.max.range[i]
t3 <- ctrp@sensitivity$info$chosen.min.range[i]
if (!is.na(t1)) {
if (t1>t2) {
ctrp@sensitivity$profiles$ic50_recomputed[i] <- t2
}
if (t1<t3){
ctrp@sensitivity$profiles$ic50_recomputed[i] <- t3
}
}
}
ctrp.aac.sigs <- PharmacoGx::drugSensitivitySig(ctrp, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "aac_recomputed", drugs=common_drugs, cells = rownames(ctrp_non_haema), features = genes)
ctrp.ic50.sigs <- PharmacoGx::drugSensitivitySig(ctrp, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "ic50_recomputed", drugs=common_drugs, cells = rownames(ctrp_non_haema), features = genes)
#GDSC2
#remove non-solid tissues
gdsc2_non_haema <- gdsc2@cell[-which(gdsc2@cell$tissueid == "Lymphoid" | gdsc2@cell$tissueid == "Myeloid" | gdsc2@cell$tissueid == "Other"),]
#truncate
for (i in 1:length(GDSC2@sensitivity$profiles$ic50_recomputed)) {
t1 <- GDSC2@sensitivity$profiles$ic50_recomputed[i]
t2 <- GDSC2@sensitivity$info$MAX.CONC[i]
t3 <- GDSC2@sensitivity$info$MIN.CONC[i]
if (!is.na(t1)) {
if (t1>t2) {
GDSC2@sensitivity$profiles$ic50_recomputed[i] <- t2
}
if (t1<t3){
GDSC2@sensitivity$profiles$ic50_recomputed[i] <- t3
}
}
}
gdsc2.aac.sigs <- PharmacoGx::drugSensitivitySig(gdsc2, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "aac_recomputed", drugs= common_drugs, cells = rownames(gdsc2_non_haema), features = genes)
gdsc2.ic50.sigs <- PharmacoGx::drugSensitivitySig(gdsc2, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "ic50_recomputed", drugs= common_drugs, cells = rownames(gdsc2_non_haema), features = genes)
#gCSI
#remove non-solid tissues
gcsi_non_haema <- gcsi@cell[-which(gcsi@cell$tissueid == "Lymphoid" | gcsi@cell$tissueid == "Myeloid" | gcsi@cell$tissueid == "Other"),]
#truncate
for (i in 1:length(gcsi@sensitivity$profiles$ic50_recomputed)) {
t1 <- gcsi@sensitivity$profiles$ic50_recomputed[i]
t2 <- gcsi@sensitivity$info$chosen.max.range[i]
t3 <- gcsi@sensitivity$info$chosen.min.range[i]
if (!is.na(t1)) {
if (t1>t2) {
gcsi@sensitivity$profiles$ic50_recomputed[i] <- t2
}
if (t1<t3){
gcsi@sensitivity$profiles$ic50_recomputed[i] <- t3
}
}
}
gcsi.aac.sigs <- PharmacoGx::drugSensitivitySig(gcsi, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "aac_recomputed", drugs= common_drugs, cells = rownames(gcsi_non_haema), features = genes)
gcsi.ic50.sigs <- PharmacoGx::drugSensitivitySig(gcsi, "Kallisto_0.46.1.rnaseq", sensitivity.measure = "ic50_recomputed", drugs= common_drugs, cells = rownames(gcsi_non_haema), features = genes)
# plots
ctrp.ic50.sigs <- as.data.frame([email protected])
gdsc2.ic50.sigs <- as.data.frame([email protected])
gcsi.ic50.sigs <- as.data.frame([email protected])
ctrp.aac.sigs <- as.data.frame([email protected])
gdsc2.aac.sigs <- as.data.frame([email protected])
gcsi.aac.sigs <- as.data.frame([email protected])
# Lapatinib
lap = as.data.frame(gene_map[which(gene_map$compound == "Lapatinib"), ])
lap$ctrp.ic50 <- NA; lap$gdsc2.ic50 <- NA; lap$gcsi.ic50 <- NA
lap$ctrp.aac <- NA; lap$gdsc2.aac <- NA; lap$gcsi.aac <- NA
y <- "Lapatinib.estimate"
for (row in rownames(lap)) {
x <- lap[row, "ensemblvar"]
lap[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
lap[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
lap[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
lap[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
lap[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
lap[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Docetaxel
doc = as.data.frame(gene_map[which(gene_map$compound == "Docetaxel"), ])
doc$ctrp.ic50 <- NA; doc$gdsc2.ic50 <- NA; doc$gcsi.ic50 <- NA
doc$ctrp.aac <- NA; doc$gdsc2.aac <- NA; doc$gcsi.aac <- NA
y <- "Docetaxel.estimate"
for (row in rownames(doc)) {
x <- doc[row, "ensemblvar"]
doc[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
doc[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
doc[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
doc[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
doc[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
doc[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Pictilisib
pic = as.data.frame(gene_map[which(gene_map$compound == "Pictilisib"), ])
pic$ctrp.ic50 <- NA; pic$gdsc2.ic50 <- NA; pic$gcsi.ic50 <- NA
pic$ctrp.aac <- NA; pic$gdsc2.aac <- NA; pic$gcsi.aac <- NA
y <- "Pictilisib.estimate"
for (row in rownames(pic)) {
x <- pic[row, "ensemblvar"]
pic[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
pic[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
pic[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
pic[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
pic[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
pic[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Gemcitabine
gem = as.data.frame(gene_map[which(gene_map$compound == "Gemcitabine"), ])
gem$ctrp.ic50 <- NA; gem$gdsc2.ic50 <- NA; gem$gcsi.ic50 <- NA
gem$ctrp.aac <- NA; gem$gdsc2.aac <- NA; gem$gcsi.aac <- NA
y <- "Gemcitabine.estimate"
for (row in rownames(gem)) {
x <- gem[row, "ensemblvar"]
gem[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
gem[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
gem[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
gem[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
gem[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
gem[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Vorinostat
vor = as.data.frame(gene_map[which(gene_map$compound == "Vorinostat"), ])
vor$ctrp.ic50 <- NA; vor$gdsc2.ic50 <- NA; vor$gcsi.ic50 <- NA
vor$ctrp.aac <- NA; vor$gdsc2.aac <- NA; vor$gcsi.aac <- NA
y <- "Vorinostat.estimate"
for (row in rownames(vor)) {
x <- vor[row, "ensemblvar"]
vor[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
vor[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
vor[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
vor[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
vor[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
vor[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Paclitaxel
pac = as.data.frame(gene_map[which(gene_map$compound == "Paclitaxel"), ])
pac$ctrp.ic50 <- NA; pac$gdsc2.ic50 <- NA; pac$gcsi.ic50 <- NA
pac$ctrp.aac <- NA; pac$gdsc2.aac <- NA; pac$gcsi.aac <- NA
y <- "Paclitaxel.estimate"
for (row in rownames(pac)) {
x <- pac[row, "ensemblvar"]
pac[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
pac[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
pac[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
pac[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
pac[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
pac[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Crizotinib
cri = as.data.frame(gene_map[which(gene_map$compound == "Crizotinib"), ])
cri$ctrp.ic50 <- NA; cri$gdsc2.ic50 <- NA; cri$gcsi.ic50 <- NA
cri$ctrp.aac <- NA; cri$gdsc2.aac <- NA; cri$gcsi.aac <- NA
y <- "Crizotinib.estimate"
for (row in rownames(cri)) {
x <- cri[row, "ensemblvar"]
cri[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
cri[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
cri[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
cri[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
cri[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
cri[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
#Erlotinib
erl = as.data.frame(gene_map[which(gene_map$compound == "Erlotinib"), ])
erl$ctrp.ic50 <- NA; erl$gdsc2.ic50 <- NA; erl$gcsi.ic50 <- NA
erl$ctrp.aac <- NA; erl$gdsc2.aac <- NA; erl$gcsi.aac <- NA
y <- "Erlotinib.estimate"
for (row in rownames(erl)) {
x <- erl[row, "ensemblvar"]
erl[row, "ctrp.ic50"] <- ctrp.ic50.sigs[x, y]
erl[row, "gdsc2.ic50"] <- gdsc2.ic50.sigs[x, y]
erl[row, "gcsi.ic50"] <- gcsi.ic50.sigs[x, y]
erl[row, "ctrp.aac"] <- ctrp.aac.sigs[x, y]
erl[row, "gdsc2.aac"] <- gdsc2.aac.sigs[x, y]
erl[row, "gcsi.aac"] <- gcsi.aac.sigs[x, y]
}
biomarker_truncated <- do.call("rbind", list(lap, doc, pic, gem, vor, pac, cri, erl))
WriteXLS::WriteXLS(biomarker_truncated, "../results/biomarker_truncated.xls")