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
2
bed_random(genome, length = 1000, n = 1e+06, sort_by = c("chrom",
  "start"), seed = 0)

Arguments

genome

tbl_genome()

length

length of intervals

n

number of intervals to generate

sort_by

sorting variables

seed

seed RNG for reproducible intervals

Details

Sorting can be suppressed with sort_by = NULL.

Value

tbl_interval()

See Also

http://bedtools.readthedocs.org/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 <- trbl_genome(
  ~chrom,  ~size,
  "chr1",  10000000,
  "chr2",  50000000,
  "chr3",  60000000,
  "chrX",  5000000
)

bed_random(genome, seed = 10104)

# sorting can be suppressed
bed_random(genome, sort_by = NULL, seed = 10104)

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

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