Description Usage Arguments Details Value References Examples
Perform the simulation study similar to the one in Qin et al., but allow different combinations of study designs and normalization methods on training set and test set and support one internal validation and two external validations - one using uniformly-handled test set and the other one using nonuniformly-handled test set.
1 2 3 4 5 6 7 8 9 | precision.simulate.flex(seed, N, biological.effect.tr, biological.effect.te,
handling.effect.tr, handling.effect.te, group.id.tr, group.id.te,
design.tr.list, design.te.list = NULL, norm.tr.list = c("NN", "QN"),
norm.te.list = NULL, class.list = c("PAM", "LASSO"),
valid.list = c("int", "ext.uh", "ext.sim.nuh"), batch.id.tr = NULL,
batch.id.te = NULL, icombat = FALSE, isva = FALSE, iruv = FALSE,
biological.effect.tr.ctrl = NULL, handling.effect.tr.ctrl = NULL,
norm.tr.funcs = NULL, norm.te.funcs = NULL, class.funcs = NULL,
pred.funcs = NULL)
|
seed |
an integer used to initialize a pseudorandom number generator. |
N |
number of simulation runs. |
biological.effect.tr |
the training set of the estimated biological effects. This dataset must have rows as probes and columns as samples. |
biological.effect.te |
the test set of the estimated biological effects. This dataset must have rows as probes and columns as samples. It must have the same number of probes and the same probe names as the training set of the estimated biological effects. |
handling.effect.tr |
the training set of the estimated handling effects. This dataset must have rows as probes and columns as samples. It must have the same dimensions and the same probe names as the training set of the estimated biological effects. |
handling.effect.te |
the test set of the estimated handling effects. This dataset must have rows as probes, columns as samples. It must have the same dimensions and the same probe names as the training set of the estimated handling effects. |
group.id.tr |
a vector of sample-group labels for each sample of the training set of the estimated biological effects. It must be a 2-level non-numeric factor vector. |
group.id.te |
a vector of sample-group labels for each sample of the test set of the estimated biological effects. It must be a 2-level non-numeric factor vector. |
design.tr.list |
a list of strings for study designs on the training set to be compared in the simulation study. The built-in designs are "CC+", "CC-", "PC+", "PC-", "BLK", and "STR" for "Complete Confounding 1", "Complete Confounding 2", "Partial Confounding 1", "Partial Confounding 2", "Blocking", and "Stratification" in Qin et al. |
design.te.list |
a list of strings for study designs on the test set to be compared in the simulation study.
It must have the same length as |
norm.tr.list |
a list of strings for normalization methods on the training set to be compared in the simulation study.
It must have the same length as |
norm.te.list |
a list of strings for normalization methods on the test set to be compared in the simulation study.
It must have the same length as |
class.list |
a list of strings for classification methods to be compared in the simulation study.
The built-in classification methods are "PAM" and "LASSO" for "prediction analysis for microarrays" and
"least absolute shrinkage and selection operator".
User can provide a list of classification methods given the correponding model-building and
predicting functions are supplied (also see |
valid.list |
a list of strings for validation methods to be compared in the simulation study. The built-in validation methods are:
|
batch.id.tr |
a list of array indices grouped by batches when training data were profiled.
The length of the list must be equal to the number of batches in the training data;
the number of array indices must be the same as the number of samples.
This is required if stratification study design is specified in |
batch.id.te |
a list of array indices grouped by batches when test data were profiled.
The length of the list must be equal to the number of batches in the test data;
the number of array indices must be the same as the number of samples.
This is required if stratification study design is specified in |
icombat |
an indicator for combat adjustment. By default, |
isva |
an indicator for sva adjustment. By default, |
iruv |
an indicator for RUV-4 adjustment. By default, |
biological.effect.tr.ctrl |
the training set of the negative-control probe biological effect data if |
handling.effect.tr.ctrl |
the training set of the negative-control probe handling effect data if |
norm.tr.funcs |
a list of strings for names of user-defined normalization method functions for the training set, in the order of |
norm.te.funcs |
a list of strings for names of user-defined normalization method functions for the test set, in the order of |
class.funcs |
a list of strings for names of user-defined classification model-building functions, in the order of |
pred.funcs |
a list of strings for names of user-defined classification predicting functions, in the order of |
The main steps of the classification anlaysis of simulation study are explained in precision.simulate
in details. This function includes more flexible functionalities such as allowing different combinations of study designs and normalization methods on training and test sets. For instance, user can now compare the effect of frozen quantile normalization by running two simulations: 1) quantile normalization on both training set and test set and 2) quantile normalization on training set but forzen quantile normalization on test set. Or user can compare the effect of forzen normaliation on test set by varying frozen normalization methods on test set but fixing normalization method on traing set for two simulations. Another functionality is that user can include a third external validation method - using the nonuniformly-handled test set as the external independent set. The nonuniformly-handled test set is simulated the same way as the nonuniformly-handled training set, using user-specified study design(s).
simulation study results – a list of array-to-sample assignments, fitted models, and misclassification error rates across simulation runs:
assign_store |
array-to-sample assignments for each study design |
model_store |
models for each combination of study designs, normalization methods, and classification methods |
error_store |
misclassification error rates of the specified validation method(s) for each combination of study designs, normalization methods, and classification methods |
Qin LX, Huang HC, Begg CB. Cautionary note on cross validation in molecular classification. Journal of Clinical Oncology. 2016
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 | ## Not run:
set.seed(101)
biological.effect <- estimate.biological.effect(uhdata = uhdata.pl)
handling.effect <- estimate.handling.effect(uhdata = uhdata.pl,
nuhdata = nuhdata.pl)
ctrl.genes <- unique(rownames(uhdata.pl))[grep("NC", unique(rownames(uhdata.pl)))]
biological.effect.nc <- biological.effect[!rownames(biological.effect) %in%
ctrl.genes, ]
handling.effect.nc <- handling.effect[!rownames(handling.effect) %in% ctrl.genes, ]
group.id <- substr(colnames(biological.effect.nc), 7, 7)
# randomly split biological effect data into training and test set with
# equal number of endometrial and ovarian samples
biological.effect.train.ind <- colnames(biological.effect.nc)[c(sample(which(
group.id == "E"), size = 64), sample(which(group.id == "V"), size = 64))]
biological.effect.test.ind <- colnames(biological.effect.nc)[!colnames(
biological.effect.nc) %in% biological.effect.train.ind]
biological.effect.train.test.split =
list("tr" = biological.effect.train.ind,
"te" = biological.effect.test.ind)
# non-randomly split handling effect data into training and test set
handling.effect.train.test.split =
list("tr" = c(1:64, 129:192),
"te" = 65:128)
biological.effect.nc.tr <- biological.effect.nc[, biological.effect.train.ind]
biological.effect.nc.te <- biological.effect.nc[, biological.effect.test.ind]
handling.effect.nc.tr <- handling.effect.nc[, c(1:64, 129:192)]
handling.effect.nc.te <- handling.effect.nc[, 65:128]
# Simulation without batch adjustment
precision.results.flex <- precision.simulate.flex(seed = 1, N = 3,
biological.effect.tr = biological.effect.nc.tr,
biological.effect.te = biological.effect.nc.te,
handling.effect.tr = handling.effect.nc.tr,
handling.effect.te = handling.effect.nc.te,
group.id.tr = substr(colnames(biological.effect.nc.tr), 7, 7),
group.id.te = substr(colnames(biological.effect.nc.te), 7, 7),
design.tr.list = c("PC-", "PC-", "STR", "STR"),
design.te.list = c("PC-", "STR", "PC-", "STR"),
norm.tr.list = c("NN", "QN", "NN", "QN"),
norm.te.list = c("NN", "NN", "QN", "QN"),
class.list = c("PAM", "LASSO"),
batch.id.tr = list(1:40,
41:64,
(129:160) - 64,
(161:192) - 64),
batch.id.te = list(1:32, 33:64))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.