cox.optimized2: A pipline of lasso cox modeling

Description Usage Arguments Author(s) See Also Examples

View source: R/BI_cox.optimized2.R

Description

cox.optimized2 use glmnet::cv.glmnet to do optimized selection of lasso cox models based on random seeds

Usage

1
2
3
4
5
6
cox.optimized2(expr.matrix, design, select,
  event.status = c("TTR.status", "DFS.status", "OS.status"),
  event.time = c("TTR.time", "DFS.time", "OS.time"),
  event.lower = c(89, 89, 89), k = 10, seed = 2018,
  seed.range = 1:2000, R = 100, optimize.method = "min",
  show.music = T)

Arguments

expr.matrix

gene expression with sample cols and genes/markers rows.

design

design object with characters cols and sample rows.

select

intersting genes/markers

event.status

a vector of event status names

event.time

a vector of event time names

event.lower

the cutoff(>) ofevent.time

k

number of folds.Default is 10.

seed

a number for randomization

seed.range

the range of randomization

R

the round of randomization

optimize.method

Default is "min".You can also use "1se"

show.music

whether to show music at the end of the process

Author(s)

Weibin Huang<654751191@qq.com>

See Also

glmnet;cv.glmnet;

Examples

 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
## This is a simulative process and available only with CORRECT VARIABLES

# Get lots of optimized model
model <- cox.optimized2(expr.matrix = x,
                        design = y,
                        select = cluster,
                        event.status="DFSoutcome",
                        event.time="DFS",
                        event.lower =0,
                        k=10,
                        seed = 2018,
                        seed.range = 1:2000,R=100,
                        optimize.method = "min",
                        show.music = F)

# select models of given status and time
model1 <- model$DFS$modeldata;View(model1)

# models statistics
model2 <- uniqueModel(model1) ;View(model2)

# Visualize the best model
res <- exampleLassoCox(expr.matrix = x,
                      design = y,
                      select = cluster,
                      event.status="DFSoutcome",
                      event.time="DFS",
                      event.lower =0,
                      k=10,
                      seed = 1601,#某个seed.来自model2
                      optimize.method = "min",
                      verbose = T,
                      save.file = T,
                      names = "总GIST")

# select best model
mod <- oneModel(model2[1,],dig=5)

# KM1
th1 <- cox.threshold(expr.matrix = tpm,
                    design = design.train,
                    model = list(mod),
                    event.status="DFS.status",
                    event.time="DFS.time",
                    event.lower = 89,
                    smethod="LogRank",
                    pmethod="HL",
                    dig = 5,
                    cancertype.cv="STAD",
                    file.name = project)

cf <- th1$DFS$cunoff

# KM2: Giving a specified cut off
th2 <- cox.threshold2(expr.matrix = tpm,
                     design = design.train,
                     model = rep(list(mod),3),
                     cut.off = c(cf,cf,cf),
                     event.status=c("TTR.status","DFS.status","OS.status"),
                     event.time=c("TTR.time","DFS.time","OS.time"),
                     event.lower =c(89,89,89),
                     dig = 5,
                     cancertype.cv="STAD",
                     file.name = project)

shijianasdf/BasicBioinformaticsAnalysisFromZhongShan documentation built on Jan. 3, 2020, 10:08 p.m.