% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/insulation_score.R
\name{insulation_score}
\alias{insulation_score}
\title{Calculate insulation scores}
\usage{
insulation_score(
  explist,
  window = 30,
  norm_to = c("chromosome", "genome", "none"),
  norm_fun = log2overmedian
)
}
\arguments{
\item{explist}{Either a single GENOVA \code{contacts} object or list of
GENOVA \code{contact} objects.}

\item{window}{An \code{integer} of length 1 for the size of the sliding
square.}

\item{norm_to}{A \code{character} of length 1, either \code{"chromosome"} or
\code{"genome"} noting whether normalisation should occur per chromosome or
for the genome as a whole. Can be set to \code{"none"} to skip
normalisation.}

\item{norm_fun}{A \code{function} that takes a numeric vector as input and
returns normalised values of equal length. Defaults to calculating the
\ifelse{html}{\out{log<sub>2</sub>}}{\eqn{log_2}} value over the median.}
}
\value{
An \code{IS_discovery} object containing the following slot: \describe{
  \item{insula_score}{A \code{data.table} with genomic locations and
  insulation scores for each element in the '\code{explist}' argument.}}
}
\description{
Insulation scores are calculated by sliding a square along the diagonal of
the Hi-C matrix and averaging the values in that square.
}
\details{
Typically, when the sliding square passes within a TAD, it yields
  high insulation scores whereas in between TADs it yields low insulation
  scores. Hence, TAD boundaries can be identified as local minima in the
  insulation score.

  To follow the Crane \emph{et al}. (2015) strategy for insulation scores,
  use 10kb resolution \code{contacts} objects, set the '\code{window}'
  argument to 50, set the '\code{norm_to}' argument to \code{"chromosome"}
  and the '\code{norm_fun}' argument to \code{log2overmean}.
}
\section{Resolution recommendation}{
 10kb-40kb
}

\examples{
\dontrun{
iscore <- insulation_score(list(WT_20kb, KO_20kb), window = 20)
}
}
\seealso{
For calling TADs from insulation scores, see
  \code{\link[GENOVA]{call_TAD_insulation}}. For plotting a heatmap of
  insulation over genomic locations, see
  \code{\link[GENOVA]{tornado_insulation}}.
}
