% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/direct_index.R
\name{direct_index}
\alias{direct_index}
\title{Directionality index}
\usage{
direct_index(explist, range = 100)
}
\arguments{
\item{explist}{Either a single GENOVA \code{contacts} object or list of
GENOVA \code{contacts}.}

\item{range}{An \code{integer} of length 1 indicating how many bins from the
diagonal should be considered.}
}
\value{
A \code{DI_discovery} object containing a directionality index for
  every informative bin.
}
\description{
The directionality index quantifies the degree of bias between upstream and
downstream interactions given a bin on the diagonal. Such biases become
apparent near the periphery of TADs: the upstream portion of a TAD interacts
more with the downstream bins and inversely, the downstream portion of a TAD
interacts more with the upstream bins.
}
\details{
The directionality index is computed as described in Dixon \emph{et
  al}. (2012):

  \deqn{DI = (\frac{B - A}{|B - A|})}{DI = ((B - A) / (|B - A|)) ((A - E)^2 /
  E + (B - E)^2 / E)}

  Wherein \eqn{A} and \eqn{B} are the sum of the contacts up- and downstream
  of a bin on the diagonal respectively, and \eqn{E = (A + B)/2}.

  The first part signs the second part of the equation by the direction of
  the effect. The \eqn{\chi^2} test statistics can be recognised in the
  second part of the equation with a null-hypothesis that the upstream and
  downstream signal is equal.

  The authors originally used a 40kb matrix with a 2Mb range, equivalent to
  \code{range = 50}.
}
\examples{
\dontrun{
# As original authors
di <- direct_index(list(WT_40kb, KO_40kb), range = 50)

# Plotting the DI
visualise(di)
}
}
