create.optimized.setup: Create optimized setup

Description Usage Arguments Details Value Examples

View source: R/gSetup-class.R

Description

Create a optimized sample assignment.

Usage

1
create.optimized.setup(fun = "default", sample, container, ...)

Arguments

fun

The name of the optimization function. When omitted, it is the same as default or optimal.shuffle. Currently alternative optimization function is optimal.block. User can define their own optimization function.

sample

A gSample object contains sample related information.

container

A gContainer object contains experiment related container (chips, plate, exclusion etc) information.

...

Additional parameters passed to optimization function.

Details

Currently two methods are available: optimal.shuffle (default) and optimal.block methods. The function is equivalent to create.experiment.setup() followed by corresponding optimization function of the same name.

Value

A gExperimentSetup object is returned to store all related information.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
# demonstration only. nSim=5000 or more are commonly used.
gSetup <- create.optimized.setup(sample=gs, container=gc, nSim=500)

Example output

An object of class "gSample"
The raw data are
  ID SampleType     Race   AgeGrp
1  1       Case Hispanic (60,100]
2  2       Case Hispanic (60,100]
3  3       Case European (60,100]
4  4       Case European  (50,60]
5  5       Case European  (50,60]
6  6       Case European   (0,30]

 ... 
     ID SampleType     Race  AgeGrp
571 571    Control European (40,50]
572 572    Control Hispanic (30,40]
573 573    Control European (30,40]
574 574    Control Hispanic (30,40]
575 575    Control European (40,50]
576 576    Control European  (0,30]

 Blocking strata in the data:

  SampleType Freq sFactor
1       Case  317       1
2    Control  259       2

 Optimization strata in the data

   SampleType     Race   AgeGrp Freq oFactor
1        Case European   (0,30]    8       1
2     Control European   (0,30]   58       2
3        Case Hispanic   (0,30]    0       3
4     Control Hispanic   (0,30]    9       4
5        Case European  (30,40]   21       5
6     Control European  (30,40]   54       6
7        Case Hispanic  (30,40]    6       7
8     Control Hispanic  (30,40]   32       8
9        Case European  (40,50]   34       9
10    Control European  (40,50]   52      10
11       Case Hispanic  (40,50]   46      11
12    Control Hispanic  (40,50]    2      12
13       Case European  (50,60]   40      13
14    Control European  (50,60]   44      14
15       Case Hispanic  (50,60]   16      15
16    Control Hispanic  (50,60]    2      16
17       Case European (60,100]   84      17
18    Control European (60,100]    6      18
19       Case Hispanic (60,100]   62      19
20    Control Hispanic (60,100]    0      20
An object of class "gContainer"

It consists of 6 IlluminaBeadChip96Plate plates.
The block level is set at plates level.
  plates cFactor Freq
1      1       1   96
2      2       2   96
3      3       3   96
4      4       4   96
5      5       5   96
6      6       6   96
The container layout is
@data$container
  plates chipRows chipColumns chips rows columns wells chipID rowID wellID
1      1        1           1     1    1       1     1      1     1      1
2      1        1           1     1    2       1     2      1     1      2
3      1        1           1     1    3       1     3      1     1      3
4      1        1           1     1    4       1     4      1     1      4
5      1        1           1     1    5       1     5      1     1      5
6      1        1           1     1    6       1     6      1     1      6
  cFactor
1       1
2       1
3       1
4       1
5       1
6       1

 ... 
    plates chipRows chipColumns chips rows columns wells chipID rowID wellID
571      6        2           4     8    1       2     7     48   286    571
572      6        2           4     8    2       2     8     48   286    572
573      6        2           4     8    3       2     9     48   286    573
574      6        2           4     8    4       2    10     48   286    574
575      6        2           4     8    5       2    11     48   286    575
576      6        2           4     8    6       2    12     48   286    576
    cFactor
571       6
572       6
573       6
574       6
575       6
576       6
Warning message:
In create.optimized.setup(sample = gs, container = gc, nSim = 500) :
  Using default optimization method: optimal.shuffle

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