I'm not sure I understood the examples of the Omixer pacakge. Because when I try to use a layout for multiple batch I was not able to make it work. Now that I made sure there are enough sites to allocate all the samples it tells me that the layout must match exactly with the number of samples to distribute on the plates..
library("Omixer")
data(survey, package = "MASS")
survey$ID <- seq_len(nrow(survey))
n_batch <- 3
layout <- data.frame(well = 1:96,
row = factor(rep(1:8, each=12), labels = LETTERS[1:8]),
column = rep(1:12, 8),
plate = 1,
chip = as.integer(ceiling(rep(1:12, 8)/2)))
layout$chipPos <- ifelse(layout$column %% 2 == 0,
as.numeric(layout$row) + 8,
layout$row)
layout2 <- layout
layout2$plate <- 2
layout3 <- layout
layout3$plate <- 3
plates <- rbind(layout, layout2, layout3)
Omixer_index <- omixerRand(survey, sampleId = "ID",
block = "block", iterNum = 10, wells = 96, mask = rep(1, 237),
plateNum = n_batch, randVars = VoI, layout = plates, techVars = NULL)
#> Error: Problem with `filter()` input `..1`.
#> ℹ Input `..1` is `mask == 0`.
#> x Input `..1` must be of size 288 or 1, not size 237.
Omixer_index <- omixerRand(survey, sampleId = "ID",
block = "block", iterNum = 10, wells = 96, mask = rep(1, 288),
plateNum = n_batch, randVars = VoI, layout = plates, techVars = NULL)
#> Error in omixerRand(survey, sampleId = "ID", block = "block", iterNum = 10, : Number of unmasked wells must equal number of samples.
Omixer_index <- omixerRand(survey, sampleId = "ID",
block = "block", iterNum = 10, wells = 96, mask = rep(0, 237),
plateNum = n_batch, randVars = VoI, layout = plates, techVars = NULL)
#> Error: Problem with `filter()` input `..1`.
#> ℹ Input `..1` is `mask == 0`.
#> x Input `..1` must be of size 288 or 1, not size 237.
Omixer_index <- omixerRand(survey, sampleId = "ID",
block = "block", iterNum = 10, wells = 96, mask = rep(0, 288),
plateNum = n_batch, randVars = VoI, layout = plates, techVars = NULL)
#> Error in omixerRand(survey, sampleId = "ID", block = "block", iterNum = 10, : Number of unmasked wells must equal number of samples.
Created on 2021-07-07 by the reprex package (v2.0.0)
I have a couple of questions related to this:
Is it possible to just use the simple layout (without merging and changing the plate column) and still distribute the samples?
How should work around this?
How should one avoid masking? There seems to be an internal logical problem
From the vignette I think that omixerRand will write a file on the working directory. Is there any option to select the name or where the file will be saved?
Updated with more code to show some internal logic errors. This also happens on the latest 1.2.1 version.