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

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

[复制链接]
发表于 2012-2-25 13:51:51 | 显示全部楼层 |阅读模式
XStringViews-class(Biostrings)
XStringViews-class()所属R语言包:Biostrings

                                        The XStringViews class
                                         XStringViews类

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

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

The XStringViews class is the basic container for storing a set of views (start/end locations) on the same sequence (an XString object).
XStringViews类是存储一组在同一顺序的意见(开始/结束位置)(XString对象)的基本容器。


Details

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

An XStringViews object contains a set of views (start/end locations) on the same XString object called "the subject string" or "the subject sequence" or simply "the subject". Each view is defined by its start and end locations: both are integers such that start <= end. An XStringViews object is in fact a particular case of an Views  object (the XStringViews class contains the Views class) so it  can be manipulated in a similar manner: see ?Views for  more information. Note that two views can overlap and that a view can be "out of limits" i.e. it can start before the first letter of the subject or/and end after its last letter.
一个XStringViews对象包含了一套被称为“的主题串”或“主题序列”或干脆“的主题是”在同一XString对象的意见(开始/结束位置)。每个视图定义其开始和结束的位置:两者都是整数,这样启动<=结束。一个XStringViews对象其实是一视图对象(在XStringViews类包含视图类),特殊情况,所以它可以以类似的方式操纵:看到?Views更多信息。注意两方面的意见,可以重叠和视图可以是“限制”,即它的主题和/或结束前的最后一个字母后的第一个字母就可以开始。


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

Views(subject, start=NULL, end=NULL, width=NULL, names=NULL): See ?Views in the IRanges package for the details.
Views(subject, start=NULL, end=NULL, width=NULL, names=NULL):见?Views在的细节IRanges包。


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

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

nchar(x): A vector of non-negative integers containing the number of letters in each view. Values in nchar(x) coincide with values in width(x) except for "out of limits" views where they are lower.
nchar(x):在每个视图中包含字母的非负整数向量。价值观nchar(x)width(x)除了为“限额”的地方,他们认为较低的值相吻合。


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

In the code snippets below, x, object, e1 and e2 are XStringViews objects, and i can be a numeric or logical vector.
在下面的代码片段,x,object,e1和e2是XStringViews的对象,和i可以是一个数字或逻辑的向量。

e1 == e2: A vector of logicals indicating the result of the view by view comparison. The views in the shorter of the two XStringViews object being compared are recycled as necessary.
e1 == e2:一个逻辑值的向量表示的观点比较的角度。在对象被比较的两个XStringViews较短的意见是必要的回收。

Like for comparison between XString objects, comparison between two XStringViews objects with subjects of different classes is not supported with one exception: when the subjects are DNAString and RNAString instances.
喜欢比较XString对象,两个XStringViews科目不同类对象之间的比较是不支持有一个例外:当受试者是DNAString和RNAString实例。

Also, like with XString objects, comparison between an XStringViews object with a BString subject and a character vector is supported (see examples below).
此外,像XString对象,支持与BString主题XStringViews对象和特征向量之间的比较(见下面的例子)。

e1 != e2: Equivalent to !(e1 == e2).
e1 != e2:!(e1 == e2)等效。

as.character(x, use.names, check.limits): Convert x to a character vector of the same length as x. use.names controls whether or not names(x) should be used to set the names of the returned vector (default is TRUE). check.limits controls whether or not an error should be raised if x contains "out of limit" views (default is TRUE). With check.limits=FALSE then "out of limit" views are padded with spaces.
as.character(x, use.names, check.limits):转换x为x相同长度的特征向量。 use.names控制是否names(x)应该用来设置返回向量的名称(默认为TRUE)。 check.limits是否一个错误,应当提出x如果包含“出来的限制”的意见(默认为TRUE)控制。用check.limits=FALSE然后“超出范围”的意见是用空格填充。

