addbs {flowTime} | R Documentation

## Add background subtraction to a summary data frame

### Description

Makes a new column from 'column' with the background value of a given 'baseline' control from a chosen identifier column 'baseline_column' subtracted from the values of 'column'.

### Usage

    addbs(data, column, baseline_column, baseline = "noYFP")

### Arguments

`data` | the summary data frame of a flowSet (from 'summarizeFlow' or 'flsummary') to be used in calculating the background subtracted column
`column` | the column containing the fluorescent (or other) measurement to be background subtracted
`baseline_column` | the column containing the identifier of the rows containing background values
`baseline` | `character` the identified or name of representing background fluorescent values

### Value

A summary data frame with an additional column 'column_bs' containing the background subtracted values

### 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"))
    annotation[which(annotation$treatment == 0), 'strain'] <- 'background'
    adat <- annotateFlowSet(dat, annotation)
    dat_sum <- summarizeFlow(adat, gated = TRUE,
    channel = 'FL1.A')
    dat_sum <- addbs(data = dat_sum, column = FL1.Amean,
    baseline_column = strain,
    baseline = "background")

[Package flowTime version 1.18.0 Index]