coverage-methods(GenomicRanges)
coverage-methods()所属R语言包:GenomicRanges
GRanges, GRangesList and GappedAlignments coverage
农庄,GRangesList和GappedAlignments覆盖
译者:生物统计家园网 机器人LoveR
描述----------Description----------
coverage methods for GRanges, GRangesList and GappedAlignments objects.
coverage方法农庄,GRangesList和GappedAlignments对象。
用法----------Usage----------
## S4 method for signature 'GenomicRanges'
coverage(x, shift=0L, width=NULL, weight=1L, ...)
参数----------Arguments----------
参数:x
A GRanges, GRangesList or GappedAlignments object.
一个农庄,GRangesList或GappedAlignments的对象。
参数:shift, width, weight, ...
See coverage in the IRanges package for a description of these optional arguments.
看到coverage IRanges包在这些可选参数的描述。
Details
详情----------Details----------
Here is how optional arguments shift, width and weight are handled when x is a GRanges object:
这是可选参数shift,width和weight处理x是一个农庄的对象:
shift, weight: can be either a numeric vector (integers) or a list. If a list, then it should be named by the sequence levels in x (i.e. by the names of the underlying sequences), and its elements are passed into the coverage method for IRanges objects. If a numeric vector, then it is first recycled to the length of x, then turned into a list with split(shift, as.factor(seqnames(x))), and finally the elements of this list are passed into the coverage method for IRanges objects.
shift,weight:可以是一个数值向量(整数)或列表。如果一个列表,那么它应该被命名序列水平x(即底层序列的名称),并通过其元素的coverage的IRanges对象方法。如果一个数值向量,那么它首先被回收到的x长度,然后变成一个split(shift, as.factor(seqnames(x)))列表,此列表中的元素,终于传递到coverage方法IRanges对象。
width: can be either NULL or a numeric vector. If a numeric vector, then it should be named by the sequence levels in x. If NULL (the default), then it is replaced with seqlengths(x). Like for shift and weight, its elements are passed into the coverage method for IRanges objects (if the element is NA then NULL is passed instead).
width:可以是NULL或数字向量。如果一个数值向量,那么它应该被命名为x序列水平。如果NULL(默认),然后它取代seqlengths(x)。喜欢shift和weight,通过其元素的coverage的IRanges对象方法(如果该元素是NA然后NULL传递,而不是)。
When x is a GRangesList object, coverage(x, ...) is equivalent to coverage(unlist(x), ...).
当x是GRangesList的对象,coverage(x, ...)coverage(unlist(x), ...)的。
When x is a GappedAlignments object, coverage(x, ...) is equivalent to coverage(as(x, "GRangesList"), ...).
当x是一个GappedAlignments对象,coverage(x, ...)是coverage(as(x, "GRangesList"), ...)。
值----------Value----------
Returns a named RleList object with one element ('integer' Rle) per underlying sequence in x representing how many times each position in the sequence is covered by the intervals in x.
返回底层序列一个名为RleList对象与每一个元素(“整数”RLE)x代表序列中的位置多少次,每次间隔覆盖在x。
作者(S)----------Author(s)----------
P. Aboyoun and H. Pages
参见----------See Also----------
coverage, RleList-class, GRanges-class, GRangesList-class, GappedAlignments-class
coverage,RleList级,农庄类,GRangesList级,GappedAlignments级
举例----------Examples----------
## 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 GRangesList object:[#覆盖一个GRangesList对象:]
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))))
## Coverage of a GappedAlignments object:[#覆盖一个GappedAlignments对象:]
library(Rsamtools) # because file ex1.bam is in this package[因为文件ex1.bam是在这个包]
galn_file <- system.file("extdata", "ex1.bam", package="Rsamtools")
galn <- readGappedAlignments(galn_file)
stopifnot(identical(coverage(galn), coverage(as(galn, "GRangesList"))))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|