% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/module5_drc.R
\name{fit_4pl_curve}
\alias{fit_4pl_curve}
\title{Fit four-parameter logistic curves per compound}
\usage{
fit_4pl_curve(
  data,
  response = "response",
  concentration = "concentration",
  compound_col = "compound_id",
  group_cols = NULL,
  rsq_min = 0.85
)
}
\arguments{
\item{data}{An \code{hts_dose} object from \code{\link[=import_dose_response]{import_dose_response()}} (or a long
data frame with \code{compound_id}, \code{concentration}, \code{response}).}

\item{response, concentration, compound_col}{Column names. Default
\code{"response"}, \code{"concentration"}, \code{"compound_id"}.}

\item{group_cols}{Optional grouping columns.}

\item{rsq_min}{Curves with \eqn{R^2} below this are flagged (not dropped
here; use \code{\link[=filter_low_quality_curve]{filter_low_quality_curve()}}). Default \code{0.85}.}
}
\value{
An \code{hts_drc} object: a list with \code{meta} (one row per curve: keys,
\code{n}, \code{rsq}, \code{converged}, \code{pass}), \code{fits} (named list of \code{dsr_4pl} models)
and \code{data} (the input). \code{group_cols} is stored as an attribute.
}
\description{
Fits a 4PL dose-response model to every compound (optionally split by
grouping columns such as cell line), reusing the package's self-contained
fitter, and records the goodness of fit \eqn{R^2}. No external fitting
package is required.
}
\examples{
dr <- import_dose_response(hts_dose_response, response_col = "viability",
  group_cols = "cell_line")
drc <- fit_4pl_curve(dr, group_cols = "cell_line")
head(drc$meta)

}
\seealso{
\code{\link[=extract_drc_params]{extract_drc_params()}}, \code{\link[=calc_drc_auc]{calc_drc_auc()}}, \code{\link[=plot_single_drc]{plot_single_drc()}}
}
