bed_sort: Sort a set of intervals.

Description Usage Arguments See Also Examples

View source: R/bed_sort.r

Description

Sort a set of intervals.

Usage

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

Arguments

x

tbl_interval()

by_size

sort by interval size

by_chrom

sort within chromosome

reverse

reverse sort order

See Also

http://bedtools.readthedocs.org/en/latest/content/tools/sort.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
x <- trbl_interval(
   ~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)

rnabioco/valr documentation built on Jan. 6, 2019, 9:06 a.m.