-
Notifications
You must be signed in to change notification settings - Fork 0
/
survival.R
67 lines (56 loc) · 1.75 KB
/
survival.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
# Survival analysis
#
# 1) Univariate survival analysis (Cox) with splines of expression values
# of the genes of interest
#
# 2) Survival analysis (univariate Cox) done separately for the early
# and late stage tumors
#
# 3) Survival in the lymphokine expression strata defined
# by the the largest difference in survival - for the entire datasets
# and early/late stage tumors
#
# 4) Multi-parameter overall an relapse-free survival with regularized Cox
# regression employing the genes of interest as explanatory variables
#
# 5) Multi-parameter modeling of overall and relapse-free survival with
# clinical parameters (age, sex, grade. stage) and gene expression variables
# tools ------
library(plyr)
library(tidyverse)
library(exda)
library(trafo)
library(soucer)
library(rlang)
library(ggrepel)
library(ggtext)
library(furrr)
library(ggExtra)
library(survival)
library(coxExtensions)
library(splines)
library(lmqc)
library(kmOptimizer)
library(glmnet)
library(caret)
library(survminer)
extract <- clustTools::extract
nobs <- clustTools::nobs
reduce <- purrr::reduce
select <- dplyr::select
insert_head()
c('./tools/project_globals.R',
'./tools/project_tools.R') %>%
source_all(message = TRUE, crash = TRUE)
# survival scripts -------
insert_msg('Survival scripts')
c('./survival scripts/univariable_os.R',
'./survival scripts/univariable_rfs.R',
'./survival scripts/stages.R',
'./survival scripts/stage_cutpoints.R',
'./survival scripts/multi_os.R',
'./survival scripts/multi_rfs.R',
'./survival scripts/clinical_os.R') %>%
source_all(message = TRUE, crash = TRUE)
# END ------
insert_tail()