Skip to contents

add_treatment adds treatment metadata to photometer data that is specified in long format. For this function to work properly, the column containing the well positions should be named 'Position' and the column containing the corresponding absorption values should be named 'Values'.

generate_treatment_list generates a list of provided treatment labels mapped to the user-specified plate layout. The plate layout is based on a 96-well plate and can be either horizontal (i.e. letters A-H) or vertical (i.e. numbers 1-12).

ask_treatment_list works the same way as generate_treatment_list, but retrieves the treatment labels based on a user prompt instead of user-set parameters. The plate axis can be either in horizontal direction providing letters A-H or in vertical direction providing numbers 1-12 based on a 96-well plate layout.

match_treatment maps treatment labels to corresponding well positions and returns 'NA' otherwise.

Usage

add_treatment(
  input_data,
  treatment_list = NULL,
  ask_treatment_list = TRUE,
  ...
)

generate_treatment_list(treatment_labels, direction)

ask_treatment_list(direction = c("horizontal", "vertical"))

match_treatment(well_position, treatment_list)

Arguments

input_data

A data frame with well positions and their corresponding values.

treatment_list

A list containing treatment information

ask_treatment_list

A boolean parameter indicating whether treatment labels should be retrieved via user prompt (default) or not.

...

Additional arguments to be passed to ask_treatment_list.

treatment_labels

A character vector containing treatment labels.

direction

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

well_position

The sample position(s) to check

Value

add_treatment returns a data frame with treatment information added.

generate_treatment_list returns a list of treatment labels where each level is assigned to a corresponding row or column based on the selected direction parameter.

ask_treatment_list returns a list containing plate axes as keys and treatment labels as values.

match_treatment returns the corresponding treatment labels if sample position matches treatment criteria, "NA" otherwise

Details

generate_treatment_list checks if the length of treatment_labels matches the specified number of rows or columns based on the direction parameter. If not, it throws an error. If the lengths match, it generates a list of treatment_labels where each label is assigned to a corresponding row or column based on the direction parameter.