A 2D iterator interval '(chrom1, start1, end1, chrom2, start2, end2)' is
said to represent a contact between two 1D intervals I1 and I2: '(chrom1,
start1, end1)' and '(chrom2, start2, end2)'.
For contacts where 'chrom1' equals to 'chrom2' and I1 is within source
intervals the function calculates the distribution of distances between I1
and I2. The distribution is calculated separately for intra-domain and
inter-domain contacts.
An interval is within source intervals if the unification of all source
intervals fully overlaps it. 'src' intervals are allowed to contain
overlapping intervals.
Two intervals I1 and I2 are within the same domain (intra-domain contact) if
among the domain intervals exists an interval that fully overlaps both I1
and I2. Otherwise the contact is considered to be inter-domain. 'domain'
must contain only non-overlapping intervals.
The distance between I1 and I2 is the absolute distance between the centers
of these intervals, i.e.: '|(start1 + end1 - start2 - end2) / 2|'.
The range of distances for which the distribution is calculated is defined
by 'breaks' argument. For example: 'breaks=c(x1, x2, x3, x4)' represents
three different intervals (bins): (x1, x2], (x2, x3], (x3, x4].
If 'include.lowest' is 'TRUE' the the lowest value will be included in the
first interval, i.e. in [x1, x2]