| bed_shift | R Documentation | 
Out-of-bounds intervals are removed by default.
bed_shift(x, genome, size = 0, fraction = 0, trim = FALSE)
| x | ivl_df | 
| genome | ivl_df | 
| size | number of bases to shift. positive numbers shift right, negative shift left. | 
| fraction | define  | 
| trim | adjust coordinates for out-of-bounds intervals | 
ivl_df
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()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.