Normalise and calibrate plate reader measurements to obtain molecular units from the raw data. Originally based on flopr::process_plate but with many changes. Takes as input timecourse plate reader data containing optical density measurements and fluorescence measurements as csv file. First, the function normalises optical density readings and fluorescence readings to an autofluorescence model based on the specified negative wells (see 2020 Fedorec et al ACS SynBio for details). The identity of the blank wells need to be specified in blank_wells, the reading to be used for optical density in od_name, and the fluorescence channels in flu_channels. The autofluorescence model can be set with af_model on the neg_well wells, alternatively, fluorescence can be normalised to blank wells by setting af_model to NULL. Second, if do_quench_correction is TRUE, it compensates for cellular quenching of fluorescence measurements according to the cell density. This requires the specification of od_type as "OD600" or "OD700". Third, if do_calibrate is TRUE, normalised values are calibrated, where conversion factors are provided as od_coeffs_csv for OD and fluor_coeffs_csv for fluorescence, and each calibration is specified by the flu_slugs to represent the FP used, flu_gains to provide the gain used, and flu_labels to specify how the relevant plots should be labelled, (eg. flu_slugs = c("mcherry", "mtagbfp2"), flu_gains = c(60,80), flu_labels = c("RFP, BFP")).

process_plate(
  data_csv,
  blank_well = "A1",
  od_name = "OD",
  flu_channels = c("green1green2"),
  flu_channels_rename = NULL,
  af_model = "spline",
  neg_well = "A2",
  do_quench_correction = FALSE,
  od_type,
  do_calibrate = FALSE,
  instr,
  flu_slugs = c(),
  flu_gains = c(),
  flu_labels = c(),
  od_coeffs_csv,
  fluor_coeffs_csv,
  outfolder = "."
)

Arguments

data_csv

path to a csv file containing parsed plate reader data

blank_well

the well coordinates of one or more media blanks. Defaults to "A1".

od_name

the column name for the optical density data. Defaults to "OD".

flu_channels

the column names for the fluorescence data. Defaults to "green1green2".

flu_channels_rename

if specified, what to change the flu_channels column names to, before computing normalisations and calibrations. Can be useful if the channel_name in the calibration file is named differently from the columns in the data file. Needs to be same length as flu_channels, if not all require changing, specify them anyway to allow positional replacement (first element in flu_channels_rename replaces first in flu_channels, etc). Defaults to NULL.

af_model

model used to fit negative control autofluorescence. For now these include "polynomial", "invers_poly", "exponential", "spline" and "loess". If set to NULL, no model is used, and fluorescence is normalised akin to OD: by subtracting the value for the blanks. Defaults to "spline".

neg_well

the well coordinates of a non-fluorescent control. Defaults to "A2".

do_quench_correction

logical. Should function correct for anticipated quenching of fluorescence, depending on the cell density?

od_type

Which OD-type was used? Required for quench correction. "OD600" or "OD700".

do_calibrate

logical. Should function convert OD and fluorescence data to calibrated units? Defaults to FALSE.

instr

character string to represent instrument. If do_calibrate = TRUE, used for filtering od_coeffs_csv and fluor_coeffs_csv files for conversion factors of the relevant instrument.

flu_slugs

character array representing fluorescent proteins (format = FPbase slug). If do_calibrate = TRUE, used for filtering fluor_coeffs_csv for conversion factors of the relevant FP.

flu_gains

numeric array representing gains of each fluorescent channel. If do_calibrate = TRUE, used for filtering fluor_coeffs_csv for conversion factors of the relevant gain.

flu_labels

If do_calibrate = TRUE, the column names to be given to each calibration. May be identical to flu_slug or flu_channel, but recommended is to make it obvious which FP is being calibrated, eg "mCherry", as channel names may be nonspecifically named eg "red1red1". Needs to be same length as flu_slugs and flu_gains.

od_coeffs_csv

if do_calibrate = TRUE, path of the csv file containing conversion factors for optical density

fluor_coeffs_csv

if do_calibrate = TRUE, path of the csv file containing predicted conversion factors for the fluorescent channels

outfolder

path to folder where output files should be saved. Defaults to current working directory.

Value

a data.frame with columns for raw plate reader data, normalised data and, if do_calibrate = TRUE, calibrated OD and FP data

Examples