Calculate the relative distance distribution between two BED data tables.

reldist_bed(x, y)

Arguments

x

A GRanges.

y

A GRanges.

Value

The relative distance distribution.

References

Manual page of bedtools reldist: https://bedtools.readthedocs.io/en/latest/content/tools/reldist.html

Exploring Massive, Genome Scale Datasets with the GenometriCorr Package. Favorov A, Mularoni L, Cope LM, Medvedeva Y, Mironov AA, et al. (2012) PLoS Comput Biol 8(5): e1002529. doi:10.1371/journal.pcbi.1002529

Examples

# Load BED tables
x <- read_bed(system.file("extdata", "example2.bed.gz", package = "bedtorch"), use_gr = FALSE)
y <- read_bed(system.file("extdata", "example2_window.bed", package = "bedtorch"), use_gr = FALSE)

# Basic usages
reldist_bed(x, y) 

#>     reldist count total        freq
#>  1:    0.00     6   270 0.022222222
#>  2:    0.01     8   270 0.029629630
#>  3:    0.02     4   270 0.014814815
#>  4:    0.03     3   270 0.011111111
#>  5:    0.04     2   270 0.007407407
#>  6:    0.05     8   270 0.029629630
#>  7:    0.06     3   270 0.011111111
#>  8:    0.07     3   270 0.011111111
#>  9:    0.08     7   270 0.025925926
#> 10:    0.09     5   270 0.018518519
#> 11:    0.10     8   270 0.029629630
#> 12:    0.11     6   270 0.022222222
#> 13:    0.12     5   270 0.018518519
#> 14:    0.13     5   270 0.018518519
#> 15:    0.14     5   270 0.018518519
#> 16:    0.15     4   270 0.014814815
#> 17:    0.16     5   270 0.018518519
#> 18:    0.17     2   270 0.007407407
#> 19:    0.18    10   270 0.037037037
#> 20:    0.19    10   270 0.037037037
#> 21:    0.20     6   270 0.022222222
#> 22:    0.21     3   270 0.011111111
#> 23:    0.22     3   270 0.011111111
#> 24:    0.23     6   270 0.022222222
#> 25:    0.24    10   270 0.037037037
#> 26:    0.25     8   270 0.029629630
#> 27:    0.26     8   270 0.029629630
#> 28:    0.27     7   270 0.025925926
#> 29:    0.28     5   270 0.018518519
#> 30:    0.29     8   270 0.029629630
#> 31:    0.30     6   270 0.022222222
#> 32:    0.31     4   270 0.014814815
#> 33:    0.32     6   270 0.022222222
#> 34:    0.33     3   270 0.011111111
#> 35:    0.34     5   270 0.018518519
#> 36:    0.35     2   270 0.007407407
#> 37:    0.36     6   270 0.022222222
#> 38:    0.37     3   270 0.011111111
#> 39:    0.38     2   270 0.007407407
#> 40:    0.39     8   270 0.029629630
#> 41:    0.40     6   270 0.022222222
#> 42:    0.41     7   270 0.025925926
#> 43:    0.42     5   270 0.018518519
#> 44:    0.43     5   270 0.018518519
#> 45:    0.44     4   270 0.014814815
#> 46:    0.45     9   270 0.033333333
#> 47:    0.46     6   270 0.022222222
#> 48:    0.47     3   270 0.011111111
#> 49:    0.48     3   270 0.011111111
#> 50:    0.49     4   270 0.014814815
#>     reldist count total        freq