shuffle_bed | R Documentation |
This function randomly permutes genomic locations among a genome defined in a genome file. Note: the permutation stays in the same chromosome. Cross-chromosome shuffle is not supported at this point.
shuffle_bed(x, genome = NULL, excluded_region = NULL, sort = TRUE, seed = NULL)
x |
A |
genome |
Specify the reference genome for the BED file. |
excluded_region |
A |
sort |
Logical value indicating whether to sort the shuffled features.
When the input data set is large, sorting can be very expensive. If you
don't need the output to be sorted, set |
seed |
An integer seed for the random number generator. If |
A GRanges
containing shuffled features.
Manual page of bedtools shuffle
:
https://bedtools.readthedocs.io/en/latest/content/tools/shuffle.html
# Load BED tables tbl <- read_bed(system.file("extdata", "example_merge.bed", package = "bedtorch"), use_gr = FALSE, genome = "hs37-1kg") excluded <- read_bed(system.file("extdata", "example_intersect_y.bed", package = "bedtorch"), use_gr = FALSE) # Basic usage result <- shuffle_bed(tbl) head(result) # Shuffle the data, but exclude certain regions. Plus, set the RNG seed to 1 result <- shuffle_bed(tbl, genome = "hs37-1kg", excluded_region = excluded, seed = 1) head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.