bedtools_shift {HelloRanges} | R Documentation

## bedtools_shift

### Description

Compute shifting regions.

### Usage

    bedtools_shift(cmd = "--help")
    R_bedtools_shift(i, s = 0, m = 0, p = 0, pct = FALSE, g = NULL, header = FALSE)
    do_bedtools_shift(i, s = 0, m = 0, p = 0, pct = FALSE, g = NULL, header = FALSE)

### Arguments

`cmd` | String of bedtools command line arguments, as they would be entered at the shell. There are a few incompatibilities between the docopt parser and the bedtools style. See argument parsing.
`i` | Path to a BAM/BED/GFF/VCF/etc file, a BED stream, a file object, or a ranged data structure, such as a GRanges. Use `"stdin"` for input from another process (presumably while running via `Rscript`). For streaming from a subprocess, prefix the command string with “<”, e.g., `"<grep foo file.bed"`. Any streamed data is assumed to be in BED format.
`s` | Amount to shift all features.
`m` | Amount to shift negative strand features.
`p` | Amount to shift positive strand features.
`pct` | Define `l` and `r` as a fraction of the feature length. E.g. if used on a 1000bp feature, and `l` is 0.50, will shift 500 bp upstream..
`g` | Genome file, identifier or Seqinfo object that defines the order and size of the sequences.
`header` | Ignored.

### Details

As with all commands, there are three interfaces to the `shift` command:

`bedtools_shift`

  Parses the bedtools command line and compiles it to the equivalent R code.

`R_bedtools_shift`

  Accepts R arguments corresponding to the command line arguments and compiles the equivalent R code.

`do_bedtools_shift`

  Evaluates the result of `R_bedtools_shift`. Recommended only for demonstration and testing. It is best to integrate the compiled code into an R script, after studying it.

This is a fairly straight-forward application of `shift`.

### Value

A language object containing the compiled R code, evaluating to a GRanges, or similar, object. In principle, this is an endomorphism.

### Author(s)

Michael Lawrence

### References

http://bedtools.readthedocs.io/en/latest/content/tools/shift.html

### See Also

intra-range-methods for `shift`.

### Examples

    ## Not run:
    setwd(system.file("unitTests", "data", "shift", package="HelloRanges"))

    ## End(Not run)
    ## shift all ranges by 5
    bedtools_shift("-i a.bed -s 5 -g tiny.genome")
    ## shift only the negative strand features by 5
    bedtools_shift("-i a.bed -p 0 -m 5 -g tiny.genome")

[Package HelloRanges version 1.6.0 Index]