score: Score Cells as Positive/Negative

View source: R/score.R

scoreR Documentation

Score Cells as Positive/Negative

Description

Assign logical variable positive as TRUE or FALSE in a data.frame of fluorescent intensity values based on the cutoff values in the argument bgnd.

Usage

score(df, bgnd = NULL, param = "mfi", ...)

Arguments

df

A data.frame generated by parseImages or and an appropriate grouping variable.

bgnd

A numeric vector of length one or a named numeric vector for each level of the grouping variable, typically well, row, column, or file. If missing, the function getBgnd will be called with parameters provided in ... to determine the background.

param

A character string identifying the variable to be scored.

...

Additional arguments for getBgnd such as by.

Details

A variable named positive will be added to the data.frame if necessary and assigned TRUE or FALSE if the value named in "param" is greater than the appropriate value in bgnd. If bgnd == NULL, getBgnd will be called with any additional arguments in ... to determine the background.

Examples

# Small set of data by stack
  f <- system.file("extdata", "by_stack", package = "virustiter")
  i <- getImages(f, pattern = "file005")
  v <- parseImages(i)

# Score with grouping value of "file"
  v <- score(v, by = "file")
  xtabs(~ positive, v)
  plot(log(mfi) ~ area, v, col = c(1,2)[positive + 1])


ornelles/virustiter documentation built on March 15, 2024, 9:28 a.m.