bed_random: Generate randomly placed intervals on a genome.

Description Usage Arguments Details Value See Also Examples

View source: R/bed_random.r

Description

Generate randomly placed intervals on a genome.

Usage

1
bed_random(genome, length = 1000, n = 1e+06, seed = 0, sorted = TRUE)

Arguments

genome

genome_df

length

length of intervals

n

number of intervals to generate

seed

seed RNG for reproducible intervals

sorted

return sorted output

Details

Sorting can be suppressed with sorted = FALSE.

Value

ivl_df

See Also

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

Other randomizing operations: bed_shuffle()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
genome <- tibble::tribble(
  ~chrom,  ~size,
  "chr1",  10000000,
  "chr2",  50000000,
  "chr3",  60000000,
  "chrX",  5000000
)

bed_random(genome, seed = 10104)

# sorting can be suppressed
bed_random(genome, sorted = FALSE, seed = 10104)

# 500 random intervals of length 500
bed_random(genome, length = 500, n = 500, seed = 10104)

valr documentation built on Dec. 11, 2021, 9:57 a.m.