as.matrix(x, mode, use.names, check.limits): Depending on what mode is chosen ("integer" or "character"), return either a 2-column integer matrix containing start(x) and end(x) or a character matrix containing the "exploded" representation of the views. mode="character" can only be used on an XStringViews object with equal-width views. Arguments use.names and check.limits are ignored with mode="integer". With mode="character", use.names controls whether or not names(x) should be used to set the row names of the returned matrix (default is TRUE), and check.limits controls whether or not an error should be raised if x contains "out of limit" views (default is TRUE). With check.limits=FALSE then "out of limit" views are padded with spaces.
as.matrix(x, mode, use.names, check.limits):根据什么mode选择("integer"或"character"),返回一个2列的整数矩阵包含start(x)和end(x),或含有“爆炸”的意见表示一个字符矩阵。 mode="character"只能用于XStringViews对象宽度相等的意见。参数use.names和check.limits是mode="integer"忽略。 mode="character",use.names控制是否names(x)应设置返回矩阵的行名(默认是TRUE),check.limits控制是否一个错误,应当提出,如果x了限制“的意见(默认是TRUE)中包含”。用check.limits=FALSE然后“超出范围”的意见是用空格填充。

toString(x): Equivalent to toString(as.character(x)).
toString(x):toString(as.character(x))等效。


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


H. Pages



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

Views-class, gaps, XString-class, XStringSet-class, letter, MIndex-class
视图 - 类,gaps,XString级,XStringSet级,letter,MIndex级


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


  ## One standard way to create an XStringViews object is to use[一个标准的方式来创建一个XStringViews对象是使用]
  ## the Views() constructor.[#的意见()构造。]

  ## Views on a DNAString object:[#上DNAString对象的次数:]
  s <- DNAString("-CTC-N")
  v4 <- Views(s, start=3:0, end=5:8)
  v4
  subject(v4)
  length(v4)
  start(v4)
  end(v4)
  width(v4)

  ## Attach a comment to views #3 and #4:[#附加意见,#3和#4的评论:]
  names(v4)[3:4] <- "out of limits"
  names(v4)

  ## A more programatical way to "tag" the "out of limits" views:[#更programatical的的方式“标签”的意见“限制了”:]
  names(v4)[start(v4) < 1 | nchar(subject(v4)) < end(v4)] <- "out of limits"
  ## or just:[#或者只是:]
  names(v4)[nchar(v4) < width(v4)] <- "out of limits"

  ## Two equivalent ways to extract a view as an XString object:[#两个等价的方法提取作为XString对象的视图:]
  s2a <- v4[[2]]
  s2b <- subseq(subject(v4), start=start(v4)[2], end=end(v4)[2])
  identical(s2a, s2b) # TRUE[真]

  ## It is an error to try to extract an "out of limits" view:[#这是一个错误尝试提取出“意见”限制:]
  #v4[[3]] # Error![V4 [3]#错误!]

  v12 <- Views(DNAString("TAATAATG"), start=-2:9, end=0:11)
  v12 == DNAString("TAA")
  v12[v12 == v12[4]]
  v12[v12 == v12[1]]
  v12[3] == Views(RNAString("AU"), start=0, end=2)

  ## Here the first view doesn't even overlap with the subject:[#这里的第一种观点,甚至不重叠的主题:]
  Views(BString("aaa--b"), start=-3:4, end=-3:4 + c(3:6, 6:3))

  ## 'start' and 'end' are recycled:[#开始和end回收:]
  subject <- "abcdefghij"
  Views(subject, start=2:1, end=4)
  Views(subject, start=5:7, end=nchar(subject))
  Views(subject, start=1, end=5:7)

  ## Applying gaps() to an XStringViews object:[#应用的差距()到XStringViews对象:]
  v2 <- Views("abCDefgHIJK", start=c(8, 3), end=c(14, 4))
  gaps(v2)

  ## Coercion:[#强制:]
  as(v12, "XStringSet")  # same as 'as(v12, "DNAStringSet")'[一样的“(V12,”DNAStringSet“)]
  rna <- as(v12, "RNAStringSet")
  as(rna, "Views")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-25 04:39 , Processed in 0.028611 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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