% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{plot_qc_metric_trend}
\alias{plot_qc_metric_trend}
\title{Trend plot of a QC metric across plates}
\usage{
plot_qc_metric_trend(
  data,
  metric = "z_prime",
  plate_col = "plateID",
  flag_col = NULL,
  threshold = 0.5,
  direction = c("min", "max"),
  colors = c(Bad = "#D55E00", Normal = "#0072B2")
)
}
\arguments{
\item{data}{A data frame with one row per plate, such as \link{screen_plate_qc}.}

\item{metric}{Name of the metric column to plot, as a string. Default
\code{"z_prime"}.}

\item{plate_col}{Name of the plate identifier column, as a string. Default
\code{"plateID"}.}

\item{flag_col}{Optional name of a column of \code{"Bad"}/\code{"Normal"} flags used to
colour points. If \code{NULL} (default) plates are flagged on the fly using
\code{threshold} and \code{direction}.}

\item{threshold}{Numeric cut-off used to flag plates when \code{flag_col} is
\code{NULL}. Default \code{0.5}.}

\item{direction}{Either \code{"min"} (values below \code{threshold} fail, the default)
or \code{"max"} (values above \code{threshold} fail).}

\item{colors}{Named character vector giving the colours for \code{"Bad"} and
\code{"Normal"} plates.}
}
\value{
A \link[ggplot2:ggplot]{ggplot2::ggplot} object: one bar per plate in plate order,
coloured by flag, with a dashed line at the mean and a solid line at
\code{threshold}.
}
\description{
Plots a single QC metric (for example Z', Z-factor or negative-control CV)
for every plate in acquisition order, colouring each plate by a pass/fail
flag and marking the overall mean. This mirrors the per-metric QC review
plots used in the screening pipeline and makes drifting or failing plates
easy to spot.
}
\examples{
plot_qc_metric_trend(screen_plate_qc, metric = "z_prime")

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