% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qc.R
\name{calculate_qc_metrics}
\alias{calculate_qc_metrics}
\title{Plate-level quality-control metrics for high-throughput screens}
\usage{
calculate_qc_metrics(df)
}
\arguments{
\item{df}{A data frame describing one plate with one row per control type. It
must contain the columns \code{experiment_type}, \code{mean} and \code{sd}. The
\code{experiment_type} column is expected to include the levels
\code{"negative_ctrl"}, \code{"positive_cttl"} and \code{"sample"} (an optional
\code{"edgewell"} level is ignored).}
}
\value{
A one-row data frame with columns \code{z_factor}, \code{z_prime}, \code{sb_value},
\code{sn_value} and \code{ssmd_value}.
}
\description{
Computes the standard set of assay quality metrics for a single plate from
per-control-type summary statistics: the Z-factor, Z-prime (Z'), the
signal-to-background ratio, the signal-to-noise ratio and the strictly
standardised mean difference (SSMD).
}
\details{
The metrics follow the usual HTS definitions, using the negative
control and positive (kill) control populations:
\deqn{Z\text{-}factor = 1 - \frac{3(sd_{neg} + sd_{sample})}{|m_{neg} - m_{sample}|}}
\deqn{Z' = 1 - \frac{3(sd_{neg} + sd_{pos})}{|m_{neg} - m_{pos}|}}
with signal-to-background \eqn{m_{neg}/m_{pos}}, signal-to-noise
\eqn{(m_{pos} - m_{neg})/sd_{neg}} and
\eqn{SSMD = (m_{pos} - m_{neg})/\sqrt{sd_{pos}^2 + sd_{neg}^2}}.
}
\examples{
plate <- data.frame(
  experiment_type = c("negative_ctrl", "positive_cttl", "sample"),
  mean = c(1.00, 0.10, 0.60),
  sd = c(0.05, 0.03, 0.20)
)
calculate_qc_metrics(plate)

}
\seealso{
\code{\link[=flag_qc_plates]{flag_qc_plates()}}
}
