Shuffle input intervals.

bed_shuffle(
  x,
  genome,
  incl = NULL,
  excl = NULL,
  max_tries = 1000,
  within = FALSE,
  seed = 0
)

Arguments

x

ivl_df

genome

genome_df

incl

ivl_df of included intervals

excl

ivl_df of excluded intervals

max_tries

maximum tries to identify a bounded interval

within

shuffle within chromosomes

seed

seed for reproducible intervals

Value

ivl_df

See also

Examples

genome <- tibble::tribble( ~chrom, ~size, "chr1", 1e6, "chr2", 2e6, "chr3", 4e6 ) x <- bed_random(genome, seed = 1010486) bed_shuffle(x, genome, seed = 9830491)
#> # A tibble: 1,000,000 x 3 #> chrom start end #> <chr> <int> <int> #> 1 chr2 1998650 1999650 #> 2 chr2 1775530 1776530 #> 3 chr2 715183 716183 #> 4 chr2 1778306 1779306 #> 5 chr3 2361751 2362751 #> 6 chr2 1817964 1818964 #> 7 chr3 297003 298003 #> 8 chr2 1250858 1251858 #> 9 chr1 443626 444626 #> 10 chr3 2210925 2211925 #> # … with 999,990 more rows