bedtools_coverage | R Documentation |
Compute the coverage of one or more datasets over a set of query ranges.
bedtools_coverage(cmd = "--help")
R_bedtools_coverage(a, b, hist = FALSE, d = FALSE, counts = FALSE,
f = 1e-09, F = 1e-09, r = FALSE, e = FALSE,
s = FALSE, S = FALSE, split = FALSE, g = NA_character_,
header = FALSE, sortout = FALSE)
do_bedtools_coverage(a, b, hist = FALSE, d = FALSE, counts = FALSE,
f = 1e-09, F = 1e-09, r = FALSE, e = FALSE,
s = FALSE, S = FALSE, split = FALSE, g = NA_character_,
header = FALSE, sortout = FALSE)
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. |
a |
Path to a BAM/BED/GFF/VCF/etc file, a BED stream, a file object, or
a ranged data structure, such as a GRanges. The coverage is computed
over these ranges. Use |
b |
Like |
hist |
Report a histogram of coverage for each feature in |
d |
Report the depth at each position in each |
counts |
Only report the count of overlaps, not fraction, etc.
Restricted by |
f |
Minimum overlap required as a fraction of A [default: any overlap]. |
F |
Minimum overlap required as a fraction of B [default: any overlap]. |
r |
Require that the fraction of overlap be reciprocal for |
e |
Require that the minimum fraction be satisfied for |
s |
Force strandedness. That is, only count ranges in |
S |
Require opposite strandedness. That is, count the features in
|
split |
Treat split BAM (i.e., having an ‘N’ CIGAR operation) or BED12 entries as compound ranges with gaps, i.e., as GRangesList objects. |
g |
A genome file, identifier or Seqinfo object that defines the order and size of the sequences. |
header |
Ignored. |
sortout |
Sort the result by position. |
As with all commands, there are three interfaces to the
coverage
command:
bedtools_coverage
Parses the bedtools command line and compiles it to the equivalent R code.
R_bedtools_coverage
Accepts R arguments corresponding to the command line arguments and compiles the equivalent R code.
do_bedtools_coverage
Evaluates the result of
R_bedtools_coverage
. Recommended only for
demonstration and testing. It is best to integrate the compiled
code into an R script, after studying it.
Typically, we compute coverage with
coverage
, but features like fractional
overlap restriction and histograms add (educational) complexity. One
key trick is the [,List,GenomicRanges
method, which lets us
extract coverage vectors for specific regions (see the generated
code).
A language object containing the compiled R code, evaluating to a GRanges object with coverage information. The exact type of information depends on the mode:
default |
Three metadata columns: “count” (the number of overlapping ranges), “covered” (the number of bases covered in the query), “fraction” (the fraction of bases covered). |
d |
Metadata column “coverage” is an RleList with position-level coverage (depth). This is what we typically refer to as coverage in Bioconductor. |
hist |
Metadata column “coverage” is a list of DataFrames. Each
DataFrame contains a histogram of the coverage depth over that
range, with columns “coverage” (the coverage value),
“count” (the number of positions with that coverage),
“len” (the length of the region, all the same) and
“fraction” (the fraction of positions at that coverage).
There is also a “coverage” component on |
Michael Lawrence
http://bedtools.readthedocs.io/en/latest/content/tools/coverage.html
coverage-methods for ways to compute coverage.
## Not run:
setwd(system.file("unitTests", "data", "coverage", package="HelloRanges"))
## End(Not run)
## default behavior
bedtools_coverage("-a a.bed -b b.bed")
## histogram
bedtools_coverage("-a a.bed -b b.bed -hist -g test.genome")
## per-position depth
bedtools_coverage("-a a.bed -b b.bed -d -g test.genome")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.