Description Usage Arguments Details Value Author(s) See Also Examples
coverage
methods for GRanges and
GRangesList objects.
NOTE: The coverage
generic function and methods
for IntegerRanges and IntegerRangesList
objects are defined and documented in the IRanges package.
Methods for GAlignments and
GAlignmentPairs objects are defined and
documented in the GenomicAlignments package.
1 2 3 4 5 6 7 |
x |
A GenomicRanges or GRangesList object. |
shift, weight |
A numeric vector or a list-like object. If numeric, it must be parallel
to Alternatively, each of these arguments can also be specified as a
single string naming a metadata column in See Note that when |
width |
Either See |
method |
See |
When x
is a GRangesList object, coverage(x, ...)
is equivalent to coverage(unlist(x), ...)
.
A named RleList object with one coverage vector per
seqlevel in x
.
H. Pag<c3><a8>s and P. Aboyoun
coverage
in the IRanges package.
coverage-methods in the GenomicAlignments package.
RleList objects in the IRanges package.
GRanges, GPos, and GRangesList objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Coverage of a GRanges object:
gr <- GRanges(
seqnames=Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
ranges=IRanges(1:10, end=10),
strand=Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
seqlengths=c(chr1=11, chr2=12, chr3=13))
cvg <- coverage(gr)
pcvg <- coverage(gr[strand(gr) == "+"])
mcvg <- coverage(gr[strand(gr) == "-"])
scvg <- coverage(gr[strand(gr) == "*"])
stopifnot(identical(pcvg + mcvg + scvg, cvg))
## Coverage of a GPos object:
pos_runs <- GRanges(c("chr1", "chr1", "chr2"),
IRanges(c(1, 5, 9), c(10, 8, 15)))
gpos <- GPos(pos_runs)
coverage(gpos)
## Coverage of a GRangesList object:
gr1 <- GRanges(seqnames="chr2",
ranges=IRanges(3, 6),
strand = "+")
gr2 <- GRanges(seqnames=c("chr1", "chr1"),
ranges=IRanges(c(7,13), width=3),
strand=c("+", "-"))
gr3 <- GRanges(seqnames=c("chr1", "chr2"),
ranges=IRanges(c(1, 4), c(3, 9)),
strand=c("-", "-"))
grl <- GRangesList(gr1=gr1, gr2=gr2, gr3=gr3)
stopifnot(identical(coverage(grl), coverage(unlist(grl))))
|
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, basename, cbind, colMeans, colSums, colnames,
dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
intersect, is.unsorted, lapply, lengths, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which, which.max, which.min
Loading required package: S4Vectors
Attaching package: 'S4Vectors'
The following object is masked from 'package:base':
expand.grid
Loading required package: IRanges
Loading required package: GenomeInfoDb
RleList of length 2
$chr1
integer-Rle of length 10 with 3 runs
Lengths: 4 4 2
Values : 1 2 1
$chr2
integer-Rle of length 15 with 2 runs
Lengths: 8 7
Values : 0 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.