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

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

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

                                        List of Ranges
                                         值域名单

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

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

An extension of List that holds only Ranges objects. Useful for storing ranges over a set of spaces (e.g. chromosomes), each of which requires a separate Ranges object. As a Vector, RangesList may be annotated with its universe identifier (e.g. a genome) in which all of its spaces exist.
只拥有一个名单的延伸范围对象。用于存储的空间(如染色体),这就要求每一个单独的Ranges对象范围的有用。作为一个Vector,RangesList可能是宇宙标识符(如基因组)在其所有的空间存在注释。


存取----------Accessors----------

In the code snippets below, x is a RangesList object.
在下面的代码片段,x是RangesList对象。

All of these accessors collapse over the spaces:
所有这些访问都倍数在空格:




start(x), start(x) <- value: Get or set the starts of the ranges. When setting the starts, value can be an integer vector of length(sum(elementLengths(x))) or an IntegerList object of
start(x), start(x) <- value:获取或设置范围的开始。设置在启动时,value能length(sum(elementLengths(x)))整数向量或一个IntegerList的对象




end(x), end(x) <- value: Get or set the ends of the ranges. When setting the starts, value can be an integer vector of length(sum(elementLengths(x))) or an IntegerList object of
end(x), end(x) <- value:获取或设置范围的两端。设置在启动时,value能length(sum(elementLengths(x)))整数向量或一个IntegerList的对象




width(x), width(x) <- value: Get or set the widths of the ranges. When setting the starts, value can be an integer vector of length(sum(elementLengths(x))) or an IntegerList object of
width(x), width(x) <- value:获取或设置范围的宽度。设置在启动时,value能length(sum(elementLengths(x)))整数向量或一个IntegerList的对象




space(x): Gets the spaces of the ranges as a character vector. This is equivalent to names(x), except each name is repeated according to the length of its element.
space(x):获取作为一个特征向量的范围空间。这相当于names(x),每个名称重复,除了根据其元素的长度。

These accessors are for the universe identifier:
这些访问是universe标识符:




universe(x): gets the name of the universe as a single string, if one has been specified, NULL otherwise.
universe(x):得到宇宙的名称作为一个字符串,如果已指定,NULL否则。




universe(x) <- value: sets the name of the universe to value, a single string or NULL.
universe(x) <- value:设置的宇宙value,单个字符串或NULL的名称。


构造----------Constructor----------




RangesList(..., universe = NULL): Each Ranges in ... becomes an element in the new RangesList, in the same order. This is analogous to the list constructor, except every argument in ... must be derived from Ranges. The universe is specified by the universe parameter, which should be a single string or NULL, to leave unspecified.
RangesList(..., universe = NULL):每个Ranges...元素成为新的RangesList,在相同的顺序。这是类似于list构造,除了每一个参数...必须从Ranges派生。宇宙指定universe参数,这应该是一个单一的字符串或NULL,离开不明。


子集----------Subsetting----------

In the code snippets below, x is a RangesList object.
在下面的代码片段,x是RangesList对象。

x[i]: Subset x by index i, with the same semantics as a basic Vector, except i may itself be a RangesList, in which case only the ranges in x that overlap with those in i are kept. See the findOverlaps method for more details.
x[i]:子集x通过索引i相同的语义,一个基本的Vectori,除了本身可能是一个RangesList,这种情况下,只有在x,i保持重叠范围。详情请参阅findOverlaps方法。


强迫----------Coercion----------

In the code snippets below, x and from are a RangesList object.
在下面的代码片段,x和fromRangesList对象。




as.data.frame(x, row.names = NULL, optional = FALSE): Coerces x to a data.frame. Essentially the same as calling data.frame(space=rep(names(x), elementLengths(x)),        as.data.frame(unlist(x, use.names=FALSE))).
as.data.frame(x, row.names = NULL, optional = FALSE)胁迫xdata.frame的。调用data.frame(space=rep(names(x), elementLengths(x)),        as.data.frame(unlist(x, use.names=FALSE)))基本上相同。




