simBootstrap: simBootstrap

Description Usage Arguments Value Author(s) Examples

Description

the driver function to perform three-step bootstrap resampling

to get independent genomic data sets

Usage

1
2
3
4
5
6
7
simBootstrap(obj, y.vars, n.samples, parstep, type = "two-steps", 


    balance.variables = NULL, funSimData = simData, funTrueModel = getTrueModel, 


    funSurvTime = simTime)

Arguments

obj

a list of ExpressionSet, matrix or RangedSummarizedExperiment

y.vars

a list of reponse variables, elements can be class Surv, matrix or data.frame

n.samples

number of samples to resample in each set

parstep

step number to fit CoxBoost

type

whether to include resampling set labels

balance.variables

covariate names to balance in the simulated sets

funSimData

function to perform non-parametric bootstrap

funTrueModel

function to construct true models in original sets

funSurvTime

function to perform parametric bootstrap

Value

a list of values including:

obj.list = a list of simulated objects the same type as input

indices.list = a list of indices indicating which sample the simulated sample is in the

original set

setsID = a vector to indicate the original ID of simulated sets, if

type=="original", setsID should be 1,2,3,...

lp.list = a list of true linear predictor of each original data sets

beta.list = a list of true coefficients used for simulating observations

survH.list = list of cumulative survival hazard

censH.list = list of cumulative censoring hazard

grid.list = list of timeline grid corresponding to survH and censH respectivley

Author(s)

Yuqing Zhang, Christoph Bernau, Levi Waldron

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
 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
library(curatedOvarianData)


library(GenomicRanges)


data(E.MTAB.386_eset)


data(GSE14764_eset)


esets.list <- list(E.MTAB.386=E.MTAB.386_eset[1:200, 1:20], GSE14764=GSE14764_eset[1:200, 1:20])


rm(E.MTAB.386_eset, GSE14764_eset)





## simulate on multiple ExpressionSets


set.seed(8) 





y.list <- lapply(esets.list, function(eset){


  time <- eset$days_to_death


  cens.chr <- eset$vital_status


  cens <- rep(0, length(cens.chr))


  cens[cens.chr=="living"] <- 1


  return(Surv(time, cens))


})





simmodels <- simBootstrap(obj=esets.list, y.vars=y.list, 10, 100)


simmodels$obj.list[[1]]





# balance covariates


simmodels <- simBootstrap(obj=esets.list, y.vars=y.list, 10, 100,


                          balance.variables="tumorstage")


rm(esets.list, simmodels)





## Support RangedSummarizedExperiment


nrows <- 200; ncols <- 10


counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)


rowRanges <- GRanges(rep(c("chr1", "chr2"), c(50, 150)),


                     IRanges(floor(runif(200, 1e5, 1e6)), width=100),


                     strand=sample(c("+", "-"), 200, TRUE))


colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 5),


                     row.names=LETTERS[1:10])


sset <- SummarizedExperiment(assays=SimpleList(counts=counts),


                             rowRanges=rowRanges, colData=colData)





s.list <- list(sset[,1:5], sset[,6:10])


time <- c(540, 527, 668, 587, 620, 540, 527, 668, 587, 620)


cens <- c(1, 0, 0, 1, 0, 1, 0, 0, 1, 0)


y.vars <- Surv(time, cens)


y.vars <- list(y.vars[1:5,],y.vars[1:5,])


simmodels <- simBootstrap(obj=s.list, y.vars=y.vars, 20, 100) 

zhangyuqing/simulatorZ documentation built on Oct. 21, 2020, 1:05 a.m.