funCV: funCV

Description Usage Arguments Value Author(s) Examples

Description

Cross validation function

Usage

1
2
3
4
funCV(obj, fold, y.var, trainFun = masomenos, funCvSubset = cvSubsets, 


    covar = NULL)

Arguments

obj

a ExpressionSet, matrix or RangedSummarizedExperiment object. If it is a

matrix, columns represent samples

fold

the number of folds in cross validation

y.var

response variable, matrix, data.frame(with 2 columns) or Surv object

trainFun

training function, which takes gene expression matrix X and response variable y as input, the coefficients as output

funCvSubset

function to divide one Expression Set into subsets for cross validation

covar

other covariates to be added in as predictors

Value

returns the c statistics of cross validation(CV)

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


library(GenomicRanges)


set.seed(8)


data( E.MTAB.386_eset )


eset <- E.MTAB.386_eset[1:100, 1:30]


rm(E.MTAB.386_eset)





time <- eset$days_to_death


cens.chr <- eset$vital_status


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


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


y <- Surv(time, cens)  


y1 <- cbind(time, cens)





nrows <- 200; ncols <- 6


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"), 3),


                     row.names=LETTERS[1:6])


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


                             rowRanges=rowRanges, colData=colData)


time <- c(1588,1929,1813,1542,1830,1775)  


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


y.vars <- Surv(time, cens)





funCV(eset, 3, y)


funCV(exprs(eset), 3, y1)


funCV(sset, 3, y.vars)


## any training function will do as long as it takes the gene expression matrix X


## and response variable y(matrix, data.frame or Surv object) as parameters, and


## return the coefficients as its value

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