To ensure that the batches are comparable some samples are processed in each
batch. This function allows to take into account that effect.
It uses the most different samples as controls as defined with extreme_cases()
.
Arguments
- pheno
Data.frame with the sample information.
- size_subset
Numeric value of the number of sample per batch.
- controls
The numeric value of the amount of technical controls per batch.
- omit
Name of the columns of the
pheno
that will be omitted.- iterations
Numeric value of iterations that will be performed.
Details
To control for variance replicates are important, see for example https://www.nature.com/articles/nmeth.3091.
Examples
samples <- data.frame(L = letters[1:25], Age = rnorm(25),
type = sample(LETTERS[1:5], 25, TRUE))
index <- replicates(samples, 5, controls = 2, omit = "L", iterations = 10)
head(index)
#> $SubSet1
#> [1] 1 7 12 19 21
#>
#> $SubSet2
#> [1] 2 4 17 19 21
#>
#> $SubSet3
#> [1] 6 18 19 21 25
#>
#> $SubSet4
#> [1] 5 19 21 22 23
#>
#> $SubSet5
#> [1] 3 8 11 19 21
#>
#> $SubSet6
#> [1] 10 19 21 24
#>