Learn R Programming

OSAT (version 1.20.0)

optimal.block: optimal.block

Description

Optimize a sample assingment setup by selecting from multiple candidate setup.

Usage

optimal.block(x, nSim = 100)

Arguments

x
A gExperimentSetup object.
nSim
Number of candidate setup created.

Value

A gExperimentSetup object, after optimization.

Details

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.

See Also

optimal.shuffle

Examples

Run this code
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)

Run the code above in your browser using DataLab