combine_data_and_map: Combine raw data and plate map to produce a single tall data...

Description Usage Arguments Details Value Examples

View source: R/HTDoseResponseCurve.R

Description

Combine a single data plate matching the output of create_empty_plate with a plate map matching the output of create_empty_plate_map to create a single tall data frame with one row per observation.

Usage

1
2
combine_data_and_map(raw_plate, plate_map, negative_control = 0,
  summary_method = "mean")

Arguments

raw_plate

data frame with format matching that produced by a call to read_incucyte_exported_to_excel

plate_map

list where each item specifies concentrations, treatments, and cell lines for a plate specified in raw_plates, matching the format of a file created by read_platemap_from_excel

negative_control

A designation for the negative controls in this dataset, if they exist. Value may be NA, a number, a string, or a data frame.

  • NA: Use when there are no negative control measurements. The contents of the column named 'value_normalized' will be copied from the contents of the column named 'value'.

  • Number: Use when each treatment has been labeled with a concentration (typically 0) that indicates the vehicle control. Each treatment must contain one or more observations with this concentration, and these observations will be the negative controls.

  • string: Use when a single set of observations is a universal control. The treatment whose name matches the string is the universal negative control all of the data.

  • data frame: Use when more than one negative control exists, and you have to map different treatments to a particular negative control. The data frame must have names 'drug' and 'vehicle', and the data frame will map match treatments in the 'drug' column to those in the 'vehicle' column.

summary_method

summarize replicate measures by either mean or median; must be one of "mean", "median". Defaults to "mean"

Details

The user specifies which wells (if any) bear negative controls (i.e. vehicles)

Value

A data frame where columns indicate the sample type, treatment, concentration, observed raw value, normalized value, name of the negative_control treatment, whether a particular row is a negative control for at least one other row, hours since the start time, and plate of origin. If the data are from a synergy experiment, there will be additional columns concententration_2 and treatment_2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Create a six well plate testing two drugs on two cell lines. Each drug has 
# two concentrations plus a DMSO well. Plan to normalize against DMSO.
# Obviously real data would include replicates, more concentrations, etc.
plate = create_empty_plate( 6, hour=0, plate_id="plate_1")
plate[1:2,1:3] = c(99,98,90,87,77,20)
plate_map = create_empty_plate_map( number_of_wells = 6 )
plate_map$concentration[1:2,1:3] = c( 0, 0, 100, 100, 200, 200 )
plate_map$treatment[1:2,1:3] = c("DMSO","DMSO","drug1","drug2","drug1",
                                 "drug2")
plate_map$sample_type[1:2,1:3] = rep( c("line1", "line2"), 3)
combine_data_and_map( plate, plate_map, negative_control="DMSO" )

# Create a six well plate testing two drugs on two cell lines. Each drug has 
# three concentrations, one of which is vehicle-only and labeled zero.
plate = create_empty_plate( 6, hour=0, plate_id="plate_1")
plate[1:2,1:3] = c(99,98,90,87,77,20)
plate_map = create_empty_plate_map( number_of_wells = 6 )
plate_map$concentration[1:2,1:3] = c( 0, 0, 100, 100, 200, 200 )
plate_map$treatment[1:2,1:3] = c("drug1","drug2","drug1","drug2","drug1",
                                 "drug2")
plate_map$sample_type[1:2,1:3] = rep( c("line1", "line2"), 3)
combine_data_and_map( plate, plate_map, negative_control=0 )

DavidQuigley/HTDoseResponseCurve documentation built on Jan. 23, 2021, 5:10 a.m.