% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tornado_aggregates.R
\name{tornado_aggregate}
\alias{tornado_aggregate}
\title{Tornado plot for aggregated discoveries}
\usage{
tornado_aggregate(
  discovery,
  znorm = TRUE,
  K = NULL,
  sort = NULL,
  colour_lim = NULL,
  min_var_exp = 0.7,
  print = TRUE
)
}
\arguments{
\item{discovery}{One of the following \code{discovery} objects: \itemize{
  \item{An \code{APA_discovery} object}
  \item{A \code{CSCAn_discovery} object}
  \item{A \code{PESCAn_discovery} object}
}}

\item{znorm}{A \code{logical} of length one deciding whether to z-score
normalize every feature within samples (\code{TRUE}) or not (\code{FALSE}).}

\item{K}{An \code{integer} of length or \code{NULL}, setting the number of
clusters that \code{kmeans()} is instructed to find. When set to 
\code{NULL}, a search for an appropriate \code{K} is conducted to explain
a fraction of the variance controlled by the \code{min_var_exp} argument.}

\item{sort}{An \code{integer} setting sample indices on which the 
row-ordering must be computed. When \code{NULL}, orders on the mean of all 
samples.}

\item{colour_lim}{A \code{numeric} of length two setting the minimum and
maximum values of the colour scale respectively.}

\item{min_var_exp}{A \code{numeric} between 0-1 that controls how much 
variance the \code{kmeans()} result should explain before choosing a K. 
When the \code{K} argument is not \code{NULL}, this is ignored.}

\item{print}{A \code{logical} whether to immediately render the plot.}
}
\value{
A \code{list} with two elements; first a plot and second a 
  \code{data.frame} with cluster annotations per feature.
}
\description{
Takes the bins parallel to the Hi-C diagonal through the anchor locations
and perform k-means clustering on these.
}
\examples{
\dontrun{
apa <- APA(explist, bed)
tornado_aggregate(apa)
}
}
