% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pyramids.R
\name{pyramid}
\alias{pyramid}
\alias{pyramid_difference}
\title{Plot a region as a pyramid}
\usage{
pyramid(
  exp,
  chrom,
  start,
  end,
  colour,
  crop_x,
  crop_y,
  display_yaxis,
  edge = "black",
  raw,
  ...
)

pyramid_difference(exp1, exp2, chrom, start, end, colour = NULL, ...)
}
\arguments{
\item{exp, exp1, exp2}{A GENOVA \code{contacts} or \code{contacts_matrix} 
object.}

\item{chrom}{One of the following: \itemize{
  \item{A \code{character} of length one indicating a chromosome name.}
  \item{A 3-column, 1-row \code{data.frame} in BED-format.}
  \item{A single \code{character} describing a locus in UCSC notation, e.g. 
  \code{"chr1:30,000,000-40,000,000"}.}
} The latter two options automatically provide the \code{start} and 
\code{end} arguments too.}

\item{start, end}{A \code{numeric} of length one for the start and end positions in
basepairs.}

\item{colour}{One of the following: \itemize{
  \item {A \code{numeric} of length two giving the limits of the colour 
  scale.}
  \item {
    A continuous ggplot2 
    \link[ggplot2:scale_colour_continuous]{scale} with a colour palette.
  }
  \item{\code{NULL} for default scales, which is 
  \code{\link[GENOVA]{scale_fill_GENOVA}()} for single 
  experiments or \code{\link[GENOVA]{scale_fill_GENOVA_div}()} for 
  \code{pyramid_difference()} or z-score normalised experiments.
  }
}}

\item{crop_x, crop_y}{A \code{numeric} of length two indicating positions in
basepairs of where to crop the x- and y-axis respectively. For the y-axis, this
means the distance from the diagonal in basepairs. Cropping the
x-axis typically results in a house-shaped pentagon. Cropping the y-axis 
typically results in a trapezoid.}

\item{display_yaxis}{A \code{logical} of length 1: should the y-axis be
displayed?}

\item{edge}{Draw an edge around the pyramid data region. One of the 
following: \itemize{
  \item{A \code{character} of length 1 with a colour(name).}
  \item{A \code{\link[grid]{gpar}}} object describing graphical parameters
  for a line.
  \item{\code{NULL} to not draw an edge.}
}}

\item{raw}{A \code{logical} of length 1: should a bare bones plot be
returned? When \code{TRUE}, no position- or colour-scales or theme elements
are added.}

\item{...}{Arguments passed to downstream functions.}
}
\value{
A \code{ggplot} object
}
\description{
Plots a region of the Hi-C map with a 45 degree rotation. The
  rotation makes it such that the diagonal coincides with the x-axis and the
  y-axis indicates distance. \code{pyramid_difference()} does the same, but
  first subtracts one sample from the other.
}
\details{
Some \code{colour_scale} settings are adjusted. If no \code{limits}
  were set, new limits are set as \code{c(0, quantile(x, 0.975))}, wherein
  \code{x} are the Hi-C values. Also, the \code{oob} parameter is replaced by
  \code{scales::squish()}, the name is set by default to
  \code{"Contacts"} and the \code{aesthetics} are ignored.
}
\note{
To combine multiples of pyramid plots, we recommend to use the 
  \strong{patchwork} package available on CRAN.
}
\section{Annotations}{
 For annotations along the linear genome, see
  \code{\link[GENOVA]{pyramidtracks}}. For annotations in the Hi-C map, see
  \code{\link[GENOVA]{add_tads}} and \code{\link[GENOVA]{add_loops}}.
}

\examples{
\dontrun{
pyramid(exp, "chr2", 25e6, 30e6)
}
}
\seealso{
Other matrix plots: 
\code{\link{compartment_matrixplot}()},
\code{\link{hic_matrixplot}()},
\code{\link{insulation_matrixplot}()},
\code{\link{trans_matrixplot}()}
}
\concept{matrix plots}
