make_random_bed | R Documentation |
This function is aware of chromosome size differences and intervals are randomly generated in proportion to chromosome sizes. In another word, larger chromosomes will have more randomly generated intervals.
make_random_bed( n, interval_width, genome, chrom = NULL, seed = NULL, sort = TRUE )
n |
Number of intervals to generate. |
interval_width |
An integer value of the width of the interval. |
genome |
Specify the reference genome for the BED file. |
chrom |
A character vector. If provided, only generate random intervals for the specified chromosome(s). |
seed |
An integer seed for the random number generator. If |
sort |
Logical value. Should the random BED data be sorted? |
A GRanges
of generated intervals.
Manual page for bedtools random
:
https://bedtools.readthedocs.io/en/latest/content/tools/random.html
# Generate 100 500kbp-intervals for chr20 and chr22, GRCh38 result <- make_random_bed(100, 500e3L, genome = "GRCh38", chrom = c("20", "22")) head(result) # Generate 100 500bp unsorted intervals for all chromosomes of GRCh37 (default reference genome) result <- make_random_bed(100, interval_width = 500, genome = "GRCh37", sort = FALSE) head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.