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

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

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

                                        IRanges utility functions
                                         IRanges实用功能

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

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

Utility functions for creating or modifying IRanges objects.
为创建或修改IRanges对象的实用功能。


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


## Create an IRanges instance:
successiveIRanges(width, gapwidth=0, from=1)
breakInChunks(totalsize, chunksize)

## Turn a logical vector into a set of ranges:
whichAsIRanges(x)

## Coercion:
asNormalIRanges(x, force=TRUE)



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

参数:width
A vector of non-negative integers (with no NAs) specifying the widths of the ranges to create.  
一个非负整数向量(无NAS)指定范围的宽度来创建。


参数:gapwidth
A single integer or an integer vector with one less element than the width vector specifying the widths of the gaps separating one range from the next one.  
少元素与一个单一的整数或整数向量比width向量指定分离一个范围从一个空白的宽度。


参数:from
A single integer specifying the starting position of the first range.  
一个整数指定的第一个范围的起始位置。


参数:totalsize
A single integer. The total size of the object to break.  
一个整数。的总规模突破的对象。


参数:chunksize
A single integer. The size of the chunks (last chunk might be smaller).  
一个整数。大小的块(可能是最后一个块较小)。


参数:x
A logical vector for whichAsIRanges. An IRanges object for asNormalIRanges.  
一个的whichAsIRanges逻辑的向量。 asNormalIRangesIRanges对象。


参数:force
TRUE or FALSE. Should x be turned into a NormalIRanges object even if isNormal(x) is FALSE?  
TRUE或FALSE。应x成NormalIRanges的转向反对,即使isNormal(x)是FALSE?


Details

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

successiveIRanges returns an IRanges instance containing the ranges that have the widths specified in the width vector and are separated by the gaps specified in gapwidth. The first range starts at position from. When gapwidth=0 and from=1 (the defaults), the returned IRanges can be seen as a partitioning of the 1:sum(width) interval. See ?Partitioning for more details on this.
successiveIRanges返回一个IRanges实例,包含的范围,有在width向量指定的宽度和分隔由gapwidth指定的空白。第一个范围的开始位置from。当gapwidth=0和from=1(默认值),返回IRanges可以作为分区1所示:金额(宽)的时间间隔。看到?Partitioning在此的更多细节。

whichAsIRanges returns an IRanges instance containing all of the ranges where x is TRUE.
whichAsIRanges返回一个包含所有范围x是TRUEIRanges实例。

If force=TRUE (the default), then asNormalIRanges will turn x into a NormalIRanges instance by reordering and reducing the set of ranges if necessary (i.e. only if isNormal(x) is FALSE, otherwise the set of ranges will be untouched). If force=FALSE, then asNormalIRanges will turn x into a NormalIRanges instance only if isNormal(x) is TRUE, otherwise it will raise an error. Note that when force=FALSE, the returned object is guaranteed to contain exactly the same set of ranges than x. as(x, "NormalIRanges") is equivalent to asNormalIRanges(x, force=TRUE).
如果force=TRUE(默认),然后asNormalIRanges会变成x如有必要将通过重新安排NormalIRanges实例和减少的范围(即只有当isNormal(x)是< x>,否则的范围将触及)。如果FALSE,则force=FALSE会变成asNormalIRanges成NormalIRanges实例只有x是isNormal(x),否则它会引发一个错误。请注意,当TRUE,保证返回的对象包含完全相同的范围比force=FALSE同一组。 x相当于as(x, "NormalIRanges")的。


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


H. Pages



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

Ranges-class, Ranges-utils, IRanges-class, IRanges-setops, solveUserSEW, successiveViews
范围-级,范围-utils的,级IRanges,IRanges-setopssolveUserSEW,successiveViews


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


  vec <- as.integer(c(19, 5, 0, 8, 5))

  successiveIRanges(vec)

  breakInChunks(600999, 50000)  # 13 chunks of size 50000 (last chunk is[13块(最后一个块大小为50000]
                                # smaller).[小)。]

  whichAsIRanges(vec >= 5)

  x <- IRanges(start=c(-2L, 6L, 9L, -4L, 1L, 0L, -6L, 10L),
               width=c( 5L, 0L, 6L,  1L, 4L, 3L,  2L,  3L))
  asNormalIRanges(x)  # 3 non-empty ranges ordered from left to right and[3个非空范围下令从左至右]
                      # separated by gaps of width &gt;= 1.[分隔宽度> = 1的差距。]

  ## More on normality:[#常态:]
  example(`IRanges-class`)
  isNormal(x16)                        # FALSE[假]
  if (interactive())
      x16 &lt;- asNormalIRanges(x16)      # Error![错误!]
  whichFirstNotNormal(x16)             # 57[57]
  isNormal(x16[1:56])                  # TRUE[真]
  xx <- asNormalIRanges(x16[1:56])
  class(xx)
  max(xx)
  min(xx)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 13:55 , Processed in 0.022374 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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