% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/module2_norm.R
\name{norm_by_control}
\alias{norm_by_control}
\title{Normalise wells to plate controls}
\usage{
norm_by_control(
  hts_raw,
  signal_col = "signal",
  nc_label = "NC",
  pc_label = "PC"
)
}
\arguments{
\item{hts_raw}{An \code{hts_raw} object (typically after \code{\link[=baseline_subtract]{baseline_subtract()}}).}

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

\item{nc_label, pc_label}{Well-type labels for the negative and positive
controls. Defaults \code{"NC"} and \code{"PC"}.}
}
\value{
An \code{hts_norm} object: the input data with added numeric columns
\code{inhibition} (percent) and \code{viability} (percent). Multiple plates are
normalised independently.
}
\description{
Converts raw or background-subtracted signals to percent inhibition and
percent viability using each plate's own negative (NC) and positive (PC)
controls, so that readouts are comparable across plates. Inhibition is
\eqn{100 \times (m_{NC} - x) / (m_{NC} - m_{PC})} and viability is its
complement relative to the control window.
}
\examples{
raw <- baseline_subtract(read_hts_plate(hts_primary_raw))
norm <- norm_by_control(raw)
summary(norm$inhibition)

}
\seealso{
\code{\link[=merge_plate_data]{merge_plate_data()}}, \code{\link[=plot_plate_heatmap_inhibition]{plot_plate_heatmap_inhibition()}}
}
