% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/module6_auc_matrix.R
\name{cluster_auc_matrix}
\alias{cluster_auc_matrix}
\title{Hierarchically cluster an AUC matrix}
\usage{
cluster_auc_matrix(mat, k = 3, distance = "euclidean", method = "complete")
}
\arguments{
\item{mat}{A numeric matrix from \code{\link[=build_auc_matrix]{build_auc_matrix()}}.}

\item{k}{Number of compound clusters to cut. Default \code{3}.}

\item{distance}{Distance method for \code{\link[stats:dist]{stats::dist()}}. Default \code{"euclidean"}.}

\item{method}{Linkage method for \code{\link[stats:hclust]{stats::hclust()}}. Default \code{"complete"}.}
}
\value{
A list with \code{row_hclust}, \code{col_hclust} (or \code{NULL} if too few
columns), \code{clusters} (named integer vector of compound cluster ids) and
\code{k}.
}
\description{
Performs hierarchical clustering of the compounds (rows) and samples
(columns) of an AUC matrix and cuts the compound tree into groups.
}
\examples{
drc <- calc_drc_auc(fit_4pl_curve(import_dose_response(hts_dose_response,
  response_col = "viability", group_cols = "cell_line"),
  group_cols = "cell_line"))
cl <- cluster_auc_matrix(build_auc_matrix(drc$meta), k = 2)
table(cl$clusters)

}
\seealso{
\code{\link[=extract_cluster_hit]{extract_cluster_hit()}}, \code{\link[=plot_cluster_tree]{plot_cluster_tree()}}
}
