addnorm: Normalize fluorescence

View source: R/summaryAnalysis.R

addnormR Documentation

Normalize fluorescence

Description

Produces a normalized fluorescence column 'normed'. Expects the 'FL1.A_bs' column to exist or a column to be specified. Has three different methods, version 1 and version 2, described in the script

Usage

addnorm(
  frame,
  factor_in = c("strain", "treatment"),
  method = 1,
  column = "FL3.Amean_bs"
)

Arguments

frame

data frame of summary statistics to be normalized

factor_in

character vector containing the varibles to split the data frame by

method

which normalization method to use, 1, 2 or 3.

column

character the column to apply the normalization to

Details

Method 1, the default normalization method, takes the highest point in each dataset grouped by 'factor_in' and normalizes all values in the group by this point. This method is default because it works regardless of whether the data is a time series. Method 2 finds the mean value of all time points with time values less than 0 for each group and normalizes each group by this respective value. Requires a time series with negative time values to work. Method 3 fits a linear model to the pre-zero time points for each groups, infers the y-intercept, and normalizes using this intercept. Method 3 also requires a time series with negative time values to work.

Value

data frame containing the additional normalized variable

Examples

dat <- read.flowSet(path=system.file("extdata", "tc_example",
package = "flowTime"), alter.names = TRUE)
annotation <- read.csv(system.file("extdata", "tc_example.csv",
package = "flowTime"))
adat <- annotateFlowSet(dat, annotation)
loadGates(gatesFile = 'C6Gates')
dat_sum <- summarizeFlow(adat, ploidy = "diploid", only = "singlets",
channel = "FL1.A")
dat_sum <- addnorm(dat_sum, c("strain", "treatment"), method = 1,
column = "FL1.Amean")


wrightrc/flowTime documentation built on Dec. 8, 2022, 9:50 p.m.