bed_sort {valr}R Documentation

Sort a set of intervals.

Description

Sort a set of intervals.

Usage

bed_sort(x, by_size = FALSE, by_chrom = FALSE, reverse = FALSE)

Arguments

x

ivl_df

by_size

sort by interval size

by_chrom

sort within chromosome

reverse

reverse sort order

See Also

https://bedtools.readthedocs.io/en/latest/content/tools/sort.html

Examples

x <- tibble::tribble(
  ~chrom, ~start, ~end,
  "chr8", 500,    1000,
  "chr8", 1000,   5000,
  "chr8", 100,    200,
  "chr1", 100,    300,
  "chr1", 100,    200
)

# sort by chrom and start
bed_sort(x)

# reverse sort order
bed_sort(x, reverse = TRUE)

# sort by interval size
bed_sort(x, by_size = TRUE)

# sort by decreasing interval size
bed_sort(x, by_size = TRUE, reverse = TRUE)

# sort by interval size within chrom
bed_sort(x, by_size = TRUE, by_chrom = TRUE)


[Package valr version 0.8.1 Index]