| slop_bed | R Documentation |
Similar to bedtools slop, this function increases the size of each feature
in a feature file by a user-defined number of bases. Will restrict the
resizing to the size of the chromosome.
slop_bed(
x,
genome = NULL,
slop = 1L,
slop_type = c("bp", "frac"),
mode = c("both", "left", "right")
)
x |
A |
genome |
Specify the reference genome for the BED file. |
slop |
The number of base pairs to slop, or the percentage of the
interval's width (refer to |
slop_type |
If |
mode |
If |
A slopped GRanges object.
Manual page of bedtools slop: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html
# Load data
tbl <- read_bed(system.file("extdata", "example_merge.bed", package = "bedtorch"),
use_gr = FALSE, genome = "hs37-1kg")
# Slop by 10 on both ends
result <- slop_bed(tbl, slop = 10L, slop_type = "bp", mode = "both")
# Slop by 10 only on the right end
result <- slop_bed(tbl, slop = 10L, slop_type = "bp", mode = "right")
head(result)
# Slop by 20% on the left end
result <- slop_bed(tbl, slop = 0.2, slop_type = "frac", mode = "left")
head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.