Skip to contents

This function will calculate the difference in well summary statistics between the experimental condition and the median control condition within a group. The proper grouping variables are supplied with ....

Usage

delta(
  data,
  ...,
  WF = "filter",
  vars = c("median_wormlength_um", "cv_wormlength_um"),
  doseR = F
)

Arguments

data

A data frame output from any WF function.

...

<[`dynamic-dots`][rlang::dyn-dots]> Variable(s) used to group data. It is recommended to group data to independent bleaches for all strains. Variable names in data are supplied separated by commas and without quotes. For example, the typical variables for grouping are Metadata_Experiment, bleach, strain.

WF

Select "filter" or "ignore". The default, "filter", will filter out all flagged wells before calculating the delta from control, if present. "ignore" will calculate the delta including all flagged data. Be careful using "ignore", it is only included for diagnostic purposes.

vars

The well summary statistics to perform the delta calculation on. These are supplied in a character vector. For example, the default is set to c("median_wormlength_um", "cv_wormlength_um").

doseR

Logical, is this dose response data? The default, doseR = FALSE, expects control data to be recorded in the design file a particular way. Specifically, the drug and diluent variables should be identical for controls, e.g, drug = DMSO, diluent = DMSO, concentration_um = 0. If doseR = TRUE, the controls are expected to be coded differently, .e.g, drug = ABZ, diluent = DMSO, concentration_um = 0. Warning messages are produced if the controls do not fit expectations, but try to ensure the controls are coded properly without relying this function to catch all edge cases.

Value

A data frame identical to the input but with control delta variables added, i.e., median_wormlength_um_delta and cv_wormlength_um_delta. The median values for the control conditions are also added as control_median_wormlength_um and control_cv_wormlength_um.