% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{plot_condition_scatter}
\alias{plot_condition_scatter}
\title{Scatter plot comparing two conditions or cell lines}
\usage{
plot_condition_scatter(data, x, y, drug_col = "drug_name", label_n = 5)
}
\arguments{
\item{data}{A data frame with one row per drug.}

\item{x, y}{Names of the two numeric score columns to place on the x and y
axes, as strings.}

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

\item{label_n}{Number of most-extreme drugs (by distance from the origin) to
label per quadrant. Default \code{5}.}
}
\value{
A \link[ggplot2:ggplot]{ggplot2::ggplot} object.
}
\description{
Plots a per-drug scatter of a score (for example delta AUC) under two
conditions or cell lines, colouring points by quadrant and labelling the most
extreme drugs in each quadrant. This is useful for spotting drugs that
behave differently between, say, a cancer and a normal cell line.
}
\details{
Point labelling uses \pkg{ggrepel} when available and falls back to
\code{\link[ggplot2:geom_text]{ggplot2::geom_text()}} otherwise. The axes are centred on the origin with a
fixed aspect ratio so the four quadrants are equal in size.
}
\examples{
df <- data.frame(
  drug_name = paste0("Drug", 1:8),
  MRC5 = c(-1, 0.5, -0.2, 1.2, -0.8, 0.3, -1.5, 0.9),
  A549 = c(-1.2, 0.1, 0.7, -0.9, -1.1, 1.0, -0.4, 0.6)
)
plot_condition_scatter(df, x = "MRC5", y = "A549")

}
\seealso{
\code{\link[=plot_delta_auc_heatmap]{plot_delta_auc_heatmap()}}
}
