Skip to contents

Spacing for the first interval of each chromosome is undefined (NA). The leading interval of an overlapping interval pair has a negative value.

Usage

interval_spacing(x)

Arguments

x

ivl_df

Value

ivl_df with .spacing column.

See also

Examples

x <- tibble::tribble(
  ~chrom, ~start, ~end,
  'chr1', 1,      100,
  'chr1', 150,    200,
  'chr2', 200,    300
)

interval_spacing(x)
#> # A tibble: 3 × 4
#>   chrom start   end .spacing
#>   <chr> <dbl> <dbl>    <dbl>
#> 1 chr1      1   100       NA
#> 2 chr1    150   200       50
#> 3 chr2    200   300       NA