Shuffle input intervals.

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

Arguments

x

tbl_interval()

genome

tbl_genome()

incl

tbl_interval() of included intervals

excl

tbl_interval() of excluded intervals

max_tries

maximum tries to identify a bounded interval

within

shuffle within chromosomes

seed

seed for reproducible intervals

Value

tbl_interval()

See also

Examples

genome <- trbl_genome( ~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 1464151 1465151 #> 2 chr2 620107 621107 #> 3 chr2 1770262 1771262 #> 4 chr2 203999 204999 #> 5 chr3 2120852 2121852 #> 6 chr2 1216940 1217940 #> 7 chr3 2111110 2112110 #> 8 chr2 213521 214521 #> 9 chr1 154190 155190 #> 10 chr3 2202799 2203799 #> # ... with 999,990 more rows