% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/delta.R
\name{compute_delta_auc}
\alias{compute_delta_auc}
\title{Differential (delta) AUC between two screening conditions}
\usage{
compute_delta_auc(
  data,
  drug_col = "drug_name",
  condition_col = "condition",
  auc_col = "auc",
  conditions = NULL
)
}
\arguments{
\item{data}{A long-format data frame with one row per drug and condition.}

\item{drug_col}{Name of the drug identifier column, as a string. Default
\code{"drug_name"}.}

\item{condition_col}{Name of the condition column, as a string. Default
\code{"condition"}. The column must contain exactly the two values given in
\code{conditions}.}

\item{auc_col}{Name of the AUC column, as a string. Default \code{"auc"}.}

\item{conditions}{Character vector of length two giving the baseline and
treatment condition, in the order \code{c(baseline, treatment)}. The delta is
computed as \code{treatment - baseline}. Defaults to the two levels found in
\code{condition_col}.}
}
\value{
A data frame with one row per drug containing the two per-condition
AUC columns (named \verb{auc_<condition>}), \code{delta_auc} and \code{zscore_delta_auc}
(the z-scored \code{delta_auc} across all drugs).
}
\description{
Contrasts drug potency between two experimental conditions by reshaping a
long per-drug/per-condition AUC table to one row per drug and computing the
differential AUC together with its within-experiment z-score. This is the
core scoring step for two-condition screens (for example irradiated versus
non-irradiated, or treated versus control).
}
\details{
A negative \code{delta_auc} indicates the treatment condition sensitises
cells to the drug relative to baseline (lower AUC = more killing). The
z-score standardises \code{delta_auc} across all drugs within the experiment so
that hits can be selected on a common scale (see \code{\link[=select_hits_sigma]{select_hits_sigma()}}).
}
\examples{
auc_long <- data.frame(
  drug_name = rep(c("DrugA", "DrugB", "DrugC"), each = 2),
  condition = rep(c("Gy0", "Gy2"), times = 3),
  auc = c(5.0, 3.1, 4.2, 4.0, 6.0, 2.0)
)
compute_delta_auc(auc_long, conditions = c("Gy0", "Gy2"))

}
\seealso{
\code{\link[=select_hits_cutoff]{select_hits_cutoff()}}, \code{\link[=select_hits_sigma]{select_hits_sigma()}}
}
