optimal.block: optimal.block

Description Usage Arguments Details Value See Also Examples

View source: R/gSetup-class.R

Description

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

Usage

1
optimal.block(x, nSim = 100)

Arguments

x

A gExperimentSetup object.

nSim

Number of candidate setup created.

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.

Value

A gExperimentSetup object, after optimization.

See Also

optimal.shuffle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

OSAT documentation built on Nov. 8, 2020, 5:48 p.m.