tally: Tally Positive Fluorescent Values

View source: R/tally.R

tallyR Documentation

Tally Positive Fluorescent Values

Description

Tally positive and negative values from from the data.frame generated by parseImages by a grouping variable such as "well" or "file" that corresponds to a single multiplicity.

Usage

tally(df, pd = NULL, moi = NULL, by = NULL, param = "mfi")

Arguments

df

Annotated data.frame with fluorescent values to evaluate.

pd

Optional phenotype data.frame to add to results.

moi

Character string identifying the independent value. If NULL, variables named "moi" and "x" will be sought. Note that in the returned value, this variable will be named "x".

by

Character string identifying the grouping variable. If NULL, either "well" or "file" must be present and will be used as the grouping variable.

param

Character string identifying the variable in df to evaluate, typically "mfi".

Details

The variable named positive will be tallied for each value of moi (if present) represented by each level of the grouping variable by.

Value

A data.frame of tallied values for each level of the grouping variable (typically well or file) with additional information provided by the optional phenotype data. Variables generated by tally are expected by downstream functions. Notably, the dependent variable will be renamed x in the output. These variables include:

  • The independent variable representing the multiplicity of infection in x

  • The dependent variable as the fraction of positive cells in y

  • The number of positive cells in pos

  • The number of negative in neg

  • Details about the grouping variable, typically well or file

Examples

# Sample data by folder
  f <- system.file("extdata", "by_folder", package = "virustiter")
  pd <- read.csv(system.file("extdata", "by_folder/phenoData.csv", package = "virustiter"))
  i <- getImages(f)
  v <- parseImages(i)
  v <- mergePdata(pd, v)
  v <- score(v)
  tally(v)


ornelles/virustiter documentation built on March 29, 2024, 8:30 p.m.