optimal.block {OSAT} | R Documentation |
Optimize a sample assingment setup by selecting from multiple candidate setup.
optimal.block(x, nSim = 100)
x |
A |
nSim |
Number of candidate setup created. |
Multiple (typically thousands of or more) sample assignment setups are first generated, based only on the list of specified blocking variable(s). Then, the optimal setup is chosen by selecting the setup of sample assignment (from the pool generated in blocking step) which minimizes the value of the objective function based on all variables considered.
A gExperimentSetup
object, after optimization.
library("OSAT") # data as an example inPath <- system.file("extdata", package="OSAT") pheno <- read.table(file.path(inPath, 'samples.txt'), header=TRUE, sep="\t") ## create object to hold sample information gs <- setup.sample(pheno, optimal=c("SampleType", "Race", "AgeGrp"), strata=c("SampleType") ) gs gc <- setup.container(IlluminaBeadChip96Plate, 6, batch='plates') gc gSetup0 <- create.experiment.setup(sample=gs, container=gc) g2 <- optimal.block(gSetup0, nSim=100)