tidy_single_plate {microdiluteR}R Documentation

Tidy single 96-well plate via parameters

Description

This function processes a single raw 96-well plate data from a photometer measurement by adding metadata via user-specified parameter values.

Usage

tidy_single_plate(
  input_data,
  direction = c("horizontal", "vertical"),
  group_ID = NULL,
  experiment_name = NULL,
  validity_method = c("threshold", "invalid"),
  threshold = NULL,
  invalid_samples = NULL,
  treatment_labels,
  concentration_levels,
  ...
)

Arguments

input_data

Either a file path or a data frames with 8 rows and 12 columns.

direction

A character vector specifying the orientation of the plate layout. It can be either "horizontal" or "vertical".

group_ID

A character vector providing group identifiers for each experiment.

experiment_name

A string providing the name of the experiment. The hierarchy is group > experiment, i.e. within a single group, there might be several experiments taking place (e.g. multiple extracts from the same plant species tested with plant species being the group and type of extract being the experiment).

validity_method

A character vector specifying the method for determining cell validity. It can be either "threshold" (i.e. samples are validated based on a common absorption maximum) or "samples" (i.e. samples are manually specified as invalid).

threshold

A numeric threshold value. Applied if validity_method is set to 'threshold'.

invalid_samples

A character vector containing well positions (e.g. "A-3", "B-8",...) of invalid samples. Applied if validity_method is set to 'samples'.

treatment_labels

A character vector containing treatment labels.

concentration_levels

A numeric vector containing concentration levels.

...

Additional arguments to be passed to read_plates.

Details

This function processes photometer data from a single measurement and adds metadata based on user-set parameters. It supports two methods for determining cell validity: "threshold" and "invalid". If "threshold" method is chosen, the validity of each cell is determined based on a specified threshold value. If "sample" method is chosen, samples at specified well positions on the plate are considered invalid. The function generates lists of treatments and concentration levels based on the direction parameter, i.e. the direction of the treatments and concentration levels applied (either horizontally or vertically on the plate). To add metadata to several plates at the same time, the functions tidy_plates_via_params and tidy_plates_via_prompts are recommended.

For all three functions, tidy_plate, tidy_plates_via_params, and tidy_plates_via_prompts, to work properly, file names should provide a file identifier (i.e. "bma" in case there are additional but unused files in the folder), an identifier for experiments (starting with "exp" followed by a number, e.g. "exp1") and an identifier for timepoints (starting with the upper- or lower-case letter t followed by a number, e.g. "T0" or "t0").

Value

A tidy tibble containing data and metadata.

See Also

tidy_plates_via_params, tidy_plates_via_prompts

Examples

# Load example data
data(bma)
# Add metadata from user parameters
bma_tidy <- tidy_single_plate(input_data = bma[1],
                       direction = "horizontal",
                       group_ID = "Group A",
                       experiment_name = "Experiment 1",
                       validity_method = "threshold",
                       threshold = 1,
                       treatment_labels = LETTERS[1:8],
                       concentration_levels = seq(from=80, to=10, length.out=8))
bma_tidy # View tidy data

[Package microdiluteR version 1.0.1 Index]