bed_shift {valr} | R Documentation |
Adjust intervals by a fixed size.
Description
Out-of-bounds intervals are removed by default.
Usage
bed_shift(x, genome, size = 0, fraction = 0, trim = FALSE)
Arguments
x |
|
genome |
|
size |
number of bases to shift. positive numbers shift right, negative shift left. |
fraction |
define |
trim |
adjust coordinates for out-of-bounds intervals |
Value
See Also
https://bedtools.readthedocs.io/en/latest/content/tools/shift.html
Other single set operations:
bed_cluster()
,
bed_complement()
,
bed_flank()
,
bed_genomecov()
,
bed_merge()
,
bed_partition()
,
bed_slop()
Examples
x <- tibble::tribble(
~chrom, ~start, ~end,
"chr1", 25, 50,
"chr1", 100, 125
)
genome <- tibble::tribble(
~chrom, ~size,
"chr1", 125
)
bed_glyph(bed_shift(x, genome, size = -20))
x <- tibble::tribble(
~chrom, ~start, ~end, ~strand,
"chr1", 100, 150, "+",
"chr1", 200, 250, "+",
"chr2", 300, 350, "+",
"chr2", 400, 450, "-",
"chr3", 500, 550, "-",
"chr3", 600, 650, "-"
)
genome <- tibble::tribble(
~chrom, ~size,
"chr1", 1000,
"chr2", 2000,
"chr3", 3000
)
bed_shift(x, genome, 100)
bed_shift(x, genome, fraction = 0.5)
# shift with respect to strand
stranded <- dplyr::group_by(x, strand)
bed_shift(stranded, genome, 100)
[Package valr version 0.8.1 Index]