wrapperWPM: Generate plate plans in a single step

Description Usage Arguments Value Examples

View source: R/fct_wrapper_wpm.R

Description

Wrapper function that generates plate plans like the wpm shiny application. This feature allows the user to use the wpm package from the command line rather than going through a web application.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
wrapperWPM(
  user_df,
  plate_dims,
  nb_plates,
  forbidden_wells = NULL,
  buffer_wells = NULL,
  fixed_wells = NULL,
  spatial_constraint = "none",
  max_iteration = 20
)

Arguments

user_df

dataframe containing user data obtained with the 'convertCSV()' or 'convertESet()' functions.

plate_dims

list, containing 2 values: the first is the number of plate's lines and second is the number of plate's columns.

nb_plates

numeric, corresponds to the number of plates to fill

forbidden_wells

character, the wells that will not be used at all for the experiment. This argument needs to be a character string giving the wells coordinates of the form "LetterNumber" (eg. "A1" for the well positionned in the first row/ first column of the plate).

buffer_wells

character, the wells that will be used during experiment but without biological sample in it. Same input structure as for forbidden_wells parameter.

fixed_wells

character, the wells that will be used for Quality Control samples or standards during the Experiment. Same input structure as for forbidden_wells parameter.

spatial_constraint

character, is the spatial constraint used to place the samples on the plate. It can also be called neighborhood constraint. Currently, the possible values are "none", "NS" (for North-South), "WE" (for West-East) and "NEWS" (North-South-East-West).

max_iteration

numeric, maximal number of attemps for wpm to find a valid solution.

Value

a dataframe if wpm finds a solution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# create a MSnSet toy example
sample_names <- c("s1","s2","s3","s4", "s5")
M <- matrix(NA, nrow = 4, ncol = 5)
colnames(M) <- sample_names
rownames(M) <- paste0("id", LETTERS[1:4])
pd <- data.frame(Environment = rep_len(LETTERS[1:3], 5),
                 Category = rep_len(1:2, 5), row.names = sample_names)
rownames(pd) <- colnames(M)
x <- MSnbase::MSnSet(exprs = M,pData =  pd)
# convert it to a valid dataframe for wpm
df <- convertESet(x, "Environment")
# run wpm on the toy example
wrapperWPM(user_df = df, plate_dims = list(8,12), nb_plates = 1,
           forbidden_wells = "A1,A2,A3", fixed_wells = "B1,B2",
           spatial_constraint = "NS")

HelBor/wpm documentation built on June 15, 2021, 4:16 p.m.