Used to remove out-of-bounds intervals, or trim interval coordinates using a
genome
.
bound_intervals(x, genome, trim = FALSE)
x | |
---|---|
genome | |
trim | adjust coordinates for out-of-bounds intervals |
Other utilities: bed12_to_exons
,
bed_makewindows
,
flip_strands
,
interval_spacing
x <- trbl_interval( ~chrom, ~start, ~end, "chr1", -100, 500, "chr1", 100, 1e9, "chr1", 500, 1000 ) genome <- read_genome(valr_example('hg19.chrom.sizes.gz')) # out-of-bounds are removed by default ... bound_intervals(x, genome)#> # A tibble: 1 x 3 #> chrom start end #> <chr> <dbl> <dbl> #> 1 chr1 500 1000# ... or can be trimmed within the bounds of a genome bound_intervals(x, genome, trim = TRUE)#> # A tibble: 3 x 3 #> chrom start end #> <chr> <dbl> <dbl> #> 1 chr1 0 500 #> 2 chr1 100 249250621 #> 3 chr1 500 1000