|
a |
|
b/vignettes/src/part08.Rmd |
|
|
1 |
--- |
|
|
2 |
title: "Part 8" |
|
|
3 |
output: |
|
|
4 |
BiocStyle::html_document |
|
|
5 |
--- |
|
|
6 |
|
|
|
7 |
```{r, message=FALSE, include=!exists(".standalone"), eval=!exists(".standalone")} |
|
|
8 |
library("BloodCancerMultiOmics2017") |
|
|
9 |
library("Biobase") |
|
|
10 |
library("RColorBrewer") |
|
|
11 |
library("grid") |
|
|
12 |
library("ggplot2") |
|
|
13 |
library("survival") |
|
|
14 |
library("gtable") |
|
|
15 |
library("forestplot") |
|
|
16 |
library("xtable") |
|
|
17 |
library("maxstat") |
|
|
18 |
``` |
|
|
19 |
|
|
|
20 |
```{r echo=FALSE} |
|
|
21 |
plotDir = ifelse(exists(".standalone"), "", "part08/") |
|
|
22 |
if(plotDir!="") if(!file.exists(plotDir)) dir.create(plotDir) |
|
|
23 |
``` |
|
|
24 |
|
|
|
25 |
```{r} |
|
|
26 |
options(stringsAsFactors=FALSE) |
|
|
27 |
``` |
|
|
28 |
|
|
|
29 |
# Survival analysis |
|
|
30 |
|
|
|
31 |
Load the data. |
|
|
32 |
```{r} |
|
|
33 |
data(lpdAll, patmeta, drugs) |
|
|
34 |
``` |
|
|
35 |
|
|
|
36 |
Prepare survival data. |
|
|
37 |
```{r} |
|
|
38 |
lpdCLL <- lpdAll[ , lpdAll$Diagnosis=="CLL" ] |
|
|
39 |
|
|
|
40 |
# data rearrangements |
|
|
41 |
survT = patmeta[colnames(lpdCLL),] |
|
|
42 |
survT[which(survT[,"IGHV"]=="U") ,"IGHV"] = 0 |
|
|
43 |
survT[which(survT[,"IGHV"]=="M") ,"IGHV"] = 1 |
|
|
44 |
survT$IGHV = as.numeric(survT$IGHV) |
|
|
45 |
|
|
|
46 |
colnames(survT) = gsub("Age4Main", "age", colnames(survT)) |
|
|
47 |
|
|
|
48 |
survT$ibr45 <- 1-Biobase::exprs(lpdCLL)[ "D_002_4:5", rownames(survT) ] |
|
|
49 |
survT$ide45 <- 1-Biobase::exprs(lpdCLL)[ "D_003_4:5", rownames(survT) ] |
|
|
50 |
survT$prt45 <- 1-Biobase::exprs(lpdCLL)[ "D_166_4:5", rownames(survT) ] |
|
|
51 |
survT$selu45 <- 1-Biobase::exprs(lpdCLL)[ "D_012_4:5", rownames(survT) ] |
|
|
52 |
survT$ever45 <- 1-Biobase::exprs(lpdCLL)[ "D_063_4:5", rownames(survT) ] |
|
|
53 |
|
|
|
54 |
survT$nut15 <- 1-Biobase::exprs(lpdCLL)[ "D_010_1:5", rownames(survT) ] |
|
|
55 |
survT$dox15 <- 1-Biobase::exprs(lpdCLL)[ "D_159_1:5", rownames(survT) ] |
|
|
56 |
survT$flu15 <- 1-Biobase::exprs(lpdCLL)[ "D_006_1:5", rownames(survT) ] |
|
|
57 |
|
|
|
58 |
survT$SF3B1 <- Biobase::exprs(lpdCLL)[ "SF3B1", rownames(survT) ] |
|
|
59 |
survT$NOTCH1 <- Biobase::exprs(lpdCLL)[ "NOTCH1", rownames(survT) ] |
|
|
60 |
survT$BRAF <- Biobase::exprs(lpdCLL)[ "BRAF", rownames(survT) ] |
|
|
61 |
survT$TP53 <- Biobase::exprs(lpdCLL)[ "TP53", rownames(survT) ] |
|
|
62 |
survT$del17p13 <- Biobase::exprs(lpdCLL)[ "del17p13", rownames(survT) ] |
|
|
63 |
survT$del11q22.3 <- Biobase::exprs(lpdCLL)[ "del11q22.3", rownames(survT) ] |
|
|
64 |
survT$trisomy12 <- Biobase::exprs(lpdCLL)[ "trisomy12", rownames(survT) ] |
|
|
65 |
survT$IGHV_cont <- patmeta[ rownames(survT) ,"IGHV Uppsala % SHM"] |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
# competinting risk endpoint fpr |
|
|
69 |
survT$compE <- ifelse(survT$treatedAfter == TRUE, 1, 0) |
|
|
70 |
survT$compE <- ifelse(survT$treatedAfter == FALSE & survT$died==TRUE, |
|
|
71 |
2, survT$compE ) |
|
|
72 |
survT$T7 <- ifelse(survT$compE == 1, survT$T5, survT$T6 ) |
|
|
73 |
``` |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
## Univariate survival analysis |
|
|
77 |
|
|
|
78 |
### Define forest functions |
|
|
79 |
|
|
|
80 |
```{r forest} |
|
|
81 |
forest <- function(Time, endpoint, title, sdrugs, split, sub) { |
|
|
82 |
stopifnot(is.character(Time), is.character(title), is.character(split), |
|
|
83 |
is.character(endpoint), |
|
|
84 |
all(c(Time, split, endpoint) %in% colnames(survT)), |
|
|
85 |
is.logical(survT[[endpoint]]), |
|
|
86 |
is.character(sdrugs), !is.null(names(sdrugs))) |
|
|
87 |
|
|
|
88 |
clrs <- fpColors(box="royalblue",line="darkblue", summary="royalblue") |
|
|
89 |
|
|
|
90 |
res <- lapply(sdrugs, function(g) { |
|
|
91 |
drug <- survT[, g] * 10 |
|
|
92 |
|
|
|
93 |
suse <- if (identical(sub, "none")) |
|
|
94 |
rep(TRUE, nrow(survT)) |
|
|
95 |
else |
|
|
96 |
(survT[[split]] == sub) |
|
|
97 |
stopifnot(sum(suse, na.rm = TRUE) > 1) |
|
|
98 |
|
|
|
99 |
surv <- coxph(Surv(survT[,Time], survT[,endpoint]) ~ drug, subset=suse) |
|
|
100 |
sumsu <- summary(surv) |
|
|
101 |
c(p = sumsu[["coefficients"]][, "Pr(>|z|)"], |
|
|
102 |
coef = sumsu[["coefficients"]][, "exp(coef)"], |
|
|
103 |
lower = sumsu[["conf.int"]][, "lower .95"], |
|
|
104 |
higher = sumsu[["conf.int"]][, "upper .95"]) |
|
|
105 |
}) |
|
|
106 |
|
|
|
107 |
s <- do.call(rbind, res) |
|
|
108 |
rownames(s) <- names(sdrugs) |
|
|
109 |
|
|
|
110 |
tabletext <- list(c(NA, rownames(s)), append(list("p-value"), |
|
|
111 |
sprintf("%.4f", s[,"p"]))) |
|
|
112 |
|
|
|
113 |
forestplot(tabletext, |
|
|
114 |
rbind( |
|
|
115 |
rep(NA, 3), |
|
|
116 |
s[, 2:4]), |
|
|
117 |
page = new, |
|
|
118 |
clip = c(0.8,20), |
|
|
119 |
xlog = TRUE, xticks = c(0.5,1, 1.5), title = title, |
|
|
120 |
col = clrs, |
|
|
121 |
txt_gp = fpTxtGp(ticks = gpar(cex=1) ), |
|
|
122 |
new_page = TRUE) |
|
|
123 |
} |
|
|
124 |
``` |
|
|
125 |
|
|
|
126 |
Combine OS and TTT in one plot. |
|
|
127 |
```{r forest-together} |
|
|
128 |
|
|
|
129 |
com <- function( Time, endpoint, scaleX, sub, d, split, drug_names) { |
|
|
130 |
|
|
|
131 |
res <- lapply(d, function(g) { |
|
|
132 |
|
|
|
133 |
drug <- survT[,g] * scaleX |
|
|
134 |
## all=99, M-CLL=1, U-CLL=0 |
|
|
135 |
if(sub==99) { surv <- coxph(Surv(survT[,paste0(Time)], |
|
|
136 |
survT[,paste0(endpoint)] == TRUE) ~ drug)} |
|
|
137 |
if(sub<99) { surv <- coxph(Surv(survT[,paste0(Time)], |
|
|
138 |
survT[,paste0(endpoint)] == TRUE) ~ drug, |
|
|
139 |
subset=survT[,paste0(split)]==sub)} |
|
|
140 |
|
|
|
141 |
c(summary(surv)[[7]][,5], summary(surv)[[7]][,2], |
|
|
142 |
summary(surv)[[8]][,3], |
|
|
143 |
summary(surv)[[8]][,4]) |
|
|
144 |
}) |
|
|
145 |
s <- do.call(rbind, res) |
|
|
146 |
colnames(s) <- c("p", "HR", "lower", "higher") |
|
|
147 |
rownames(s) <- drug_names |
|
|
148 |
s |
|
|
149 |
} |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
fp <- function( sub, title, d, split, drug_names, a, b, scaleX) { |
|
|
153 |
ttt <- com(Time="T5", endpoint="treatedAfter", sub=sub, d=d, |
|
|
154 |
split=split, drug_names=drug_names, scaleX=scaleX) |
|
|
155 |
rownames(ttt) <- paste0(rownames(ttt), "_TTT") |
|
|
156 |
|
|
|
157 |
os <- com(Time="T6", endpoint="died", sub=sub, d=d, split=split, |
|
|
158 |
drug_names=drug_names, scaleX=scaleX) |
|
|
159 |
rownames(os) <- paste0(rownames(os), "_OS") |
|
|
160 |
|
|
|
161 |
n <- c( p=NA, HR=NA, lower=NA, higher=NA ) |
|
|
162 |
nn <- t( data.frame( n ) ) |
|
|
163 |
for (i in 1:(nrow(ttt)-1) ) { nn <-rbind(nn, n ) } |
|
|
164 |
rownames(nn) <- drug_names |
|
|
165 |
|
|
|
166 |
od <- order( c(seq(nrow(nn)), seq(nrow(ttt)), seq(nrow(os)) )) |
|
|
167 |
|
|
|
168 |
s <- data.frame( rbind(nn, ttt, os)[od, ] ) |
|
|
169 |
s$Name <- rownames(s) |
|
|
170 |
s$x <- 1:nrow(s) |
|
|
171 |
s$col <- rep(c("white", "black", "darkgreen"), nrow(ttt) ) |
|
|
172 |
s$Endpoint <- factor( c(rep("nn", nrow(nn) ), rep("TTT", nrow(ttt) ), |
|
|
173 |
rep("OS", nrow(os) ) )[od] ) |
|
|
174 |
s$features <- ""; s[ which(s$Endpoint=="OS"),"features"] <- drug_names |
|
|
175 |
s[which(s$Endpoint=="nn"), "Endpoint"] <- "" |
|
|
176 |
s <- rbind(s, rep(NA, 8)) |
|
|
177 |
|
|
|
178 |
p <- ggplot(data=s ,aes(x=x, y=HR, ymin=lower, ymax=higher, |
|
|
179 |
colour=Endpoint)) + geom_pointrange() + |
|
|
180 |
theme(legend.position="top", legend.text = element_text(size = 20) ) + |
|
|
181 |
scale_x_discrete(limits=s$x, labels=s$features ) + |
|
|
182 |
expand_limits(y=c(a,b)) + |
|
|
183 |
scale_y_log10(breaks=c(0.01,0.1,0.5,1,2,5,10), |
|
|
184 |
labels=c(0.01,0.1,0.5,1,2,5,10)) + |
|
|
185 |
theme( |
|
|
186 |
panel.grid.minor = element_blank(), |
|
|
187 |
axis.title.x = element_text(size=16), |
|
|
188 |
axis.text.x = element_text(size=16, colour="black"), |
|
|
189 |
axis.title.y = element_blank(), |
|
|
190 |
axis.text.y = element_text(size=12, colour="black"), |
|
|
191 |
legend.key = element_rect(fill = "white"), |
|
|
192 |
legend.background = element_rect(fill = "white"), |
|
|
193 |
legend.title = element_blank(), |
|
|
194 |
panel.background = element_rect(fill = "white", color="black"), |
|
|
195 |
panel.grid.major = element_blank(), |
|
|
196 |
axis.ticks.y = element_blank() |
|
|
197 |
) + |
|
|
198 |
coord_flip() + |
|
|
199 |
scale_color_manual(values=c("OS"="darkgreen", "TTT"="black"), |
|
|
200 |
labels=c("OS", "TTT", "")) + |
|
|
201 |
geom_hline(aes(yintercept=1), colour="black", size=1.5, |
|
|
202 |
linetype="dashed", alpha=0.3) + |
|
|
203 |
annotate("text", x = 1:nrow(s)+0.5, y = s$HR+0.003, |
|
|
204 |
label = ifelse( s$p<0.001, paste0("p<","0.001"), |
|
|
205 |
paste0("p=", round(s$p,3) ) ), colour=s$col) |
|
|
206 |
plot(p) |
|
|
207 |
} |
|
|
208 |
``` |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
### Forest plot for genetic factors |
|
|
212 |
|
|
|
213 |
```{r Fig5A, fig.path=plotDir, fig.width=5.55, fig.height=( (1+8*1.2) ), dev = c("png", "pdf"), warning=FALSE} |
|
|
214 |
#FIG# S27 |
|
|
215 |
d <- c("SF3B1", "NOTCH1", "BRAF", "TP53", "del17p13", "del11q22.3", |
|
|
216 |
"trisomy12", "IGHV") |
|
|
217 |
drug_names <- c("SF3B1", "NOTCH1", "BRAF", "TP53", "del17p13", "del11q22.3", |
|
|
218 |
"Trisomy12" ,"IGHV") |
|
|
219 |
|
|
|
220 |
fp(sub=99, d=d, drug_names=drug_names, split="IGHV", title="", a=0, b=10, |
|
|
221 |
scaleX=1) |
|
|
222 |
``` |
|
|
223 |
|
|
|
224 |
### Forest plot for drug responses |
|
|
225 |
|
|
|
226 |
```{r Fig5B, fig.path=plotDir, fig.width=6.0, fig.height=( (1+8*1.2) ), dev = c("png", "pdf"), warning=FALSE} |
|
|
227 |
#FIG# 6A |
|
|
228 |
d <- c("flu15", "nut15", "dox15", "ibr45", "ide45", "prt45", "selu45", |
|
|
229 |
"ever45") |
|
|
230 |
drug_names <- c("Fludarabine", "Nutlin-3", "Doxorubicine", "Ibrutinib", |
|
|
231 |
"Idelalisib", "PRT062607 HCl", "Selumetinib" ,"Everolimus") |
|
|
232 |
|
|
|
233 |
fp(sub=99, d=d, drug_names=drug_names, split="TP53", title="", a=0, b=5, |
|
|
234 |
scaleX=10) |
|
|
235 |
``` |
|
|
236 |
|
|
|
237 |
## Kaplan-Meier curves |
|
|
238 |
|
|
|
239 |
### Genetics factors |
|
|
240 |
|
|
|
241 |
```{r SFig_genetics1, fig.path=plotDir, fig.width = 8.46, fig.height = 4.5, dev = c("png", "pdf")} |
|
|
242 |
#FIG# S27 left (top+bottom) |
|
|
243 |
par(mfcol=c(1,2)) |
|
|
244 |
|
|
|
245 |
for (fac in paste(c("IGHV", "TP53"))) { |
|
|
246 |
survplot( Surv(survT$T5, survT$treatedAfter == TRUE) ~ as.factor(survT[,fac]), |
|
|
247 |
snames=c("wt", "mut"), |
|
|
248 |
lwd=1.5, cex.axis = 1, cex.lab=1, col= c("darkmagenta", "dodgerblue4"), |
|
|
249 |
show.nrisk = FALSE, |
|
|
250 |
legend.pos = FALSE, stitle = "", hr.pos= "topright", |
|
|
251 |
main = paste(fac), |
|
|
252 |
xlab = 'Time (Years)', ylab = 'Time to treatment') |
|
|
253 |
} |
|
|
254 |
``` |
|
|
255 |
|
|
|
256 |
```{r SFig_genetics2, fig.path=plotDir, fig.width = 8.46, fig.height = 4.5, dev = c("png", "pdf")} |
|
|
257 |
#FIG# 6B left |
|
|
258 |
#FIG# S27 right (top+bottom) |
|
|
259 |
par(mfcol=c(1,2)) |
|
|
260 |
|
|
|
261 |
for (fac in paste(c("IGHV", "TP53"))) { |
|
|
262 |
survplot( Surv(survT$T6, survT$died == TRUE) ~ as.factor(survT[,fac]), |
|
|
263 |
snames=c("wt", "mut"), |
|
|
264 |
lwd=1.5, cex.axis = 1.0, cex.lab=1.0, col= c("darkmagenta", "dodgerblue4"), |
|
|
265 |
show.nrisk = FALSE, |
|
|
266 |
legend.pos = FALSE, stitle = "", hr.pos= "bottomleft", |
|
|
267 |
main = paste(fac), |
|
|
268 |
xlab = 'Time (Years)', ylab = 'Overall survival') |
|
|
269 |
} |
|
|
270 |
``` |
|
|
271 |
|
|
|
272 |
|
|
|
273 |
### Drug responses |
|
|
274 |
|
|
|
275 |
Drug responses were dichotomized using maximally selected rank statistics. The analysis is also perforemd within subgroups: TP53 wt/ mut. and IGHV wt/ mut. |
|
|
276 |
|
|
|
277 |
```{r KM, echo=FALSE} |
|
|
278 |
km <- function(drug, split, title, t, hr, c) { |
|
|
279 |
stopifnot(is.character(drug), length(drug)==1, is.character(title), |
|
|
280 |
length(title)==3) |
|
|
281 |
|
|
|
282 |
surv <- survT[!(is.na(survT[,split])), ] |
|
|
283 |
k <- Biobase::exprs(lpdCLL)[ drug, rownames(surv) ] |
|
|
284 |
|
|
|
285 |
ms5 <- maxstat.test(Surv(T5, treatedAfter) ~ k, |
|
|
286 |
data = surv, |
|
|
287 |
smethod = "LogRank", |
|
|
288 |
minprop = 0.2, |
|
|
289 |
maxprop = 0.8, |
|
|
290 |
alpha = NULL) |
|
|
291 |
ms6 <- maxstat.test(Surv(T6, died) ~ k, |
|
|
292 |
data = surv, |
|
|
293 |
smethod = "LogRank", |
|
|
294 |
minprop = 0.2, |
|
|
295 |
maxprop = 0.8, |
|
|
296 |
alpha = NULL) |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
# median & TTT |
|
|
300 |
if (c=="med" & t=="TTT") { |
|
|
301 |
surv$cutA <- ifelse( |
|
|
302 |
k >= median( k[which(!(is.na(surv$T5)) ) ] ), "weak", "good") |
|
|
303 |
surv$cutM <- ifelse( |
|
|
304 |
k >= median( k[ which( surv[,paste0(split)]==1 & !(is.na(surv$T5)) ) ], |
|
|
305 |
na.rm=TRUE ), "weak", "good") |
|
|
306 |
surv$cutU <- ifelse( |
|
|
307 |
k >= median( k[ which( surv[,paste0(split)]==0 & !(is.na(surv$T5)) ) ], |
|
|
308 |
na.rm=TRUE ), "weak", "good") |
|
|
309 |
|
|
|
310 |
} |
|
|
311 |
|
|
|
312 |
# median & OS |
|
|
313 |
if (c=="med" & t=="OS") { |
|
|
314 |
surv$cutA <- ifelse(k >= median(k), "weak", "good") |
|
|
315 |
surv$cutM <- ifelse(k >= median( k[ which( surv[,paste0(split)]==1 ) ] ), |
|
|
316 |
"weak", "good") |
|
|
317 |
surv$cutU <- ifelse(k >= median( k[ which( surv[,paste0(split)]==0 ) ] ), |
|
|
318 |
"weak", "good") |
|
|
319 |
} |
|
|
320 |
|
|
|
321 |
#TTT & maxstat |
|
|
322 |
if (c=="maxstat" & t=="TTT") { |
|
|
323 |
surv$cutA <- surv$cut5 <- ifelse(k >= ms5$estimate, "weak", "good") |
|
|
324 |
surv$cutM <- surv$cut5 <- ifelse(k >= ms5$estimate, "weak", "good") |
|
|
325 |
surv$cutU <- surv$cut5 <- ifelse(k >= ms5$estimate, "weak", "good") |
|
|
326 |
} |
|
|
327 |
|
|
|
328 |
#OS & maxstat |
|
|
329 |
if (c=="maxstat" & t=="OS") { |
|
|
330 |
surv$cutA <- surv$cut5 <- ifelse(k >= ms6$estimate, "weak", "good") |
|
|
331 |
surv$cutM <- surv$cut5 <- ifelse(k >= ms6$estimate, "weak", "good") |
|
|
332 |
surv$cutU <- surv$cut5 <- ifelse(k >= ms6$estimate, "weak", "good") |
|
|
333 |
} |
|
|
334 |
|
|
|
335 |
drName <- toCaps(drugs[stripConc(drug), "name"]) |
|
|
336 |
|
|
|
337 |
sp <- function(...) |
|
|
338 |
survplot(..., |
|
|
339 |
lwd = 3, cex.axis = 1.2, cex.lab = 1.5, |
|
|
340 |
col= c("royalblue", "darkred"), show.nrisk = FALSE, |
|
|
341 |
legend.pos = FALSE, stitle = "", |
|
|
342 |
hr.pos=ifelse(hr=="bl", "bottomleft", "topright" ), |
|
|
343 |
xlab = 'Time (Years)') |
|
|
344 |
|
|
|
345 |
if (t=="TTT") { |
|
|
346 |
yl <- "Fraction w/o treatment" |
|
|
347 |
if (c=="med"){ |
|
|
348 |
cat(sprintf("%s median-cutpoint for TTT: %5.2g\n", |
|
|
349 |
drName, median(k) ) ) } else |
|
|
350 |
{ cat(sprintf("%s cutpoint for TTT: %5.2g\n", drName, |
|
|
351 |
ms5$estimate )) } |
|
|
352 |
|
|
|
353 |
sp(Surv(surv$T5, surv$treatedAfter) ~ surv$cutA, |
|
|
354 |
subset = rep(TRUE, nrow(surv)), ylab = yl, main = drName) |
|
|
355 |
sp(Surv(surv$T5, surv$treatedAfter) ~ surv$cutM, |
|
|
356 |
subset = surv[, split]==1, ylab = yl, |
|
|
357 |
main = paste(drName, title[1], title[3])) |
|
|
358 |
sp(Surv(surv$T5, surv$treatedAfter) ~ surv$cutU, |
|
|
359 |
subset = surv[ ,split]==0, ylab = yl, |
|
|
360 |
main = paste(drName, title[1], title[2])) } |
|
|
361 |
# OS |
|
|
362 |
else { |
|
|
363 |
yl <- "Fraction overall survival" |
|
|
364 |
if (c=="med"){ |
|
|
365 |
cat(sprintf("%s median-cutpoint for OS: %5.2g\n", |
|
|
366 |
drName, median(k) ) ) } else { |
|
|
367 |
cat(sprintf("%s cutpoint for OS: %5.2g\n", |
|
|
368 |
drName, ms6$estimate ))} |
|
|
369 |
sp(Surv(surv$T6, surv$died) ~ surv$cutA, |
|
|
370 |
subset = rep(TRUE, nrow(surv)), ylab = yl, main = drName) |
|
|
371 |
sp(Surv(surv$T6, surv$died) ~ surv$cutM, |
|
|
372 |
subset = surv[, split]==1, ylab = yl, |
|
|
373 |
main = paste(drName, title[1], title[3])) |
|
|
374 |
sp(Surv(surv$T6, surv$died) ~ surv$cutU, |
|
|
375 |
subset = surv[ ,split]==0, ylab = yl, |
|
|
376 |
main = paste(drName, title[1], title[2])) |
|
|
377 |
} |
|
|
378 |
} |
|
|
379 |
``` |
|
|
380 |
|
|
|
381 |
|
|
|
382 |
Time to next treatment (maxstat). |
|
|
383 |
```{r KM-TTT-maxstat, fig.path=plotDir, fig.width = 10, fig.height = 3.3, dev = c("png", "pdf")} |
|
|
384 |
par(mfrow=c(1,3), mar=c(5,5,2,0.9)) |
|
|
385 |
km(drug = "D_006_1:5", split = "TP53", t="TTT", |
|
|
386 |
title=c("(TP53", "wt)", "mut)"), hr="tr", c="maxstat") |
|
|
387 |
km(drug = "D_159_1:5", split = "TP53", t="TTT", |
|
|
388 |
title=c("(TP53", "wt)", "mut)"), hr="tr", c="maxstat") |
|
|
389 |
km(drug = "D_010_1:5", split = "TP53", t="TTT", |
|
|
390 |
title=c("(TP53", "wt)", "mut)"), hr="tr", c="maxstat") |
|
|
391 |
|
|
|
392 |
km(drug = "D_002_4:5", split = "IGHV", t="TTT", |
|
|
393 |
title=c("(IGHV", "wt)" , "mut)"), hr="tr", c="maxstat" ) |
|
|
394 |
km(drug = "D_003_4:5", split = "IGHV", t="TTT", |
|
|
395 |
title=c("(IGHV", "wt)" , "mut)"), hr="tr", c="maxstat" ) |
|
|
396 |
km(drug = "D_166_4:5", split = "IGHV", t="TTT", |
|
|
397 |
title=c("(IGHV", "wt)" , "mut)"), hr="tr", c="maxstat" ) |
|
|
398 |
``` |
|
|
399 |
|
|
|
400 |
Overall survival (maxstat). |
|
|
401 |
```{r KM-OS-maxstat, fig.path=plotDir, fig.width = 10, fig.height = 3.3, dev = c("png", "pdf")} |
|
|
402 |
par(mfrow=c(1,3), mar=c(5,5,2,0.9)) |
|
|
403 |
km(drug = "D_006_1:5", split = "TP53", t="OS", |
|
|
404 |
title=c("(TP53", "wt)", "mut)"), hr="bl", c="maxstat") |
|
|
405 |
|
|
|
406 |
#FIG# 6B right |
|
|
407 |
#FIG# 6C |
|
|
408 |
km(drug = "D_159_1:5", split = "TP53", t="OS", # doxorubicine |
|
|
409 |
title=c("(TP53", "wt)", "mut)"), hr="bl", c="maxstat" ) |
|
|
410 |
|
|
|
411 |
#FIG# 6B middle |
|
|
412 |
km(drug = "D_010_1:5", split = "TP53", t="OS", # nutlin-3 |
|
|
413 |
title=c("(TP53", "wt)", "mut)"), hr="bl", c="maxstat" ) |
|
|
414 |
|
|
|
415 |
km(drug = "D_002_4:5", split = "IGHV", t="OS", |
|
|
416 |
title=c("(IGHV", "wt)" , "mut)"), hr="bl", c="maxstat" ) |
|
|
417 |
km(drug = "D_003_4:5", split = "IGHV", t="OS", |
|
|
418 |
title=c("(IGHV", "wt)" , "mut)"), hr="bl", c="maxstat" ) |
|
|
419 |
km(drug = "D_166_4:5", split = "IGHV", t="OS", |
|
|
420 |
title=c("(IGHV", "wt)" , "mut)"), hr="bl", c="maxstat" ) |
|
|
421 |
``` |
|
|
422 |
|
|
|
423 |
|
|
|
424 |
## Multivariate Cox-model |
|
|
425 |
|
|
|
426 |
```{r extract} |
|
|
427 |
extractSome <- function(x) { |
|
|
428 |
sumsu <- summary(x) |
|
|
429 |
data.frame( |
|
|
430 |
`p-value` = |
|
|
431 |
sprintf("%6.3g", sumsu[["coefficients"]][, "Pr(>|z|)"]), |
|
|
432 |
`HR` = |
|
|
433 |
sprintf("%6.3g", signif( sumsu[["coefficients"]][, "exp(coef)"], 2) ), |
|
|
434 |
`lower 95% CI` = |
|
|
435 |
sprintf("%6.3g", signif( sumsu[["conf.int"]][, "lower .95"], 2) ), |
|
|
436 |
`upper 95% CI` = |
|
|
437 |
sprintf("%6.3g", signif( sumsu[["conf.int"]][, "upper .95"], 2), |
|
|
438 |
check.names = FALSE) ) |
|
|
439 |
} |
|
|
440 |
``` |
|
|
441 |
|
|
|
442 |
Define covariates and effects. |
|
|
443 |
```{r covariates, echo=FALSE} |
|
|
444 |
survT$age <- survT$age/10 |
|
|
445 |
survT$IC50beforeTreatment <- ifelse(survT$IC50beforeTreatment==TRUE, 1, 0) |
|
|
446 |
survT$IGHVwt <- ifelse(survT$IGHV==1, 0, 1) |
|
|
447 |
|
|
|
448 |
survT$flu15 <- survT$flu15*10 |
|
|
449 |
survT$dox15 <- survT$dox15*10 |
|
|
450 |
|
|
|
451 |
survT$ibr45 <- survT$ibr45*10 |
|
|
452 |
survT$ide45 <- survT$ide45*10 |
|
|
453 |
survT$prt45 <- survT$prt45*10 |
|
|
454 |
``` |
|
|
455 |
|
|
|
456 |
|
|
|
457 |
### Chemotherapies |
|
|
458 |
|
|
|
459 |
#### Fludarabine |
|
|
460 |
```{r} |
|
|
461 |
surv1 <- coxph( |
|
|
462 |
Surv(T6, died) ~ |
|
|
463 |
age + |
|
|
464 |
as.factor(IC50beforeTreatment) + |
|
|
465 |
as.factor(trisomy12) + |
|
|
466 |
as.factor(del11q22.3) + |
|
|
467 |
as.factor(del17p13) + |
|
|
468 |
as.factor(TP53) + |
|
|
469 |
IGHVwt + |
|
|
470 |
flu15, # continuous |
|
|
471 |
#dox15 + # continuous |
|
|
472 |
#flu15:TP53, |
|
|
473 |
#TP53:dox15, |
|
|
474 |
data = survT ) |
|
|
475 |
extractSome(surv1) |
|
|
476 |
|
|
|
477 |
cat(sprintf("%s patients considerd in the model; number of events %1g\n", |
|
|
478 |
summary(surv1)$n, summary(surv1)[6] ) ) |
|
|
479 |
``` |
|
|
480 |
|
|
|
481 |
```{r echo=FALSE, results='hide', eval=FALSE} |
|
|
482 |
write(print(xtable(extractSome(surv1))), file=paste0(plotDir,"flu_MD.tex")) |
|
|
483 |
``` |
|
|
484 |
|
|
|
485 |
#### Doxorubicine |
|
|
486 |
|
|
|
487 |
```{r} |
|
|
488 |
surv2 <- coxph( |
|
|
489 |
Surv(T6, died) ~ #as.factor(survT$TP53) , data=survT ) |
|
|
490 |
age + |
|
|
491 |
as.factor(IC50beforeTreatment) + |
|
|
492 |
as.factor(trisomy12) + |
|
|
493 |
as.factor(del11q22.3) + |
|
|
494 |
as.factor(del17p13) + |
|
|
495 |
as.factor(TP53) + |
|
|
496 |
IGHVwt + |
|
|
497 |
#flu15 + # continuous |
|
|
498 |
dox15 , # continuous |
|
|
499 |
#flu15:TP53 , |
|
|
500 |
#TP53:dox15, |
|
|
501 |
data = survT ) |
|
|
502 |
extractSome(surv2) |
|
|
503 |
|
|
|
504 |
cat(sprintf("%s patients considerd in the model; number of events %1g\n", |
|
|
505 |
summary(surv2)$n, summary(surv2)[6] ) ) |
|
|
506 |
``` |
|
|
507 |
|
|
|
508 |
```{r echo=FALSE, results='hide', eval=FALSE} |
|
|
509 |
write(print(xtable(extractSome(surv2))), file=paste0(plotDir,"dox_MD.tex")) |
|
|
510 |
``` |
|
|
511 |
|
|
|
512 |
### Targeted therapies |
|
|
513 |
|
|
|
514 |
#### Ibrutinib TTT |
|
|
515 |
|
|
|
516 |
```{r} |
|
|
517 |
surv4 <- coxph( |
|
|
518 |
Surv(T5, treatedAfter) ~ |
|
|
519 |
age + |
|
|
520 |
as.factor(IC50beforeTreatment) + |
|
|
521 |
as.factor(trisomy12) + |
|
|
522 |
as.factor(del11q22.3) + |
|
|
523 |
as.factor(del17p13) + |
|
|
524 |
IGHVwt + |
|
|
525 |
ibr45 + |
|
|
526 |
IGHVwt:ibr45, |
|
|
527 |
data = survT ) |
|
|
528 |
|
|
|
529 |
extractSome(surv4) |
|
|
530 |
|
|
|
531 |
cat(sprintf("%s patients considerd in the model; number of events %1g\n", |
|
|
532 |
summary(surv4)$n, summary(surv4)[6] ) ) |
|
|
533 |
``` |
|
|
534 |
|
|
|
535 |
```{r echo=FALSE, results='hide', eval=FALSE} |
|
|
536 |
write(print(xtable(extractSome(surv4))), file=paste0(plotDir,"ibr_TTT.tex")) |
|
|
537 |
``` |
|
|
538 |
|
|
|
539 |
#### Idelalisib TTT |
|
|
540 |
|
|
|
541 |
```{r} |
|
|
542 |
surv6 <- coxph( |
|
|
543 |
Surv(T5, treatedAfter) ~ |
|
|
544 |
age + |
|
|
545 |
as.factor(IC50beforeTreatment) + |
|
|
546 |
as.factor(trisomy12) + |
|
|
547 |
as.factor(del11q22.3) + |
|
|
548 |
as.factor(del17p13) + |
|
|
549 |
IGHVwt + |
|
|
550 |
ide45 + |
|
|
551 |
IGHVwt:ide45, |
|
|
552 |
data = survT ) |
|
|
553 |
|
|
|
554 |
extractSome(surv6) |
|
|
555 |
|
|
|
556 |
cat(sprintf("%s patients considerd in the model; number of events %1g\n", |
|
|
557 |
summary(surv6)$n, summary(surv6)[6] ) ) |
|
|
558 |
``` |
|
|
559 |
|
|
|
560 |
```{r echo=FALSE, results='hide', eval=FALSE} |
|
|
561 |
write(print(xtable(extractSome(surv6))), file=paste0(plotDir,"ide_TTT.tex")) |
|
|
562 |
``` |
|
|
563 |
|
|
|
564 |
#### PRT062607 HCl TTT |
|
|
565 |
```{r} |
|
|
566 |
surv8 <- coxph( |
|
|
567 |
Surv(T5, treatedAfter) ~ |
|
|
568 |
age + |
|
|
569 |
as.factor(IC50beforeTreatment) + |
|
|
570 |
as.factor(trisomy12) + |
|
|
571 |
as.factor(del11q22.3) + |
|
|
572 |
as.factor(del17p13) + |
|
|
573 |
IGHVwt + |
|
|
574 |
prt45 + |
|
|
575 |
IGHVwt:prt45, |
|
|
576 |
data = survT ) |
|
|
577 |
|
|
|
578 |
extractSome(surv8) |
|
|
579 |
|
|
|
580 |
cat(sprintf("%s patients considerd in the model; number of events %1g\n", |
|
|
581 |
summary(surv8)$n, summary(surv8)[6] ) ) |
|
|
582 |
``` |
|
|
583 |
|
|
|
584 |
```{r echo=FALSE, results='hide', eval=FALSE} |
|
|
585 |
write(print(xtable(extractSome(surv8))), file=paste0(plotDir,"prt_TTT.tex")) |
|
|
586 |
``` |
|
|
587 |
|
|
|
588 |
|
|
|
589 |
```{r, include=!exists(".standalone"), eval=!exists(".standalone")} |
|
|
590 |
sessionInfo() |
|
|
591 |
``` |
|
|
592 |
|
|
|
593 |
```{r, message=FALSE, warning=FALSE, include=FALSE} |
|
|
594 |
rm(list=ls()) |
|
|
595 |
``` |