% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/module1_preqc.R
\name{detect_outlier_wells}
\alias{detect_outlier_wells}
\title{Flag outlier wells by the IQR rule}
\usage{
detect_outlier_wells(
  hts_raw,
  signal_col = "signal",
  group_cols = c("plate_id", "well_type"),
  k = 1.5,
  filter = FALSE
)
}
\arguments{
\item{hts_raw}{An \code{hts_raw} object.}

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

\item{group_cols}{Columns defining comparable well groups within which the
IQR is computed. Default \code{c("plate_id", "well_type")}.}

\item{k}{IQR multiplier for the fences. Default \code{1.5}.}

\item{filter}{Logical; if \code{TRUE} outlier wells are dropped instead of only
flagged. Default \code{FALSE}.}
}
\value{
The input object with a logical \code{outlier} column added (or with
outlier rows removed when \code{filter = TRUE}).
}
\description{
Detects anomalous wells (for example contaminated, bubble or crystallisation
artefacts) using the interquartile-range rule within groups of comparable
wells, and optionally removes them.
}
\examples{
raw <- read_hts_plate(hts_primary_raw)
flagged <- detect_outlier_wells(raw)
sum(flagged$outlier)

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