% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/module1_preqc.R
\name{calc_plate_qc}
\alias{calc_plate_qc}
\title{Comprehensive per-plate quality assessment}
\usage{
calc_plate_qc(
  hts_raw,
  signal_col = "signal",
  nc_label = "NC",
  pc_label = "PC",
  sample_label = "compound",
  z_prime_min = 0.5
)
}
\arguments{
\item{hts_raw}{An \code{hts_raw} object.}

\item{signal_col}{Name of the signal column. Default \code{"signal"}.}

\item{nc_label, pc_label}{Well-type labels for the negative and positive
controls. Defaults \code{"NC"} and \code{"PC"}.}

\item{sample_label}{Well-type label for the test (compound) wells, used by
the sample-aware Z-factor. Default \code{"compound"}.}

\item{z_prime_min}{Acceptance threshold applied to the Z'-factor to set the
\code{pass} flag. Default \code{0.5}.}
}
\value{
A data frame with one row per plate and the columns \code{plate_id},
\code{mean_nc}, \code{mean_pc}, \code{sd_nc}, \code{sd_pc}, \code{cv_nc}, \code{cv_pc}, \code{signal_window},
\code{sb} (signal-to-background), \code{sn} (signal-to-noise), \code{z_prime},
\code{robust_z_prime}, \code{z_factor}, \code{ssmd} and a logical \code{pass}.
}
\description{
Computes the full panel of assay-quality metrics used to judge a
high-throughput screening plate, in a single per-plate table. Alongside the
classic Z'-factor this reports the median/MAD-based \strong{robust Z'-factor}, the
sample-aware \strong{Z-factor}, \strong{SSMD}, the \strong{signal-to-background (S/B)} and
\strong{signal-to-noise (S/N)} ratios, and the \strong{coefficient of variation (CV\%)}
of each control population. All of these can then be visualised through the
single entry point \code{\link[=plot_plate_qc]{plot_plate_qc()}}.
}
\details{
Each metric also has its own dedicated function, useful when you only need one
number (and each with its own acceptance threshold): \code{\link[=calc_z_prime]{calc_z_prime()}},
\code{\link[=calc_robust_z_prime]{calc_robust_z_prime()}}, \code{\link[=calc_z_factor]{calc_z_factor()}}, \code{\link[=calc_ssmd]{calc_ssmd()}}, \code{\link[=calc_sb_ratio]{calc_sb_ratio()}},
\code{\link[=calc_sn_ratio]{calc_sn_ratio()}} and \code{\link[=calc_cv]{calc_cv()}}. \code{calc_plate_qc()} uses the very same
formulas so the numbers agree.

What each metric tells you, with the high-signal control taken as
whichever of NC/PC has the larger mean and the low-signal control as the
other:
\itemize{
\item \strong{CV\%} \eqn{= 100\,\sigma/\mu} of each control — pipetting/reagent
reproducibility; lower is better.
\item \strong{S/B} \eqn{= \mu_{hi}/\mu_{lo}} — raw dynamic range of the assay.
\item \strong{S/N} \eqn{= (\mu_{hi}-\mu_{lo})/\sigma_{lo}} — assay window
relative to background noise.
\item \strong{Z'-factor} \eqn{= 1 - 3(\sigma_{nc}+\sigma_{pc})/|\mu_{nc}-\mu_{pc}|}
— overall control-only assay quality (\verb{>= 0.5} excellent).
\item \strong{Robust Z'-factor}: as Z'-factor but with medians and MADs,
resistant to outlier control wells.
\item \strong{Z-factor} \eqn{= 1 - 3(\sigma_{s}+\sigma_{nc})/|\mu_{s}-\mu_{nc}|}
using the sample population \eqn{s} — is the window large versus the
library spread (often low/negative in primary screens).
\item \strong{SSMD} \eqn{= (\mu_{nc}-\mu_{pc})/\sqrt{\sigma_{nc}^2+\sigma_{pc}^2}}
— effect-size measure of control separation for hit cut-offs.
}
}
\examples{
raw <- read_hts_plate(hts_primary_raw)
calc_plate_qc(raw)

}
\seealso{
\code{\link[=plot_plate_qc]{plot_plate_qc()}}, \code{\link[=calc_z_prime]{calc_z_prime()}}, \code{\link[=calc_well_zscore]{calc_well_zscore()}}
}
