bedtools_genomecov | R Documentation |
Compute coverage over the genome. By default, this computes a per-chromosome histogram of the coverage, but options allow for per-position coverage to be returned in different ways.
bedtools_genomecov(cmd = "--help")
R_bedtools_genomecov(i, g = NA_character_, d = FALSE, dz = FALSE,
bg = FALSE, bga = FALSE, split = FALSE,
strand = c("any", "+", "-"), `5` = FALSE, `3` = FALSE,
max = NULL, scale = 1, pc = FALSE, fs = NULL)
do_bedtools_genomecov(i, g = NA_character_, d = FALSE, dz = FALSE,
bg = FALSE, bga = FALSE, split = FALSE,
strand = c("any", "+", "-"), `5` = FALSE, `3` = FALSE,
max = NULL, scale = 1, pc = FALSE, fs = NULL)
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 |
g |
Genome file, identifier or Seqinfo object that defines the order and size of the sequences. |
d |
Report the depth at each genome position. This causes a GPos object to be returned. |
dz |
Same as |
bg |
Like |
bga |
Like |
split |
Treat split BAM (i.e., having an ‘N’ CIGAR operation) or BED12 entries as compound ranges with gaps, i.e., as GRangesList objects. |
strand |
Calculate coverage of intervals from a specific strand. |
5 |
Calculate coverage of 5' positions (instead of entire interval). |
3 |
Calculate coverage of 3' positions (instead of entire interval). |
max |
Combine all positions with a depth >= |
scale |
Scale the coverage by a constant factor. Each coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM). |
pc |
Calculates coverage of intervals from left point of a pair reads to the right point. Works for BAM files only. |
fs |
Forces to use the given fragment size instead of read length. |
As with all commands, there are three interfaces to the
genomecov
command:
bedtools_genomecov
Parses the bedtools command line and compiles it to the equivalent R code.
R_bedtools_genomecov
Accepts R arguments corresponding to the command line arguments and compiles the equivalent R code.
do_bedtools_genomecov
Evaluates the result of
R_bedtools_genomecov
. Recommended only for
demonstration and testing. It is best to integrate the compiled
code into an R script, after studying it.
We typically compute the coverage with
coverage
. Computing the histogram
requires more work.
A language object containing the compiled R code, evaluating to an object that depends on the mode:
default |
A DataFrame that is a per-chromosome histogram of the coverage that includes the whole genome margin. Includes columns “seqnames” (the chromosome name, or “genome”), “coverage” (the coverage value), “count” (the count of positions covered at that value), “len” (the length of the chromosome/genome), “fraction” (the fraction of bases covered at the value). |
d, dz |
A GPos object with per-position coverage values. |
bg, bga |
A GRanges object with coverage runs. |
Michael Lawrence
http://bedtools.readthedocs.io/en/latest/content/tools/genomecov.html
intra-range-methods for genomecov
.
## Not run:
setwd(system.file("unitTests", "data", "genomecov", package="HelloRanges"))
## End(Not run)
## get coverage runs as a GRanges
bedtools_genomecov("-i y.bed -bg -g test.genome")
## get coverage depth as a GPos, dropping zero values, ignore junctions
bedtools_genomecov("-i three_blocks.bam -dz -split")
## custom fragment size
bedtools_genomecov("-i chip.bam -bg -fs 100")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.