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

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

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

                                        MaskCollection objects
                                         MaskCollection对象

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

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

The MaskCollection class is a container for storing a collection of masks that can be used to mask regions in a sequence.
MaskCollection类是一个容器用于存储收集的,可以用来掩盖序列中区域的口罩。


Details

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

In the context of the Biostrings package, a mask is a set of regions in a sequence that need to be excluded from some computation. For example, when calling alphabetFrequency or matchPattern on a chromosome sequence, you might want to exclude some regions like the centromere or the repeat regions. This can be achieved by putting one or several masks on the sequence before calling alphabetFrequency on it.
在的Biostrings包的情况下,一个面具是一组序列中的区域,需要排除一些计算。例如,当调用alphabetFrequency或matchPattern在染色体上的顺序,你可能要排除一些区域如着丝粒或重复区域。这样就可以实现调用alphabetFrequency之前把序列上的一个或几个口罩。

A MaskCollection object is a vector-like object that represents such set of masks. Like standard R vectors, it has a "length" which is the number of masks contained in it. But unlike standard R vectors, it also has a "width" which determines the length of the sequences it can be "put on". For example, a MaskCollection object of width 20000 can only be put on an XString object of 20000 letters.
一个MaskCollection对象是矢量对象表示,口罩等。标准R向量一样,它有一个“长”,这是在它所含的口罩数量。但不像标准的R向量,它也有一个“宽”,这就决定了它可以“放”的序列的长度。例如,一个宽度20000 MaskCollection的对象只能放在一个20000信XString的对象。

Each mask in a MaskCollection object x is just a finite set of integers that are >= 1 and <= width(x). When "put on" a sequence, these integers indicate the positions of the letters to mask. Internally, each mask is represented by a NormalIRanges object.
每个面具在MaskCollection对象x只是一个有限整数集> = 1 <=width(x)。当一个序列“放”,这些整数表示的面具字母的位置。在内部,每个面具代表由NormalIRanges对象。


基本存取方法----------Basic accessor methods----------

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

length(x): The number of masks in x.
length(x):口罩x。

width(x): The common with of all the masks in x. This determines the length of the sequences that x can be "put on".
width(x):共同所有口罩x。这就决定了x可以是“穿上”序列的长度。

active(x): A logical vector of the same length as x where each element indicates whether the corresponding mask is active or not.
active(x):一个逻辑向量长度相同x,其中每个元素表示相应的屏蔽是否是活跃与否。

names(x): NULL or a character vector of the same length as x.
names(x):NULL或相同的长度为x特征向量。

desc(x): NULL or a character vector of the same length as x.
desc(x):NULL或相同的长度为x特征向量。

nir_list(x): A list of the same length as x, where each element is a NormalIRanges object representing a mask in x.
nir_list(x):x长度相同的名单,其中每个元素是一个NormalIRanges对象,代表了x面具。


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

Mask(mask.width, start=NULL, end=NULL, width=NULL): Return a single mask (i.e. a MaskCollection object of length 1) of width mask.width (a single integer >= 1) and masking the ranges of positions specified by start, end and width. See the IRanges constructor (?IRanges) for how start, end and width can be specified. Note that the returned mask is active and unnamed.
Mask(mask.width, start=NULL, end=NULL, width=NULL):返回一个单一的面具的宽度(即一个长度为1 MaskCollection对象)mask.width(一个整数> = 1)和屏蔽范围内的指定位置start, end和width。见IRanges构造(?IRanges)start,end和width可以指定。注意,返回的面具是积极的和无名的。


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

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

isEmpty(x): Return a logical vector of the same length as x, indicating, for each mask in x, whether it's empty or not.
isEmpty(x):返回一个长度相同的逻辑向量x,说明,每个面具x,无论是空或不。

max(x): The greatest (or last, or rightmost) masked position for each mask. This is a numeric vector of the same length as x.
max(x):最大(或最后一个,或者最右边)每个面具的蒙面位置。这是一个数值向量相同长度为x。

