calculate_midpoint_distance1d | R Documentation |
Calculates the distance in nucleotides between the midpoints of two peaks.
Note: peaks must be on the same chromosome; start coordinate is always less than end coordinate
calculate_midpoint_distance1d(peak1_start, peak1_end, peak2_start, peak2_end)
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 |
positive integer vector; distances between peak pairs
# identical, zero distance
calculate_midpoint_distance1d(100, 120,
100, 120)
# centered, zero distance
calculate_midpoint_distance1d(100, 120,
90, 130)
# off by 10 per anchor
calculate_midpoint_distance1d(100, 120,
110, 130)
# vectorized example
calculate_midpoint_distance1d(c(100, 100, 100),
c(120, 120, 120),
c(100, 90, 110),
c(120, 130, 130))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.