找回密码
 注册
查看: 845|回复: 0

R语言 GenomicRanges包 findOverlaps-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 19:28:48 | 显示全部楼层 |阅读模式
findOverlaps-methods(GenomicRanges)
findOverlaps-methods()所属R语言包:GenomicRanges

                                        GRanges, GRangesList and GappedAlignments Interval Overlaps
                                         农庄,GRangesList和GappedAlignments区间重叠

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Finds interval overlaps between a GRanges, GRangesList or GappedAlignments object and another object containing ranges.
发现间隔之间农庄,GRangesList或GappedAlignments的对象和另一个对象,其中包含范围重叠。


用法----------Usage----------


## S4 method for signature 'GenomicRanges,GenomicRanges'
findOverlaps(query, subject,
    maxgap = 0L, minoverlap = 1L,
    type = c("any", "start", "end", "within", "equal"),
    select = c("all", "first"), ignore.strand = FALSE)
## S4 method for signature 'GenomicRanges,GenomicRanges'
countOverlaps(query, subject,
    maxgap = 0L, minoverlap = 1L,
    type = c("any", "start", "end", "within", "equal"),
    ignore.strand = FALSE)
## S4 method for signature 'GenomicRanges,GenomicRanges'
subsetByOverlaps(query, subject,
    maxgap = 0L, minoverlap = 1L,
    type = c("any", "start", "end", "within", "equal"),
    ignore.strand = FALSE)
## S4 method for signature 'GenomicRanges,GenomicRanges'
match(x, table,
    nomatch = NA_integer_, incomparables = NULL)
# Also:  x %in% table



参数----------Arguments----------

参数:query, subject, x, table
A GRanges, GRangesList or GappedAlignments object. RangesList and RangedData are also accepted for one of query or subject (x or table for match).  
一个农庄,GRangesList或GappedAlignments的对象。 RangesList和RangedData也接受query或subject(x或tablematch)。


参数:maxgap, minoverlap, type, select
See findOverlaps in the IRanges package for a description of these arguments.  
看到findOverlaps IRanges包在这些参数的描述。


参数:ignore.strand
When set to TRUE, the strand information is ignored in the overlap calculations.  
当设置为TRUE,钢绞线信息被忽略的重叠计算。


参数:nomatch
The integer value to be returned in the case when no match is found.  
在没有找到匹配的情况时,要返回整型值。


参数:incomparables
This value is ignored.  
这个值将被忽略。


Details

详情----------Details----------

When the query and the subject are GRanges or GRangesList objects, findOverlaps uses the triplet (sequence name, range, strand) to determine which features (see paragraph below for the definition of feature) from the query overlap which features in the subject, where a strand value of "*" is treated as occurring on both the "+" and "-" strand. An overlap is recorded when a feature in the query and a feature in the subject have the same sequence name, have a compatible pairing of strands (e.g. "+"/"+", "-"/"-", "*"/"+", "*"/"-", etc.), and satisfy the interval overlap requirements. Strand is taken as "*" for RangedData and RangesList.
当查询和主题是农庄或GRangesList对象,findOverlaps使用三重(序列的名称,范围,股),以确定哪些功能(见以下段为特征的定义)query重叠其特点subject,其中一链价值"*""+"和"-"链上发生的治疗。记录重叠时在query在subject有相同的序列的名字,有一个兼容的股配对(如"+"/"+",功能的功能"-"/"-","*"/"+","*"/"-"等),和满足的间隔重叠的要求。作为"*"RangedData和RangesList链。

In the context of findOverlaps, a feature is a collection of ranges that are treated as a single entity. For GRanges objects, a feature is a single range; while for GRangesList objects, a feature is a list element containing a set of ranges. In the results, the features are referred to by number, which run from 1 to length(query)/length(subject).
,在findOverlaps方面的功能,是一家集作为一个单一实体处理的范围。对于农庄对象,一个特征是一个单一的范围内;而GRangesList对象,特点是列表中的元素包含了一套不等。在结果中,功能被称为数量,从1到length(query)/length(subject)运行。

When the query or the subject (or both) is a GappedAlignments object, it is first turned into a GRangesList object (with as( , "GRangesList")) and then the rules described previously apply.
当查询或主体(或两者)是一个GappedAlignments对象,这是第一次打开成GRangesList对象(as( , "GRangesList")),然后描述的规则先前申请。


值----------Value----------

For findOverlaps either a RangesMatching object when select = "all" or an integer vector when select = "first".
findOverlaps无论是RangesMatching对象时select = "all"时select = "first"整数向量。

For countOverlaps an integer vector containing the tabulated query overlap hits.
countOverlaps整数向量包含的表的查询重叠命中。