min(x): The smallest (or first, or leftmost) masked position for each mask. This is a numeric vector of the same length as x.
min(x):最小(或先,或最左边的)每个面具的蒙面位置。这是一个数值向量相同长度为x。

maskedwidth(x): The number of masked position for each mask. This is an integer vector of the same length as x where all values are >= 0 and <= width(x).
maskedwidth(x):每个面具的蒙面位置。这是一个具有相同长度的整数向量x其中所有值都> = 0和<=width(x)。

maskedratio(x): maskedwidth(x) / width(x)
maskedratio(x):maskedwidth(x) / width(x)


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

In the code snippets below, x and values are MaskCollection objects.
在下面的代码片段,x和values是MaskCollection的对象。

x[i]: Return a new MaskCollection object made of the selected masks. Subscript i can be a numeric, logical or character vector.
x[i]:返回新MaskCollection的对象所选面具制成。标i可以是一个数字,逻辑或特征向量。

x[[i, exact=TRUE]]: Extract the mask selected by i as a NormalIRanges object. Subscript i can be a single integer or a character string.
x[[i, exact=TRUE]]:提取i选择的面具作为NormalIRanges对象。标i可以是一个整数或字符串。

append(x, values, after=length(x)): Add masks in values to x.
append(x, values, after=length(x)):在valuesx添加口罩。


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

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

collapse(x): Return a MaskCollection object of length 1 obtained by collapsing all the active masks in x.
collapse(x):返回一个长度为1 MaskCollection倒塌所有活跃在x口罩获得的对象。

gaps(x): Invert the masks in x.
gaps(x):反口罩x。

narrow(x, start=NA, end=NA, width=NA, use.names=TRUE): If y is a sequence that x has been put on top of, then narrow will return the set of submasks that go on top of the subsequence obtained by calling subseq on y (narrow must be called on x with the same arguments that have been used to call subseq on y).
narrow(x, start=NA, end=NA, width=NA, use.names=TRUE)如果y是一个序列x之上,然后narrow将返回通过调用获得一组序列的顶部submasks subseqy(narrow必须呼吁x已使用相同的参数调用subseqy)。


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


H. Pages



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

NormalIRanges-class, read.Mask, MaskedXString-class, reverse, alphabetFrequency, matchPattern
NormalIRanges级,read.Mask,级MaskedXString,reverse,alphabetFrequency,matchPattern


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


  ## Making a MaskCollection object:[#制作MaskCollection对象的:]
  mask1 <- Mask(mask.width=29, start=c(11, 25, 28), width=c(5, 2, 2))
  mask2 <- Mask(mask.width=29, start=c(3, 10, 27), width=c(5, 8, 1))
  mask3 <- Mask(mask.width=29, start=c(7, 12), width=c(2, 4))
  mymasks <- append(append(mask1, mask2), mask3)
  mymasks
  length(mymasks)
  width(mymasks)
  collapse(mymasks)
  gaps(mymasks)

  ## Names and descriptions:[#名称和描述:]
  names(mymasks) &lt;- c("A", "B", "C")  # names should be short and unique...[名称应该是短期的和独特的...]
  mymasks
  mymasks[c("C", "A")]  # ...to make subsetting by names easier[使名称子集更容易]
  desc(mymasks) <- c("you can be", "more verbose", "here")
  mymasks[-2]

  ## Activate/deactivate masks:[#激活/停用口罩:]
  active(mymasks)["B"] <- FALSE
  mymasks
  collapse(mymasks)
  active(mymasks) &lt;- FALSE  # deactivate all masks[停用所有口罩]
  mymasks
  active(mymasks)[-1] &lt;- TRUE  # reactivate all masks except mask 1[除面膜1激活所有口罩]
  active(mymasks) &lt;- !active(mymasks)  # toggle all masks[切换所有口罩]

  ## Other advanced operations:[#其他高级操作:]
  mymasks[[2]]
  length(mymasks[[2]])
  mymasks[[2]][-3]
  append(mymasks[-2], gaps(mymasks[2]))
  mymasks2 <- narrow(mymasks, start=8)
  mymasks2
  mymasks2[[2]]

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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