# NOT RUN {
# }
# NOT RUN {
data("breast.TCGA")
# this is the X data as a list of mRNA and miRNA; the Y data set is a single data set of proteins
data = list(mrna = breast.TCGA$data.train$mrna, mirna = breast.TCGA$data.train$mirna,
protein = breast.TCGA$data.train$protein)
# set up a full design where every block is connected
# could also consider other weights, see our mixOmics manuscript
design = matrix(1, ncol = length(data), nrow = length(data),
dimnames = list(names(data), names(data)))
diag(design) = 0
design
# set number of component per data set
ncomp = 5
# Tuning the first two components
# -------------
# definition of the keepX value to be tested for each block mRNA miRNA and protein
# names of test.keepX must match the names of 'data'
test.keepX = list(mrna = seq(10,40,20), mirna = seq(10,30,10), protein = seq(1,10,5))
# the following may take some time to run, note that for through tuning
# nrepeat should be > 1
tune = tune.block.splsda(X = data, Y = breast.TCGA$data.train$subtype,
ncomp = ncomp, test.keepX = test.keepX, design = design, nrepeat = 3)
tune$choice.ncomp
tune$choice.keepX
# Only tuning the second component
# -------------
already.mrna = 4 # 4 variables selected on comp1 for mrna
already.mirna = 2 # 2 variables selected on comp1 for mirna
already.prot = 1 # 1 variables selected on comp1 for protein
already.tested.X = list(mrna = already.mrna, mirna = already.mirna, prot = already.prot)
tune = tune.block.splsda(X = data, Y = breast.TCGA$data.train$subtype,
ncomp = 2, test.keepX = test.keepX, design = design,
already.tested.X = already.tested.X)
tune$choice.keepX
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab