-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhelp.Rmd
2113 lines (1244 loc) · 84 KB
/
help.Rmd
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: 'geneSurv: an interactive tool for survival analysis in genomics research'
author: "Selcuk Korkmaz"
date: "February 3, 2017"
output:
html_document:
theme: united
toc: yes
toc_float: yes
pdf_document:
toc: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Abstract
Survival analysis is often used in cancer studies. It has been shown that combination of clinical data with genomics increases predictive performance of survival analysis methods. This tool provides a wide range of survival analysis methods for genomics research, especially in cancer studies. The tool includes analysis methods including Kaplan-Meier, Cox regression, Penalized Cox regression and Random Survival Forests. It also offers methods for optimal cutoff point determination for continuous markers.
Each procedure includes following features:
Kaplan-Meier: descriptive statistics, survival table, mean and median life time, hazard ratios, comparison tests including Log-rank, Gehan-Breslow, Tarone-Ware, Peto-Peto, Modified Peto-Peto, Flemington-Harrington, and interactive plots such as Kaplan-Meier curves and hazard plots.
Cox regression: coefficient estimates, hazard ratios, goodness of fit test, analysis of deviance, save predictions, save residuals, save Martingale residuals, save Schoenfeld residuals, save dfBetas, proportional hazard assumption test, and interactive plots including Schoenfeld residual plot and Log-Minus-Log plot.
Penalized Cox regression: feature selection using ridge, elastic net and lasso penalization. A cross-validation to investigate the relationship between partial likelihood devaince and lambda values.
Random survival forests: overall survival predictions (Nelson-Aalen estimator, overall ensemble), individual survival predictions (with OOB), individual cumulative hazard predictions (with OOB), error rate, feature selection, and interactive plots including random survival plot, cumulative hazard plot, error rate plot, Cox vs RSF plot
Optimal cutoff: determination of optimal cutoff value by maxmizing test statistics, including log-rank, Gehan-Breslow, Tarone-Ware, Peto-Peto, modified Peto-Peto, Flemington-Harrington.
---
output:
html_document: default
pdf_document: default
---
## 1.Data upload
This tool requires a dataset in `*.txt` format, which is seperated by `comma`, `semicolon`, `space` or `tab` delimiter. First row of dataset must include header. When the appropriate file is uploaded, the dataset will be appear immediately on the main page of the tool. Alternatively users can upload one of the example datasets provided within the tool for testing and understanding the operating logic of the tool.
<img src="images/dataUpload.jpg" alt="Data upload" align="middle" style="width:800px; height:200px;"/>
<img src="images/dataUploadHelp.jpg" alt="Data upload help" align="middle" style="width:800px; height:251px;"/>
### 1.1. Data Pre-processing
An important step of the data analysis in statistics is the data pre-processing. Users can perform some basic data pre-processing steps using this tool, including near zero filtering, centering, scaling and log-transformation (natural logarithm). To perform a data pre-processing; (1) check the "Pre-processing" box, (2) select "Survival time", "Status variable" and variables you wish to exclude from pre-processing (i.e. categorical variables), (3) select one or more pre-processing methods, including near zero filtering, centering, scaling and log-transformation, (4) click "Run pre-process" button to perform the pre-processing.
<img src="images/dataPreProcess2.jpg" alt="Data pre-processing" align="middle" style="width:800px; height:400px;"/>
After the pre-processing, all the selected pre-processing steps will be applied to the dataset and new data set will appear on the main panel of the tool. If there are any variables which have near zero variances, they will be excluded from the dataset and will appear in a new table.
<img src="images/dataPreProcess.jpg" alt="Data pre-processing" align="middle" style="width:800px; height:400px;"/>
## 2. Analysis Methods
### 2.1. Kaplan-Meier
#### Concept
Kaplan-Meier is a non-paranetric statistical method that is used to estimate survival probabilities and hazard ratios for a cohort study group. In clinical trials, it is often used to measure the part of patients living for a certain period of time after a treatment.
#### Variables
* `Survival time`: Time until an event occurs (i.e. days, weeks, months, years)
* `Status variable`: The event (i.e. death, disease, remission, recovery)
* `Category value for status variable`: Category value of the event of interest (i.e. 1, yes)
* `Factor variable`: A categorical variable which indicates different study groups (i.e. treatment, gender)
#### Usage
A Kaplan-Meier analysis can be conducted by applying the following steps:
1. Select the analysis method as `Kaplan Meier` from `Analysis` tab.
2. Select suitable variables for the analysis, such as `survival time`, `status variable`, `category value for status variable` and `factor variable`, if exists.
3. In advanced options, one can change confidence interval type, as log, log-log or plain, variance estimation method, as Greenwood or Tsiatis, Flemington-Harrington weights, confidence level and reference category, as first or last.
4. Click `Run` button to run the analysis.
<img src="images/survivalHelp.jpg" alt="Survival help" align="middle" style="width:800px; height:450px;"/>
#### Outputs
*Desired outputs can be selected by clicking Outputs checkbox. Available outputs are;*
```{r kaplanMeier, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE, include=FALSE}
setwd("~/Dropbox/GSD/Studies/Web-Tools(Devel)/geneSurv/")
library("survival")
library("KMsurv")
library("survMisc")
source("kaplanMeier.R")
library("highcharter")
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
km = kaplanMeier (survivalTime = "dmfs_time", statusVariable = "dmfs_event", status = 1, factors= "ER_IHC", survivalTable = TRUE, data = data)
```
#####a. Case summary
Summary statistics, such as number and percent of observations, events and censored cases can be obtained.
```{r kaplanMeierDescriptives, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE, include=TRUE}
desc = km$tableResult$caseSummary
descs = do.call(rbind.data.frame, desc)
DT::datatable(descs, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE
))
```
*
#####b. Survival table
A survival table can be created. First column in the table represents factor group and number of time points (i.e. 1.2 means second time point in the first factor group, likewise 2.1 means first time point in the second group). Second column is survival time, third column gives number of subjects at risk, fourth column is the number of events, fifth column represents the cumulative probability of surviving, sixth, seventh and eight columns are associated standard error, lower and upper limits, respectively.
```{r kaplanMeier2, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
stResult = km$testResult$survivalTable
stResults = do.call(rbind.data.frame, stResult)
DT::datatable(stResults, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip',buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE
))
```
#####c. Survival plot
A forest plot can be created for each level of factor group using survival probabilites at each end point.
```{r survivalPlot, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
surv = km$testResult$survivalTable[[names(km$testResult$hazardRatio)[1]]]
highchart() %>% hc_exporting(enabled = TRUE, filename = "survivalPlot") %>%
hc_add_series(name = "Survival", type = "line", data = surv$`Cumulative probability of surviving`, showInLegend = FALSE, zIndex = 1, marker = list(lineColor = "black", lineWidth = 1), lineWidth = 0, id = "survival") %>%
hc_add_series(name = "CI", data = as.matrix(cbind(surv$`Lower limit`, surv$`Upper limit`)),type = "errorbar", names = "Limits", showInLegend = FALSE, zIndex = 0, lineWidth = 1.5, linkedTo = "survival") %>%
hc_chart(zoomType = "xy", inverted = TRUE) %>%
hc_xAxis(categories = as.character(surv$Time), title = list(text = "Time")) %>%
hc_yAxis(startOnTick = FALSE, endOnTick = FALSE, title = list(text = "Survival")) %>%
#hc_plotOptions(tooltip = list(headerFormat = "<b>Time: </b>{point.x}")) %>%
hc_tooltip(crosshairs = TRUE, shared = TRUE, headerFormat = "<b>Time: </b>{point.x} <br>") %>%
hc_plotOptions(line = list(tooltip = list(pointFormat = "<b>{series.name}: </b>{point.y:.3f} ")),
errorbar = list(tooltip = list(pointFormat = "({point.low} - {point.high})"))) %>%
hc_add_theme(hc_theme_google())
```
*
#####d. Mean and Median life time
Mean and median life time and their associated confidence levels can be calculated for each level of factor group.
```{r medianAndMedianLifeTime, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
mst = km$tableResult$meanMedianSurvivalTimes
rownames(mst) = mst$Factor
mstResults = mst[-1]
DT::datatable(mstResults, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE
))
```
*
#####e. Hazard ratio
Hazard ratios and their respective lower and upper limits can be calculated for each factor group at each end point.
```{r hazardRatioKaplanMeier, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
hrResult = km$testResult$hazardRatio
hrResults = do.call(rbind.data.frame, hrResult)
DT::datatable(hrResults, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE
))
```
*
#####f. Hazard plot
A forest plot can be created for each level of factor group using hazard ratios at each end point.
```{r hazardPlot, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
hazard = km$testResult$hazardRatio[[names(km$testResult$hazardRatio)[1]]]
highchart() %>% hc_exporting(enabled = TRUE, filename = "hazardPlot") %>%
hc_add_series(name = "Hazard", type = "line", data = hazard$Hazard.Ratio, showInLegend = FALSE, zIndex = 1, marker = list(lineColor = "black", lineWidth = 1), lineWidth = 0, id = "hazard") %>%
hc_add_series(name = "CI", data = as.matrix(cbind(hazard$Lower, hazard$Upper)),type = "errorbar", names = "Limits", showInLegend = FALSE, zIndex = 0, lineWidth = 1.5, linkedTo = "hazard") %>%
hc_chart(zoomType = "xy", inverted = TRUE) %>%
hc_xAxis(categories = as.character(hazard$Time), title = list(text = "Time")) %>%
hc_yAxis(startOnTick = FALSE, endOnTick = FALSE, title = list(text = "Hazard Ratio")) %>%
#hc_plotOptions(tooltip = list(headerFormat = "<b>Time: </b>{point.x}")) %>%
hc_tooltip(crosshairs = TRUE, shared = TRUE, headerFormat = "<b>Time: </b>{point.x} <br>") %>%
hc_plotOptions(line = list(tooltip = list(pointFormat = "<b>{series.name}: </b>{point.y:.3f} ")),
errorbar = list(tooltip = list(pointFormat = "({point.low} - {point.high})"))) %>%
hc_add_theme(hc_theme_google())
```
#####g. Comparison tests
Six different comparison tests can be calculated for testing the differences in survival probability estimations between factor groups.
```{r comparisonTestsKaplanMeier, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
compTestResult = km$testResult$testResults
DT::datatable(compTestResult, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
*
#####h. Plots
<img src="images/survivalHelpKMplots.jpg" alt="Survival plots help" align="middle" style="width:800px; height:450px;"/>
```{r coxPlots, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE, include=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
km = kaplanMeier (survivalTime = "dmfs_time", statusVariable = "dmfs_event", status = 1, factors= "ER_IHC", survivalTable = TRUE, data = data)
survivalTime = "dmfs_time"
statusVariable = "dmfs_event"
status = 1
fctr = "ER_IHC"
ci = "log"
varianceEstimation = "greenwood"
confidenceLevel = 95
factors = fctr
if(!is.null(survivalTime)){
survivalTime = as.matrix(data[, survivalTime, drop = FALSE])
}
if(!is.null(factors)){
factors = as.factor(data[, factors])
}
if(!is.null(factors)){
factorsName = data[, factors, drop = FALSE]
}
if(!is.null(statusVariable)){
statusVariable = data[, statusVariable]
}
if(!is.null(status)){
if(is.numeric(status)){status = as.numeric(status)}else{status = as.factor(status)}
}
if(!is.null(factors)){
newData = data.frame(id =seq(1,dim(survivalTime)[1], 1), survivalTime= survivalTime,
statusVar=statusVariable,factor = factors)
newData = newData[complete.cases(newData),]
colnames(newData) = c("id","time","statusVar", "factor")
}else{
newData = data.frame(id =seq(1,dim(survivalTime)[1], 1), survivalTime= survivalTime,
statusVar=statusVariable)
newData = newData[complete.cases(newData),]
colnames(newData) = c("id", "time", "statusVar")
}
newData$statusVar = newData$statusVar%in%status
#data[,input$survivalTimeKM] = as.numeric(data[,input$survivalTimeKM])
#data[,input$factorVarKM] = as.factor(data[,input$factorVarKM])
if(!is.null(fctr)){
compareCurves <- survfit(Surv(time, statusVar == TRUE) ~ factors, data = newData, conf.type = ci, error = varianceEstimation, conf.int = confidenceLevel/100)
for(i in 1:length(names(compareCurves$strata))) {
names(compareCurves$strata)[i] = gsub("factors", "ER_IHC", names(compareCurves$strata)[i])
}
}else{
compareCurves <- survfit(Surv(time, statusVar == TRUE) ~ 1, data = newData, conf.type = ci, error = varianceEstimation, conf.int = confidenceLevel/100)
}
enabledLegend = TRUE
is.even <- function(x) x %% 2 == 0
ranges = TRUE
```
##### i. Kaplan-Meier curve
Kaplan-Meier curves can be created. A number of edit options is also available for plots.
```{r kmPlots, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
p = hchart(compareCurves, ranges = ranges, type = "line", markTimes = TRUE,
animation = TRUE)
p %>% hc_title(text = "Kaplan-Meier Plot") %>%
hc_xAxis(title = list(text = "Time"), tickInterval=NULL, tickLength = 5, lineWidth = 1) %>%
hc_yAxis(title = list(text = "Survival Probability"), lineWidth = 1, tickLength = 5, tickWidth= 1, labels = list(format = "{value:.2f}")) %>%
#hc_colors("#440154") %>%
hc_add_theme(hc_theme_gridlight()) %>%
hc_chart(backgroundColor = "white", zoomType = "xy") %>%
hc_legend(enabled = TRUE) %>%
hc_plotOptions(line = list(dashStyle = "Solid"), area = list(zIndex = 15), series = list(enableMouseTracking = TRUE)) %>%
hc_tooltip(shared = TRUE, crosshairs = TRUE, valueDecimals = 3, followTouchMove = FALSE, headerFormat = "<b>Time</b>: {point.key} <br>")#, pointFormat = "{series.name}: {point.y}")
```
##### j. Hazard plot
Hazard plot can be created. A number of edit options is also available for plots.
```{r hazardPlots, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
p <- hchart(compareCurves, fun = "cumhaz", ranges = ranges, type = "line", markTimes = TRUE,
animation = TRUE)
p %>% hc_title(text = "Hazard Plot") %>%
hc_xAxis(title = list(text = "Time"), tickInterval=NULL, tickLength = 5, lineWidth = 1) %>%
hc_yAxis(title = list(text = "Cumulative Hazard"), lineWidth = 1, tickLength = 5, tickWidth= 1, labels = list(format = "{value:.2f}")) %>%
#hc_colors("#440154") %>%
hc_add_theme(hc_theme_gridlight()) %>%
hc_chart(backgroundColor = "white", zoomType = "xy") %>%
hc_legend(enabled = TRUE) %>%
hc_plotOptions(line = list(dashStyle = "Solid"), area = list(zIndex = 15), series = list(enableMouseTracking = TRUE)) %>%
hc_tooltip(shared = TRUE, crosshairs = TRUE, valueDecimals = 3, followTouchMove = FALSE, headerFormat = "<b>Time</b>: {point.key} <br>")#, pointFormat = "{series.name}: {point.y}")
```
##### k. Log-Minus-Log plot
Log-Minus-Log plot can be created. A number of edit options is also available for plots.
```{r lmlPlots, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
p <- hchart(compareCurves, fun = "cloglog", ranges = ranges, type = "line", markTimes = TRUE,
animation = TRUE)
p %>% hc_title(text = "Log-Minus-Log Plot") %>%
hc_xAxis(title = list(text = "Time"), tickInterval=NULL, tickLength = 5, lineWidth = 1) %>%
hc_yAxis(title = list(text = "log(-log(survival))"), lineWidth = 1, tickLength = 5, tickWidth= 1, labels = list(format = "{value:.2f}")) %>%
#hc_colors("#440154") %>%
hc_add_theme(hc_theme_gridlight()) %>%
hc_chart(backgroundColor = "white", zoomType = "xy") %>%
hc_legend(enabled = TRUE) %>%
hc_plotOptions(line = list(dashStyle = "Solid"), area = list(zIndex = 15), series = list(enableMouseTracking = TRUE)) %>%
hc_tooltip(shared = TRUE, crosshairs = TRUE, valueDecimals = 3, followTouchMove = FALSE, headerFormat = "<b>Time</b>: {point.key} <br>")#, pointFormat = "{series.name}: {point.y}")
```
### 2.2. Cox Regression
#### Concept
Cox regression, also known as proportional hazard regression, is a method to investigate the effect of one or multiple factors (i.e. gene expressions) upon the time an event of interest occurs. In this model, the effect of a unit increase in a factor is multiplicative with respect to the hazard rate.
#### Usage
A Cox regression analysis can be conducted by applying the following steps:
1. Select the analysis method as `Cox Regression` from `Analysis` tab.
2. Select suitable variables for the analysis, such as `survival time`, `status variable`, `category value for status variable`, and categorical and continuous predictors for the model.
3. In advanced options, `interaction terms`, `strata terms` and `time dependent covariates` can be added to the model. Moreover, if there are multiple records for observations, users can specify it by clicking `Multiple ID` checkbox. Furthermore, one can choose model selection criteria, as `AIC` or `p-value`, model selection method, as `backward`, `forward` or `stepwise`, reference category, as `first` or `last`, and ties method, as `Efron`, `Breslow` or `exact` and change the `confidence level`.
4. Click `Run` button to run the analysis.
<img src="images/coxRegressionHelp.jpg" alt="Cox Regression help" align="middle" style="width:800px; height:350;"/>
#### Outputs
Desired outputs can be selected by clicking Outputs checkbox. Available outputs are coefficient estimates, hazard ratio, goodness of fit tests, analysis of deviance, predictions, residuals, Martingale residuals, Schoenfeld residuals and DfBetas.
```{r coxRegression, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE, include=FALSE}
setwd("~/Dropbox/GSD/Studies/Web-Tools(Devel)/geneSurv/")
library("DT")
library("survival")
library("KMsurv")
library("survMisc")
source("coxRegression.R")
source("getDescriptiveResultsCoxRegression.R")
source("stepwise.R")
source("plotLT.R")
require("ggplot2")
source("ggsurv.R")
source("ggsurv2.R")
source("plotSchoenfeld.R")
library("magrittr")
library("dplyr")
library("survminer")
library("highcharter")
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", data = data)
```
#####a. Coefficient Estimates
A coefficient estimation table, which includes variable names, coefficient estimates and their associated standard errors, z statistics and p values, can be created.
```{r displayCoefficientEstimatesResults, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
coeffResultsCox = cox$testResult$displayCoefficientEstimatesResults
DT::datatable(coeffResultsCox, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####b. Hazard ratio
A hazard ratio table, which includes variable names, hazard ratios and their associated lower and upper limits, can be created.
```{r hazardRatioReactiveCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
hrResultsCox = cox$testResult$hazardRatioResults
DT::datatable(hrResultsCox, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE
))
```
#####c. Hazard plot
A forest plot can be created for hazard ratios to give them a visual inpection.
```{r hazardPlotCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
cox = cox$testResult$hazardRatioResults
if(nrow(cox)>1){
cox = cbind.data.frame("Variable" = levels(cox$Variable), apply(cox[,-1],2, as.numeric))
}else{
cox = cbind.data.frame("Variable" = levels(cox$Variable), as.data.frame(t(apply(cox[,-1],2, as.numeric))))
}
highchart() %>% hc_exporting(enabled = TRUE, filename = "hazardPlot") %>%
hc_add_series(name = "Hazard", type = "line", data = cox$`Hazard ratio`, showInLegend = FALSE, zIndex = 1, marker = list(lineColor = "black", lineWidth = 1), lineWidth = 0, id = "hazard") %>%
hc_add_series(name = "CI", data = as.matrix(cbind(cox$`Lower limit (95%)`, cox$`Upper limit (95%)`)),type = "errorbar", names = "Limits", showInLegend = FALSE, zIndex = 0, lineWidth = 1.5, linkedTo = "hazard") %>%
hc_chart(zoomType = "xy", inverted = TRUE) %>%
hc_xAxis(categories = matrix(cox$Variable, ncol = 1)) %>%
hc_yAxis(startOnTick = FALSE, endOnTick = FALSE, title = list(text = "Hazard Ratio"), plotLines = list(list(value = 1, width = 2, color = "green", dashStyle = "Dash"))) %>%
#hc_plotOptions(tooltip = list(headerFormat = "<b>Time: </b>{point.x}")) %>%
hc_tooltip(crosshairs = TRUE, shared = TRUE, headerFormat = "<b>Variable: </b>{point.x} <br>") %>%
hc_plotOptions(line = list(tooltip = list(pointFormat = "<b>{series.name}: </b>{point.y:.3f} ")),
errorbar = list(tooltip = list(pointFormat = "({point.low} - {point.high})"))) %>%
hc_add_theme(hc_theme_google())
```
#####d. Goodness of Fit Tests
Fitted Cox regression model can be tested with three tests: Likelihood ratio, Wald, Score.
```{r goodnessOfFitTestsCoxsss, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", data = data)
goodnessOfFit = cox$testResult$goodnessOfFitTestsResults
datatable(goodnessOfFit, rownames=FALSE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####e. Analysis of Deviance
A deviance analysis can be conducted for each variable in the fitted model.
```{r analysisOfDevianceCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", data = data)
aod = cox$testResult$analysisOfDevianceResults
datatable(aod, rownames=FALSE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####f. Predictions
Predictions from the fitted model can be obtained.
```{r storePredictionsCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storePredictions = TRUE, data = data)
preds = cox$testResult$Store$Predictions
datatable(preds, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####g. Residuals
Residuals from the fitted model can be obtained.
```{r storeResidualsCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storeResiduals = TRUE, data = data)
residuals = cox$testResult$Store$Residuals
datatable(residuals, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####h. Martingale Residuals
Martingale residuals from the fitted model can be obtained.
```{r storeMartingaleResidualsCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storeMartingaleResiduals = TRUE, data = data)
martingaleResiduals = cox$testResult$Store$MartingaleResiduals
datatable(martingaleResiduals, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####i. Schoenfeld Residuals
Schoenfeld residuals from the fitted model can be obtained.
```{r storeSchoenfeldResidualsCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storeSchoenfeldResiduals = TRUE, data = data)
storeSchoenfeldResiduals = cox$testResult$Store$SchoenfeldResiduals
datatable(storeSchoenfeldResiduals, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####j. DfBetas
DfBetas residuals from the fitted model can be obtained.
```{r storeDfBetasCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storeDfBetas = TRUE, data = data)
DfBetas = cox$testResult$Store$DfBetas
datatable(DfBetas, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####k. Proportional Hazard Assumption
<img src="images/coxPhHelp.jpg" alt="Cox Regression help" align="middle" style="width:800px; height:350;"/>
#####l. Proportional Hazard Test
To check the proportionality assumption of Cox regression model, a proportional hazard test can be conducted both globally and for each variable in the fitted model.
```{r phTest, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
cox = coxRegression(survivalTime = "dmfs_time", categoricalInput = "ER_IHC", continuousInput = c("ESR1.205225_at", "PGR.208305_at"), statusVariable = "dmfs_event", status = 1, displayDescriptives = TRUE, displayCoefficientEstimates = TRUE, displayModelFit = TRUE, hazardRatio = TRUE, goodnessOfFitTests = TRUE, analysisOfDeviance = TRUE, ties = "efron", storeDfBetas = TRUE, data = data)
coxPhTest = cox$testResult$displayCoxPh
datatable(coxPhTest, rownames=TRUE, extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
#####m. Schoenfeld Plot
Beside a formal test for proportionality assumption, a Schoenfeld plot can be created to check the assumption visually.
```{r schoenfeldPlot, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
compareCurves = cox$model
x <- cox.zph(compareCurves, transform = 'rank')
resid = TRUE
se = TRUE
df = 4
nsmo = 40
ltyest = "Solid"
ltyci = "Solid"
col = 1
colorLine = "#204BD9"
colorLineCI = "#59A819"
lwd=1
lty = ltyest
xx <- x$x
yy <- x$y
d <- nrow(yy)
df <- max(df)
nvar <- ncol(yy)
pred.x <- seq(from=min(xx), to=max(xx), length=nsmo)
temp <- c(pred.x, xx)
lmat <- splines::ns(temp, df=df, intercept=TRUE)
pmat <- lmat[1:nsmo,]
xmat <- lmat[-(1:nsmo),]
qmat <- qr(xmat)
yvar = x$y
var = ncol(yvar)
if (qmat$rank < df) {stop("Spline fit is singular, try a smaller degrees of freedom")}
if (se) {
bk <- backsolve(qmat$qr[1:df, 1:df], diag(df))
xtx <- bk %*% t(bk)
seval <- d*((pmat%*% xtx) *pmat) %*% rep(1, df)
}
if (missing(var)) {var <- 1:nvar}else {
if (is.character(var)) {var <- match(var, dimnames(yy)[[2]])}
if (any(is.na(var)) || max(var)>nvar || min(var) <1) {stop("Invalid variable requested")}
}
if (x$transform == 'log') {
xx <- exp(xx)
pred.x <- exp(pred.x)
}
if(x$transform != 'identity') {
xtime <- as.numeric(dimnames(yy)[[1]])
indx <- !duplicated(xx)
apr1 <- approx(xx[indx], xtime[indx],
seq(min(xx), max(xx), length=17)[2*(1:8)])
temp <- signif(apr1$y,2)
apr2 <- approx(xtime[indx], xx[indx], temp)
xaxisval <- apr2$y
xaxislab <- rep("",8)
for (i in 1:8) {xaxislab[i] <- format(temp[i])}
}
col <- rep(col, length=2)
lwd <- rep(lwd, length=2)
lty <- rep(lty, length=2)
svar = "ESR1.205225_at"
for (i in 1:var) {
y <- yy[,svar]
yhat <- pmat %*% qr.coef(qmat, y)
if (resid) {yr <-range(yhat, y)}else{yr <-range(yhat)}
if (se) {
temp <- 2* sqrt(x$var[i,i]*seval)
yup <- yhat + temp
ylow<- yhat - temp
yr <- range(yr, yup, ylow)
newData2 = cbind.data.frame(pred.x,yhat, yup, ylow)
}
newData = cbind.data.frame(xx, y)
newData3 = cbind.data.frame(pred.x, yhat)
fn = paste0("function() {\n if (this.value == ", xaxisval[1], ") {return ",xaxislab[1], "}\n
if (this.value == ", xaxisval[2], ") {return ",xaxislab[2], "}\n
if (this.value == ", xaxisval[3], ") {return ",xaxislab[3], "}\n
if (this.value == ", xaxisval[4], ") {return ",xaxislab[4], "}\n
if (this.value == ", xaxisval[5], ") {return ",xaxislab[5], "}\n
if (this.value == ", xaxisval[6], ") {return ",xaxislab[6], "}\n
if (this.value == ", xaxisval[7], ") {return ",xaxislab[7], "}\n
if (this.value == ", xaxisval[8], ") {return ",xaxislab[8], "}\n
", "}"
)
ylabel = paste0("Scaled Schoenfeld residuals for ", svar)
sp = highchart() %>%
hc_add_series(name = "Curve", data = as.matrix(newData3), type = "line", enabled = FALSE, color = "#204BD9", marker = list(enabled = FALSE), id = "schoenLine")%>%
hc_xAxis(tickInterval=NULL, tickLength = 5, lineWidth = 1, tickPositions = xaxisval, labels = list(formatter = JS(fn), format = "{value:.2f}"), title = list(text = "Time"))%>%
hc_yAxis(tickInterval=NULL, tickLength = 5, lineWidth = 1, title = list(text = ylabel), labels = list(format = "{value:.2f}"))%>%
hc_title(text = "Schoenfeld Plot") %>%
hc_add_theme(hc_theme_google()) %>%
hc_plotOptions(line = list(dashStyle = "Solid")) %>%
hc_chart(backgroundColor = "#FFFFFF", zoomType = "xy") %>%
hc_tooltip(shared = TRUE, crosshairs = FALSE, valueDecimals = 2, followTouchMove = FALSE)
if (resid){
sp = sp %>% hc_add_series(name = "Residuals", data = as.matrix(newData), type="scatter", labels = list(format = "{value:.2f}"), color = "#000000", zIndex = 10, marker = list(symbol = "circle", radius = 4))
}
if (se){
sp = sp %>% hc_add_series(name = "CI", data = as.matrix(cbind(newData2$pred.x, newData2$ylow, newData2$yup)),
type = "arearange", fillOpacity = 0.4, showInLegend = FALSE, linkedTo = "schoenLine", color ="#59A819")
}
sp = sp %>% hc_exporting(enabled = TRUE, filename = "schoenfeldplot")
}
sp
```
#####n. Log-Minus-Log Plot
Another useful plot for checking proportionality assumption is log-minus-log plot. Lines should be parallel to each other to satisfy proportionality.
```{r lmlPlotCox, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
survivalTime = "dmfs_time"
statusVariable = "dmfs_event"
status = 1
rnames = colnames(data)
fctr = "ER_IHC"
fctr = rnames[which.max(RecordLinkage::levenshteinSim(fctr,rnames))]
#ci = input$ciKM
#varianceEstimation = input$varianceEstimationKM
#confidenceLevel = input$confidenceLevelKM
factors = fctr
if(!is.null(survivalTime)){
survivalTime = as.matrix(data[, survivalTime, drop = FALSE])
}
if(!is.null(factors)){
factors = as.factor(data[, factors])
}
if(!is.null(statusVariable)){
statusVariable = data[, statusVariable]
}
if(!is.null(status)){
if(is.numeric(status)){status = as.factor(status)}else{status = as.factor(status)}
}
if(!is.null(factors)){
newData = data.frame(id =seq(1,dim(survivalTime)[1], 1), survivalTime= survivalTime,
statusVar=statusVariable,factor = factors)
newData = newData[complete.cases(newData),]
colnames(newData) = c("id", "time", "statusVar", "factor")
}
newData$statusVar = newData$statusVar%in%status
if(!is.null(fctr)){
compareCurves <- survfit(Surv(time, statusVar == TRUE) ~ factors, data = newData)
for(i in 1:length(names(compareCurves$strata))) {
names(compareCurves$strata)[i] = gsub("factors", fctr, names(compareCurves$strata)[i])
}
}
p = hchart(compareCurves, fun = "cloglog", ranges = FALSE, type = "line", animation = TRUE, rangesOpacity = 0.4)
p %>% hc_exporting(enabled = TRUE, filename = "plot") %>%
hc_title(text = "Log-Minus-Log Plot") %>%
hc_xAxis(title = list(text = "Time"), tickInterval=NULL, tickLength = 5, lineWidth = 1) %>%
hc_yAxis(title = list(text = "log(-log(survival))"), lineWidth = 1, tickLength = 5, tickWidth= 1, labels = list(format = "{value:.2f}")) %>%
#hc_colors("#440154") %>%
hc_add_theme(hc_theme_google()) %>%
hc_chart(backgroundColor = "white", zoomType = "xy") %>%
hc_legend(enabled = TRUE) %>%
hc_plotOptions(line = list(dashStyle = "Solid"), area = list(zIndex = 15), series = list(enableMouseTracking = TRUE)) %>%
hc_tooltip(shared = TRUE, crosshairs = TRUE, valueDecimals = 3, followTouchMove = FALSE, headerFormat = "<b>Time</b>: {point.key} <br>")
```
### 2.3. Penalized Cox Regression
#### Concept
Feature selection is an useful strategy to avoid over-fitting, to obtain more reliable predictive results, and to provide more insights into the underlying casual relationships <a href ="https://www.ncbi.nlm.nih.gov/pubmed/18562478" target = "_blank" > (Ma and Huang, 2008)</a>. In this section, a feature selection can be performed using ridge, elastic net or lasso penalty, especially when there are too many predictors (e.g. `n<<p`). More information can be found in <a href ="http://users.stat.umn.edu/~zouxx019/Papers/elasticnet.pdf" target = "_blank" > Zou and Hastie, 2005</a>, <a href ="http://www.jstatsoft.org/v33/i01/" target = "_blank" > Freidman et al, 2008</a> and <a href ="http://www.jstatsoft.org/v39/i05/" target = "_blank" > Simon et al, 2011</a>.
#### Usage
A Penalized Cox regression analysis can be conducted by applying the following steps:
1. Select the analysis method as `Penalized Cox Regression` from `Analysis` tab.
2. Select suitable variables for the analysis, such as `survival time`, `status variable`
3. If all predictors are continious then one can check the `Select All Variables` option to include all variables in dataset to the feature selection process. If some predictors categorical and others are continious, then uncheck the `Select All Variables` option and select categorical and continuous variables seperately.
4. Define the penalty term using the `Penalty term` slider as follow:
`Penalty term = 0`: ridge penalty
`0 < Penalty term < 1`: elastic net penalty
`Penalty term = 1`: lasso penalty
5. Select the number of folds for cross-validation. Note that number of folds must be greater than 3.
6. Click `Run` button to run the analysis.
<img src="images/regCoxReg.jpg" alt="Cox Regression help" align="middle" style="width:800px; height:350;"/>
#### Outputs
#####a) Variables in the model
Variable selection is conducted with the selected penalized method (i.e. ridge, elasticnet, lasso) and results will be displayed as a table, which includes selected variables and their associated coefficient estimates.
```{r regCoxReg, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
library("glmnet")
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
data = data[,-1]
survivalTimerCox = "dmfs_time"
survivalStatusrCox = "dmfs_event"
regCoxList = list()
indx = !(colnames(data) %in% c(survivalTimerCox, survivalStatusrCox))
x = data.matrix(data[,indx, drop = FALSE])
y= Surv(data[,survivalTimerCox], data[,survivalStatusrCox])
set.seed(1234)
cvFit = cv.glmnet(x, y, family = "cox", alpha = 0.2)
coefficients = as.data.frame(as.matrix(coef(cvFit, s = cvFit$lambda.min)))
coefficients$`1` = as.numeric(formatC(coefficients$`1`, digits = 3, format = "f"))
coefficients2 = data.frame(rownames(coefficients), coefficients[,1])
coefficients3 = coefficients2[coefficients2[2] != 0,]
colnames(coefficients3) = c("Variable", "Coefficient estimate")
varsNotInTheModel = coefficients2[coefficients2[2] == 0,]
if(nrow(varsNotInTheModel) > 0){
varsNotInTheModel$coefficients...1. = formatC(varsNotInTheModel$coefficients...1., digits = 3, format = "f")
colnames(varsNotInTheModel) = c("Variable", "Coefficient estimate")
}else{
varsNotInTheModel = NULL
}
regCoxList = list(coefficients3, varsNotInTheModel)
datatable(regCoxList[[1]], extensions = c('Buttons','KeyTable', 'Responsive'), options = list(dom = 'Bfrtip',buttons = c('copy', 'csv', 'excel', 'pdf', 'print'), keys = TRUE))
```
*
#####b) Cross-validation curve
A cross-validation curve can be created to investigate the relationship between partial likelihood devaince and lambda values.
```{r regCoxRegPlot, echo=FALSE, eval = TRUE, message=FALSE, warning=FALSE}
library("glmnet")
data <- read.table("www/data/GSE2034.txt", header=TRUE, sep = "\t")
data = data[,-1]
survivalTimerCox = "dmfs_time"
survivalStatusrCox = "dmfs_event"