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

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

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

                                        Views objects
                                         视图对象

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

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

The Views virtual class is a general container for storing a set of views on an arbitrary Vector object, called the "subject".
点击虚拟类是一个用于存储任意矢量对象的意见,所谓的“主题”一般容器。

Its primary purpose is to introduce concepts and provide some facilities that can be shared by the concrete classes that derive from it.
其主要目的是引进的概念,并提供一些可以从它派生的具体类共用设施。

Some direct subclasses of the Views class are: XIntegerViews, XDoubleViews, RleViews, XStringViews (defined in the Biostrings package), etc...
视图类的一些直接子类:的XIntegerViews,XDoubleViews,RleViews,XStringViews(定义在Biostrings包),等等......


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

Views(subject, start=NULL, end=NULL, width=NULL, names=NULL): This constructor is a generic function with dispatch on argument subject. Specific methods must be defined for the subclasses of the Views class. For example a method for XString subjects is defined in the Biostrings package that returns an XStringViews object. There is no default method.
Views(subject, start=NULL, end=NULL, width=NULL, names=NULL):此构造是一个泛型函数参数subject与调度。具体的方法必须定义的视图类的子类。例如,一个XString科目的方法是指在Biostrings包返回一个XStringViews对象。有没有默认的方法。

The treatment of the start, end and width arguments is the same as with the IRanges constructor, except that, in addition, Views allows start to be a Ranges object. With this feature, Views(subject, IRanges(my_starts, my_ends, my_widths, my_names)) and Views(subject, my_starts, my_ends, my_widths, my_names) are equivalent (except when my_starts is itself a Ranges object).
治疗start,end和width参数IRanges构造相同的,只不过,此外,Views让<X >是一个范围对象。有了这个功能,start和Views(subject, IRanges(my_starts, my_ends, my_widths, my_names))是等价的(当Views(subject, my_starts, my_ends, my_widths, my_names)本身就是一个范围对象除外)。


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

In the code snippets below, from is a Views object:
在下面的代码片段,from是一个视图对象:

as(from, "IRanges"): Creates an IRanges object containing the view locations in from.
as(from, "IRanges"):创建一个IRangesfrom对象,其中包含视图的位置。


像存取,方法----------Accessor-like methods----------

All the accessor-like methods defined for IRanges objects work on Views objects. In addition, the following accessors are defined for Views objects:
所有的存取样IRanges视图对象的工作对象中定义的方法。此外,以下的访问器被定义为视图对象:

subject(x): Return the subject of the views.
subject(x):返回意见的主题。


子集和追加----------Subsetting and appending----------

"[", c and "[[" work on a Views object. The first two operations are just inherited from the IRanges class but now they return a Views object. However, the "[[" method for Views objects has a different semantic than the method for IRanges objects.
"[",c和"[["上点击对象。前两个操作只是从IRanges类继承,但现在他们返回一个视图对象。然而,"[["视图对象的方法有不同比IRanges对象的方法的语义。

x[[i]]: Extracts the view selected by i as an object of the same class as subject(x). Subscript i can be a single integer or a character string. The result is the subsequence of subject(x) defined by window(subject(x), start=start(x)[i], end=end(x)[i]) or an error if the view is "out of limits" (i.e. start(x)[i] < 1 or end(x)[i] > length(subject(x))).
x[[i]]:i作为同一类对象为subject(x)选择提取的看法。标i可以是一个整数或字符串。结果是subject(x)window(subject(x), start=start(x)[i], end=end(x)[i])或错误定义的序列,如果认为是“限制”(即start(x)[i] < 1或end(x)[i] > length(subject(x)))。


其他方法----------Other methods----------

trim(x, use.names=TRUE): Equivalent to restrict(x, start=1L, end=length(subject(x)), keep.all.ranges=TRUE,       use.names=use.names).
trim(x, use.names=TRUE):restrict(x, start=1L, end=length(subject(x)), keep.all.ranges=TRUE,       use.names=use.names)等效。

subviews(x, start=NA, end=NA, width=NA, use.names=TRUE): start, end, and width arguments must be vectors of integers, eventually with NAs, that contain coordinates relative to the current ranges. Equivalent to trim(narrow(x, start=start, end=end, width=width, use.names=use.names)).
subviews(x, start=NA, end=NA, width=NA, use.names=TRUE):start,end,width参数必须是整数向量,最终与NAS,包含相电流范围。相当于trim(narrow(x, start=start, end=end, width=width, use.names=use.names))。

gaps(x, start=NA, end=NA): start and end can be single integers or NAs. The gap extraction will be restricted to the window specified by start and end. start=NA and end=NA are interpreted as start=1 and end=length(subject(x)), respectively, so, if start and end are not specified, then gaps are extracted with respect to the entire subject.
gaps(x, start=NA, end=NA):start和end可以是单个整数或NAS。提取的差距将被限制到start和end指定的窗口。 start=NA和end=NAstart=1和end=length(subject(x))解释为分别,因此,如果start和end没有被指定,那么差距提取整个主题。

successiveViews(subject, width, gapwidth=0, from=1): Equivalent to Views(subject, successiveIRanges(width, gapwidth, from)). See ?successiveIRanges for a description of the width, gapwidth and from arguments.
successiveViews(subject, width, gapwidth=0, from=1):Views(subject, successiveIRanges(width, gapwidth, from))等效。看到?successiveIRangeswidth,gapwidth和from参数的说明。


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


H. Pages



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

IRanges-class, Vector-class, IRanges-utils, XVector.
IRanges类,媒介类,IRanges-utils的,XVector。

Some direct subclasses of the Views class: XIntegerViews-class, XDoubleViews-class, RleViews-class, XStringViews-class.
视图类的一些直接子类:级RleViews,级XDoubleViews,XIntegerViews-级,XStringViews级。


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


  showClass("Views")  # shows (some of) the known subclasses[表演(部分)已知的子类]

  ## Create a set of 4 views on an XInteger subject of length 10:[#创建一套4上长度10 XInteger的主题意见:]
  subject <- XInteger(10, 3:-6)
  v1 <- Views(subject, start=4:1, end=4:7)

  ## Extract the 2nd view:[#提取第二个观点:]
  v1[[2]]

  ## Some views can be "out of limits"[#有些意见可以是“超限”]
  v2 <- Views(subject, start=4:-1, end=6)
  trim(v2)
  subviews(v2, end=-2)

  ## gaps() [#差距()]
  v3 <- Views(subject, start=c(8, 3), end=c(14, 4))
  gaps(v3)

  ## Views on a big XInteger subject:[#查看上一个大XInteger主题:]
  subject <- XInteger(99999, sample(99, 99999, replace=TRUE) - 50)
  v4 <- Views(subject, start=1:99*1000, end=1:99*1001)
  v4
  v4[-1]
  v4[[5]]

  ## 31 adjacent views:[#31相邻的意见:]
  successiveViews(subject, 40:10)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 10:41 , Processed in 0.026858 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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