bedtools_shift: bedtools_shift

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/shift.R

Description

Compute shifting regions.

Usage

1
2
3
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

1
2
3
4
5
6
7
8
## 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")

HelloRanges documentation built on Nov. 8, 2020, 7:05 p.m.