For subsetByOverlaps an object of the same class as query containing the subset that overlapped at least one entity in subject.
subsetByOverlaps同一类的对象query包含重叠的子集,至少有一个实体在subject。

For match same as findOverlaps when select = "first".
matchfindOverlaps时select = "first"的。

For %in% the logical vector produced by !is.na(match(x, table)).
%in%逻辑向量生产!is.na(match(x, table))。

For RangedData and RangesList, with the exception of subsetByOverlaps, the results align to the unlisted form of the object. This turns out to be fairly convenient for RangedData (not so much for RangesList, but something has to give).
RangedData和RangesList,与subsetByOverlaps例外,结果对齐对象的非上市形式。这原来是RangedData还算方便(不RangesList很多事,但有提供)。


作者(S)----------Author(s)----------


P. Aboyoun, S. Falcon, M. Lawrence, N. Gopalakrishnan and H. Pages



参见----------See Also----------

findOverlaps, RangesMatching-class, GRanges-class, GRangesList-class, GappedAlignments-class
findOverlaps,RangesMatching级,农庄类,GRangesList级,GappedAlignments级


举例----------Examples----------


## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## WITH GRanges AND/OR GRangesList OBJECTS[#农庄及/对象或GRangesList对象]
## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]

## GRanges object:[#农庄对象:]
gr <-
  GRanges(seqnames =
          Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
          ranges =
          IRanges(1:10, width = 10:1, names = head(letters,10)),
          strand =
          Rle(strand(c("-", "+", "*", "+", "-")),
              c(1, 2, 2, 3, 2)),
          score = 1:10,
          GC = seq(1, 0, length=10))
gr

## GRangesList object:[#GRangesList对象:]
gr1 <-
  GRanges(seqnames = "chr2", ranges = IRanges(3, 6),
          strand = "+", score = 5L, GC = 0.45)
gr2 <-
  GRanges(seqnames = c("chr1", "chr1"),
          ranges = IRanges(c(7,13), width = 3),
          strand = c("+", "-"), score = 3:4, GC = c(0.3, 0.5))
gr3 <-
  GRanges(seqnames = c("chr1", "chr2"),
          ranges = IRanges(c(1, 4), c(3, 9)),
          strand = c("-", "-"), score = c(6L, 2L), GC = c(0.4, 0.1))
grlist <- GRangesList("gr1" = gr1, "gr2" = gr2, "gr3" = gr3)

## Overlapping two GRanges objects:[#重叠的两个农庄对象的:]
table(gr %in% gr1)
countOverlaps(gr, gr1)
findOverlaps(gr, gr1)
subsetByOverlaps(gr, gr1)

countOverlaps(gr, gr1, type = "start")
findOverlaps(gr, gr1, type = "start")
subsetByOverlaps(gr, gr1, type = "start")

findOverlaps(gr, gr1, select = "first")

findOverlaps(gr1, gr)
findOverlaps(gr1, gr, type = "start")
findOverlaps(gr1, gr, type = "within")
findOverlaps(gr1, gr, type = "equal")

## Overlapping a GRanges and a GRangesList object:[#压在一个格朗和GRangesList对象的:]
table(grlist %in% gr)
countOverlaps(grlist, gr)
findOverlaps(grlist, gr)
subsetByOverlaps(grlist, gr)
countOverlaps(grlist, gr, type = "start")
findOverlaps(grlist, gr, type = "start")
subsetByOverlaps(grlist, gr, type = "start")
findOverlaps(grlist, gr, select = "first")

## Overlapping two GRangesList objects:[#重叠两个GRangesList对象:]
countOverlaps(grlist, rev(grlist))
findOverlaps(grlist, rev(grlist))
subsetByOverlaps(grlist, rev(grlist))

## ---------------------------------------------------------------------[#------------------------------------------------- --------------------]
## WITH 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)

subject <- granges(galn)[1]

## Note the absence of query no. 9 (i.e. 'galn[9]') in this result:[#请注意查询没有的情况下。 9(即“半乳糖胺[9]”)这样的结果:]
as.matrix(findOverlaps(galn, subject))

## This is because, by default, findOverlaps()/countOverlaps() are[#这是因为,默认情况下,findOverlaps()/ countOverlaps()]
## strand specific:[#链具体:]
galn[8:10]
countOverlaps(galn[8:10], subject)
countOverlaps(galn[8:10], subject, ignore.strand=TRUE)

## Advanced examples:[#高级的例子:]
subsetByOverlaps(galn, subject)
table(match(galn, subject), useNA = "ifany")
table(galn %in% subject)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-7 13:22 , Processed in 0.027763 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表