create_dataset: Create a dataset from raw data without a plate map

Description Usage Arguments Value Examples

View source: R/HTDoseResponseCurve.R

Description

Create a dataset from raw data without a plate map

Usage

1
2
create_dataset(sample_types, treatments, concentrations, values, hours = 0,
  plate_id = "plate_1", negative_control = NA, summary_method = "mean")

Arguments

sample_types

vector of sample types

treatments

vector of treatments

concentrations

vector of concentrations

values

vector of measured response to treatment

hours

time points for each observation. If a number, the same time point is assigned to all observations. If a vector, there should be one number for each observation. Defaults to 0.

plate_id

Text string identifying this experiment, useful if multiple datasets are later combined. Defaults to "plate_1".

negative_control

Controls the normalization. This 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

Method used to combine replicate measures into a single value; must be one of "mean", "median". Defaults to "mean".

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# six measurements: DMSO, 100, and 200 nM for two drugs. 
# plan to normalize each line against DMSO for that line
# not specifying hours or a plate ID
ds = create_dataset( 
  sample_types= c("line1","line1","line1","line2","line2","line2"),
  treatments = c("DMSO","drug1","drug2","DMSO","drug1","drug2"),
  concentrations = c(0, 100, 200, 0, 100, 200),
  values = c(98, 90, 20, 99, 89, 87), 
  negative_control = "DMSO")

# same as above, now specifying hours and a plate ID
ds = create_dataset( 
  sample_types= c("line1","line1","line1","line2","line2","line2"),
  treatments = c("DMSO","drug1","drug2","DMSO","drug1","drug2"),
  concentrations = c(0, 100, 200, 0, 100, 200),
  hours = c(48, 48, 48, 48, 48, 48),
  values = c(98, 90, 20, 99, 89, 87), 
  plate_id = "plate_dq",
  negative_control = "DMSO")
  
# six measurements; drug1 at 0, 100, 200 nM and drug2 at 0, 100, 200 nM. 
# plan to normalize against zero concentration for each line
ds = create_dataset( 
  sample_types= c("line1","line1","line1","line2","line2","line2"),
  treatments = c("drug1","drug1","drug2","drug2","drug2","drug2"),
  concentrations = c(0, 100, 200, 0, 100, 200),
  hours = c(48, 48, 48, 48, 48, 48),
  values = c(98, 90, 20, 99, 89, 87), 
  plate_id = "plate_dq",
  negative_control = 0)
  
# six measurements; drug1 at 0, 100, 200 nM and drug2 at 0, 100, 200 nM. 
# plan to normalize drug1 against DMSO and drug2 against ethanol
individual_vehicles = data.frame(
  drug=c("drug1", "drug2"), 
  vehicle=c("DMSO", "ethanol"),
  stringsAsFactors=FALSE)
ds = create_dataset( 
  sample_types= c("line1","line1","line1","line2","line2","line2"),
  treatments = c("DMSO","drug1","drug1","ethanol","drug2","drug2"),
  concentrations = c(0, 100, 200, 0, 100, 200),
  hours = c(48, 48, 48, 48, 48, 48),
  values = c(98, 90, 20, 99, 89, 87), 
  plate_id = "plate_dq",
  negative_control = individual_vehicles)

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