as(from, "RangedData"): Coerces from to a RangedData with zero columns and the same ranges as in from.
as(from, "RangedData"):胁迫fromRangedData与零列,并在from相同的范围。




as(from, "SimpleIRangesList"): Coerces from, to a SimpleIRangesList, requiring that all Ranges elements are coerced to internal IRanges elements. This is a convenient way to ensure that all Ranges have been imported into R (and that there is no unwanted overhead when accessing them).
as(from, "SimpleIRangesList"):胁迫from到SimpleIRangesList,要求被强制所有Ranges的元素内部的IRanges元素。这是一种方便的方式,以确保所有的Ranges已导入到R(和访问它们时,有没有多余的开销)。




as(from, "CompressedIRangesList"): Coerces from, to a CompressedIRangesList, requiring that all Ranges elements are coerced to internal IRanges elements. This is a convenient way to ensure that all Ranges have been imported into R (and that there is no unwanted overhead when accessing them).
as(from, "CompressedIRangesList"):胁迫from到CompressedIRangesList,要求被强制所有Ranges的元素内部的IRanges元素。这是一种方便的方式,以确保所有的Ranges已导入到R(和访问它们时,有没有多余的开销)。




as(from, "SimpleNormalIRangesList"): Coerces from, to a SimpleNormalIRangesList, requiring that all Ranges elements are coerced to internal NormalIRanges elements.
as(from, "SimpleNormalIRangesList"):胁迫from到SimpleNormalIRangesList,要求被强制所有Ranges的元素内部的NormalIRanges元素。




as(from, "CompressedNormalIRangesList"): Coerces from, to a CompressedNormalIRangesList, requiring that all Ranges elements are coerced to internal NormalIRanges elements.
as(from, "CompressedNormalIRangesList"):胁迫from到CompressedNormalIRangesList,要求被强制所有Ranges的元素内部的NormalIRanges元素。


算术运算----------Arithmetic Operations----------

Any arithmetic operation, such as x + y, x * y, etc, where x is a RangesList, is performed identically on each element. Currently, Ranges supports only the * operator, which zooms the ranges by a numeric factor.
任何算术运算,如x + y,x * y等x1 RangesList,对每个元素进行相同的。目前,Ranges支持*运营商,数字因子的范围缩小。


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


Michael Lawrence



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


  range1 <- IRanges(start=c(1,2,3), end=c(5,2,8))
  range2 <- IRanges(start=c(15,45,20,1), end=c(15,100,80,5))
  named <- RangesList(one = range1, two = range2)
  length(named) # 2[2]
  start(named) # same as start(c(range1, range2))[作为启动(C(范围1,范围2))相同]
  names(named) # "one" and "two"[“一”和“两节”]
  named[[1]] # range1[范围1]
  unnamed <- RangesList(range1, range2)
  names(unnamed) # NULL[为NULL]

  # edit the width of the ranges in the list[编辑列表中的宽度范围]
  edited <- named
  width(edited) <- rep(c(3,2), elementLengths(named))
  edited

  # subset by RangesList[由RangesList子集]
  range1 <- IRanges(start=c(1,2,3), end=c(5,2,8))
  range2 <- IRanges(start=c(1,15,20,45), end=c(5,15,100,80))
  collection <- RangesList(one = range1, range2)
  collection[RangesList()] # empty elements[空元素]
  collection[RangesList(IRanges(4, 6), IRanges(50, 70))]
  collection[RangesList(IRanges(50, 70), one=IRanges(4, 6))]

  # same as list(range1, range2)[作为列表(范围1,范围2)]
  as.list(RangesList(range1, range2))

  # coerce to data.frame[强制以数据框]
  as.data.frame(named)

  # set the universe[设置的宇宙]
  universe(named) <- "hg18"
  universe(named)
  RangesList(range1, range2, universe = "hg18")

  ## zoom in 2X[#在2X变焦]
  collection * 2

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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