calculate_relative_overlap1d: Relative Anchor Overlap of two Peaks

Description Usage Arguments Value Examples

View source: R/auxiliary.R

Description

Calculates the overlap between anchor A of interaction 1 and anchor A of interaction 2, as well as anchor B of interaction 1 and anchor B of interaction 2. The overlap (in nucleotides) is then normalized by the length of the anchors.

Usage

1
calculate_relative_overlap1d(peak1_start, peak1_end, peak2_start, peak2_end)

Arguments

peak1_start

integer vector; genomic start coordinate(s) of peak in replicate 1

peak1_end

integer vector; genomic end coordinate(s) of peak in replicate 1

peak2_start

integer vector; genomic start coordinate(s) of peak in replicate 2

peak2_end

integer vector; genomic end coordinate(s) of peak in replicate 2

Value

numeric vector; relative overlaps between peak pairs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 100% overlap
calculate_relative_overlap1d(100, 120,
                         100, 120)

# 50% overlap
calculate_relative_overlap1d(100, 120,
                         100, 110)

# negative overlap
calculate_relative_overlap1d(100, 120,
                         130, 140)

# larger negative overlap
calculate_relative_overlap1d(100, 120,
                         200, 220)

# vectorized example
calculate_relative_overlap1d(c(100, 100, 100, 100),
                         c(120, 120, 120, 120),
                         c(100, 100, 130, 200),
                         c(120, 110, 140, 220))

idr2d documentation built on Nov. 8, 2020, 6:16 p.m.