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

R语言 IRanges包 IRanges-setops()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 22:28:33 | 显示全部楼层 |阅读模式
IRanges-setops(IRanges)
IRanges-setops()所属R语言包:IRanges

                                        Set operations on IRanges objects
                                         设置IRanges对象上的操作

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

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

Performs set operations on IRanges objects.
执行设置IRanges对象上的操作。


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


## Vector-wise operations:
gaps(x, start=NA, end=NA)
## S4 method for signature 'IRanges,IRanges'
union(x, y,...)
## S4 method for signature 'IRanges,IRanges'
intersect(x, y,...)
## S4 method for signature 'IRanges,IRanges'
setdiff(x, y,...)

## Element-wise (aka "parallel") operations:
## S4 method for signature 'IRanges,IRanges'
punion(x, y, fill.gap=FALSE, ...)
## S4 method for signature 'IRanges,IRanges'
pintersect(x, y, resolve.empty=c("none", "max.start", "start.x"), ...)
## S4 method for signature 'IRanges,IRanges'
psetdiff(x, y, ...)
## S4 method for signature 'IRanges,IRanges'
pgap(x, y, ...)



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

参数:x, y
IRanges objects.  
IRanges对象。


参数:start, end
A single integer or NA. Use these arguments to specify the interval of reference i.e. which interval the returned gaps should be relative to.  
一个整数或NA。使用这些参数来指定间隔的参考,即该区间返回的差距应该是相对的。


参数:fill.gap
Logical indicating whether or not to force a union by using the rule start = min(start(x), start(y)), end = max(end(x), end(y)).  
逻辑表示是否强制使用规则start = min(start(x), start(y)), end = max(end(x), end(y))工会。


参数:resolve.empty
One of "none", "max.start", or "start.x" denoting how to handle ambiguous empty ranges formed by intersections. "none" - throw an error if an ambiguous empty range is formed, "max.start" - associate the maximum start value with any ambiguous empty range, and "start.x" - associate the start value of x with any ambiguous empty range. (See Details section below for the definition of an ambiguous range.)  
一"none","max.start"或"start.x"表示如何处理模棱两可的路口形成的空范围。 "none" - 抛出一个错误,如果形成一个模糊的范围为空"max.start" - 关联的任何含糊不清的空范围最大的起始值,"start.x" - x关联起始值任何含糊不清的空范围。 (见详情下一节的暧昧范围的定义。)


参数:...
Further arguments to be passed to or from other methods.  
进一步的参数被传递或其他方法。


Details

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

gaps returns the "normal" IRanges object (of the same class as x) representing the set of integers that remain after the set of integers represented by x has been removed from the interval specified by the start and end arguments.
gaps返回“正常”IRanges对象(同一类的x)代表整数的一套x代表整数后仍然已经从区间中删除start和end参数指定。

The union, intersect and setdiff methods for IRanges objects return a "normal" IRanges object (of the same class as x) representing the union, intersection and (asymmetric!) difference of the sets of integers represented by x and y.
union,intersect和setdiffIRanges对象的方法返回一个“正常”IRanges的对象(同一类x)代表工会,路口(非对称!)代表x和y的整数套的差异。

punion, pintersect, psetdiff and pgap are generic functions that compute the element-wise (aka "parallel") union, intersection, (asymmetric!) difference and gap between each element in x and its corresponding element in y. Methods for IRanges objects are defined. For these methods, x and y must have the same length (i.e. same number of ranges) and they return an IRanges instance of the same length as x and y where each range represents the union/intersection/difference/gap of/between the corresponding ranges in x and y.
punion,pintersect,psetdiff和pgap计算元素(又名“水货”)联盟,交叉路口,(asymmetric!)的差异和差距的通用功能彼此之间在x元素及其对应的元素在y。 IRanges对象的方法定义。对于这些方法,x和y必须有相同的长度(即相同数量不等),返回x和y那里的长度相同的IRanges实例每个范围代表之间x和y相应范围的联盟/ / /交集/差差距。

By default, pintersect will throw an error when an "ambiguous empty range" is formed. An ambiguous empty range can occur three different ways:  1) when corresponding non-empty ranges elements x and y have an empty intersection, 2) if the position of an empty range element does not fall within the corresponding limits of a non-empty range element, or 3) if two corresponding empty range elements do not have the same position. For example if empty range element [22,21] is intersected with non-empty range element [1,10], an error will be produced; but if it is intersected with the range [22,28], it will produce [22,21]. As mentioned in the Arguments section above, this behavior can be changed using the resolve.empty argument.
默认情况下,pintersect将抛出一个“暧昧空范围”形成的错误。一个含糊不清的空范围,可能会出现三种不同的方式:1)时,相应的非空范围的元素x和y有一个空的路口,2)如果一个空范围元素的位置不属于一个非空的范围元素的相应的限制,或3)如果两个相应的空范围内的元素不具有相同的地位。例如,如果范围为空元素[22,21]相交的范围非空元素[1,10],错误将产生;但如果它与范围[22,28]相交,它会产生[22 21]。正如上面的参数节中提到的,这种行为是可以改变的,使用resolve.empty参数。


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


H. Pages and M. Lawrence



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

pintersect is similar to narrow, except the end points are absolute, not relative. pintersect is also similar to restrict, except ranges outside of the restriction become empty and are not discarded.
pintersect是narrow类似,除了终点是绝对的,不是相对的。 pintersect也是类似restrict,除了范围以外的限制,成为空的,不会被丢弃。

union, intersect, setdiff, Ranges-class, Ranges-utils, IRanges-class, IRanges-utils
UNION,INTERSECT setdiff,范围级,范围-utils的,级IRanges,IRanges-utils的


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


  x0 <- IRanges(start=c(-2, 6, 9, -4, 1, 0, -6, 10),
                width=c( 5, 0, 6,  1, 4, 3,  2,  3))
  gaps(x0)
  gaps(x0, start=-6, end=20)  # Regions of the -6:20 range that are not masked by 'x0'.[“X0”,不掩盖-6:20范围的区域。]

  x <- IRanges(c(1, 5, -2, 0, 14), c(10, 9, 3, 11, 17))
  y <- Views(as(4:-17, "XInteger"), start=c(14, 0, -5, 6, 18), end=c(20, 2, 2, 8, 20))

  ## Vector-wise operations:[#明智的媒介操作:]
  union(x, ranges(y))
  union(ranges(y), x)

  intersect(x, ranges(y))
  intersect(ranges(y), x)

  setdiff(x, ranges(y))
  setdiff(ranges(y), x)

  ## Element-wise (aka "parallel") operations:[#元素(又名“水货”)操作:]
  try(punion(x, ranges(y)))
  punion(x[3:5], ranges(y)[3:5])
  punion(x, ranges(y), fill.gap=TRUE)
  try(pintersect(x, ranges(y)))
  pintersect(x[3:4], ranges(y)[3:4])
  pintersect(x, ranges(y), resolve.empty="max.start")
  psetdiff(ranges(y), x)
  try(psetdiff(x, ranges(y)))
  start(x)[4] <- -99
  end(y)[4] <- 99
  psetdiff(x, ranges(y))
  pgap(x, ranges(y))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 13:50 , Processed in 0.022033 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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