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

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

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

                                        MultipleAlignment objects
                                         MultipleAlignment对象

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

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

The MultipleAlignment class is a container for storing multiple sequence alignments.
MultipleAlignment类是一个用于存储多个序列的容器。


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


## Constructors:
DNAMultipleAlignment(x=character(), start=NA, end=NA, width=NA,
    use.names=TRUE, rowmask=NULL, colmask=NULL)
RNAMultipleAlignment(x=character(), start=NA, end=NA, width=NA,
    use.names=TRUE, rowmask=NULL, colmask=NULL)
AAMultipleAlignment(x=character(), start=NA, end=NA, width=NA,
    use.names=TRUE, rowmask=NULL, colmask=NULL)

## Read functions:
read.DNAMultipleAlignment(filepath, format)
read.RNAMultipleAlignment(filepath, format)
read.AAMultipleAlignment(filepath, format)

## Write funtions:
write.phylip(x, filepath)

## ... and more (see below)



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

参数:x
Either a character vector (with no NAs), or an XString, XStringSet or XStringViews object containing strings with the same number of characters.  If writing out a Phylip file, then x would be a MultipleAlignment object  
特征向量(无NAS),或XString中,XStringSet或XStringViews反对与含有相同数目的字符字符串。如果写了PHYLIP文件,那么x是MultipleAlignment对象


参数:start,end,width
Either NA, a single integer, or an integer vector of the same length as x specifying how x should be "narrowed" (see ?narrow for the details).  
要么NA,一个单一的整数或整数向量相同长度的x指定如何x应该是“缩小”(见?narrow细节)。


参数:use.names
TRUE or FALSE. Should names be preserved?  
TRUE或FALSE。应名被保留吗?


参数:filepath
A character vector (of arbitrary length when reading, of length 1 when writing) containing the paths to the files to read or write. Note that special values like "" or "|cmd" (typically supported by other I/O functions in R) are not supported here. Also filepath cannot be a connection.  
一个特征向量(阅读时的任意长度,长度为1的写入时),其中包含读取或写入的文件路径。请注意,这里不支持像""或"|cmd"(通常由其他I / O在R的功能支持)的特殊值。 filepath不能成为一个连接。


参数:format
Either "fasta" (the default), stockholm, or "clustal".  
要么"fasta"(默认),stockholm或"clustal"。


参数:rowmask
a NormalIRanges object that will set masking for rows  
1 NormalIRanges对象将设置行掩蔽


参数:colmask
a NormalIRanges object that will set masking for columns   
的1 NormalIRanges对象将设置列掩蔽


Details

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

The MultipleAlignment class is designed to hold and represent multiple sequence alignments. The rows and columns within an alignment can be masked for ad hoc analyses.
MultipleAlignment类设计,持有和代表多个序列。行和列对齐内可以屏蔽专案分析。


存取方法----------Accessor methods----------

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

unmasked(x): The underlying XStringSet object containing the multiple sequence alignment.
unmasked(x):含有多序列比对的的基础XStringSet对象。

rownames(x): NULL or a character vector of the same length as x containing a short user-provided description or comment for each sequence in x.
rownames(x):NULL或作为x包含用户提供的简短说明或评论x每个序列的长度相同的特征向量。

rowmask(x), rowmask(x, append, invert) <- value: Gets and sets the NormalIRanges object representing the masked rows in x. The append argument takes union, replace or intersect to indicate how to combine the new value with rowmask(x). The invert argument takes a logical argument to indicate whether or not to invert the new mask. The value argument can be of any class that is coercible to a NormalIRanges via the as function.
rowmask(x),,rowmask(x, append, invert) <- value:获取和设置对象,代表在x的蒙面行的NormalIRanges。 append参数需要union,replace或intersect表明如何结合新的valuerowmask(x)。 invert参数需要一个逻辑参数表明是否反转新的面具。 value参数,可以为强制通过as函数1 NormalIRanges的任何类。

colmask(x), colmask(x, append, invert) <- value: Gets and sets the NormalIRanges object representing the masked columns in x. The append argument takes union, replace or intersect to indicate how to combine the new value with colmask(x). The invert argument takes a logical argument to indicate whether or not to invert the new mask. The value argument can be of any class that is coercible to a NormalIRanges via the as function.
colmask(x),,colmask(x, append, invert) <- value:获取和设置对象,代表在x的蒙面列的NormalIRanges。 append参数需要union,replace或intersect表明如何结合新的valuecolmask(x)。 invert参数需要一个逻辑参数表明是否反转新的面具。 value参数,可以为强制通过as函数1 NormalIRanges的任何类。

maskMotif(x, motif, min.block.width=1, ...): Returns a MultipleAlignment object with a modified column mask based upon motifs found in the consensus string where the consensus string keeps all the columns but drops the masked rows.
maskMotif(x, motif, min.block.width=1, ...):返回一个基于共识的共识字符串字符串,其中保存的所有列,但下降的蒙面行中发现的图案与修改后的列面具MultipleAlignment对象。




motif The motif to mask.
题材的图案来掩盖。




min.block.width The minimum width of the blocks to mask.
min.block.width块掩盖的最小宽度。




... Additional arguments for matchPattern.
... matchPattern额外的参数。

maskGaps(x, min.fraction, min.block.width): Returns a MultipleAlignment object with a modified column mask based upon gaps in the columns. In particular, this mask is defined by min.block.width or more consecutive columns that have min.fraction or more of their non-masked rows containing gap codes.
maskGaps(x, min.fraction, min.block.width):返回一个基于列的差距与修改后的列面具MultipleAlignment对象。特别是,这个面具被定义min.block.width或更多的连续min.fraction或更多的非屏蔽的含差距代码的行列。




min.fraction A value in [0, 1] that indicates the minimum fraction needed to call a gap in the consensus string
min.fraction一个值在[0, 1]需要调用的共识字符串中的差距,表示最低分数




min.block.width A positive integer that indicates the minimum number of consecutive gaps to mask, as defined by
min.block.width,定义一个正整数,表示连续的差距最小数目面具

nrow(x): Returns the number of sequences aligned in x.
nrow(x):返回对齐x序列的数目。

ncol(x): Returns the number of characters for each alignment in x.
ncol(x):x返回每个对齐的字符数。

dim(x): Equivalent to c(nrow(x), ncol(x)).
dim(x):c(nrow(x), ncol(x))等效。

maskednrow(x): Returns the number of masked aligned sequences in x.
maskednrow(x):返回x蒙面序列的数量。

maskedncol(x): Returns the number of masked aligned characters in x.
maskedncol(x):返回在x蒙面对齐字符的数目。

maskeddim(x): Equivalent to c(maskednrow(x), maskedncol(x)).
maskeddim(x):c(maskednrow(x), maskedncol(x))等效。

maskedratio(x): Equivalent to maskeddim(x) / dim(x).
maskedratio(x):maskeddim(x) / dim(x)等效。

nchar(x): Returns the number of unmasked aligned characters in x, i.e. ncol(x) - maskedncol(x).
nchar(x):返回x,即ncol(x) - maskedncol(x)东窗事发对齐字符。

alphabet(x): Equivalent to alphabet(unmasked(x)).
alphabet(x):alphabet(unmasked(x))等效。


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

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

as(from, "DNAStringSet"), as(from, "RNAStringSet"), as(from, "AAStringSet"), as(from, "BStringSet"): Creates an instance of the specified XStringSet object subtype that contains the unmasked regions of the multiple sequence alignment in x.
as(from, "DNAStringSet"),as(from, "RNAStringSet"),as(from, "AAStringSet"),as(from, "BStringSet"):创建指定亚型XStringSet对象的,包含在x多序列比对的东窗事发区域的实例。

as.character(x, use.names): Convert x to a character vector containing the unmasked regions of the multiple sequence alignment. use.names controls whether or not rownames(x) should be used to set the names of the returned vector (default is TRUE).
as.character(x, use.names)转换x字符向量多序列比对的东窗事发区域。 use.names控制是否rownames(x)应该用来设置返回向量的名称(默认为TRUE)。

as.matrix(x, use.names): Returns a character matrix containing the "exploded" representation of the unmasked regions of the multiple sequence alignment. use.names controls whether or not rownames(x) should be used to set the row names of the returned matrix (default is TRUE).
as.matrix(x, use.names):返回一个字符矩阵包含的“爆炸”多序列比对的东窗事发区域的代表性。 use.names控制是否rownames(x)应该用来设置返回矩阵的行名(默认是TRUE)。


公用事业----------Utilities----------

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

consensusMatrix(x, as.prob, baseOnly): Creates an integer matrix containing the column frequencies of the underlying alphabet with masked columns being represented with NA values. If as.prob is TRUE, then probabilities are reported, otherwise counts are reported (the default). If baseOnly is TRUE, then the non-base letters are collapsed into an "other" category.
consensusMatrix(x, as.prob, baseOnly):创建一个整数矩阵的基本字母表NA值代表蒙面列载列的频率。 as.prob如果是TRUE,然后概率报道,否则计数(默认)。如果baseOnly是TRUE,然后在非碱基的信件倍数成一个"other"类别。

consensusString(x, ...): Creates a consensus string for x with the symbol "#" representing a masked column. See consensusString for details on the arguments.
consensusString(x, ...):创建一个共识字符串x符号"#"代表一个蒙面列。看到consensusString参数的详细信息。

consensusViews(x, ...): Similar to the consensusString method. It returns a  XStringViews on the consensus string containing subsequence contigs of non-masked columns. Unlike the consensusString method, the masked columns in the underlying string contain a consensus value rather than the "#" symbol.
consensusViews(x, ...):类似consensusString方法。它返回字符串包含非屏蔽列的序列重叠群上的共识一个XStringViews。 consensusString方法不同,在底层的字符串的蒙面列包含一个共识,而不是"#"象征价值。

alphabetFrequency(x, as.prob, collapse): Creates an integer matrix containing the row frequencies of the underlying alphabet. If as.prob is TRUE, then probabilities are reported, otherwise counts are reported (the default). If collapse is TRUE, then returns the overall frequency instead of the frequency by row.
alphabetFrequency(x, as.prob, collapse):创建一个整数矩阵,包含的基本字母表行频率。 as.prob如果是TRUE,然后概率报道,否则计数(默认)。如果collapse是TRUE,然后返回的整体频率的频率,而不是按行。

detail(x, invertColMask, hideMaskedCols): Allows for a full pager driven display of the object so that masked cols and rows can be removed and the entire sequence can be visually inspected. If hideMaskedCols is set to it's default value of TRUE then the output will hide all the the masked columns in the output.  Otherwise, all columns will be displayed along with a row to indicate the masking status.  If invertColMask is TRUE then any displayed mask will be flipped so as to represent things in a way consistent with Phylip style files instead of the mask that is actually stored in the MultipleAlignment object.  Please notice that invertColMask will be ignored if hideMaskedCols is set to its default value of TRUE since in that case it will not make sense to show any masking information in the output. Masked rows are always hidden in the output.
detail(x, invertColMask, hideMaskedCols):允许这样的蒙面cols和rows可以被删除,可以目视检查整个序列为对象的一个完整的寻呼机驱动显示。如果hideMaskedCols设置的的TRUE默认值,然后输出,将隐藏在输出所有的蒙面列。否则,将显示所有的列行表明掩蔽状态。如果invertColMask是TRUE那么任何显示的面具将翻转,以便代表与PHYLIP风格文件一致的方式,而不是面具,实际上在MultipleAlignment对象存储的东西。请注意,invertColMask如果hideMaskedCols设置其默认值将被忽略TRUE因为在这种情况下,它不会显示任何输出屏蔽信息的意识。蒙面行总是隐藏在输出中。


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


P. Aboyoun and M. Carlson



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

XStringSet-class, MaskedXString-class
XStringSet类,MaskedXString级


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


## create an object from file[#从文件中创建一个对象。]
origMAlign <-
  read.DNAMultipleAlignment(filepath =
                            system.file("extdata",
                                        "msx2_mRNA.aln",
                                        package="Biostrings"),
                            format="clustal")

## list the names of the sequences in the alignment[#列出在对齐序列的名称]
rownames(origMAlign)

## rename the sequences to be the underlying species for MSX2[#重命名序列MSX2底层物种]
rownames(origMAlign) <- c("Human","Chimp","Cow","Mouse","Rat",
                          "Dog","Chicken","Salmon")
origMAlign

## See a detailed pager view[#查看详细的传呼机视图]
if (interactive()) {
detail(origMAlign)
}

## operations to mask rows[#操作来掩盖行]
## For columns, just use colmask() and do the same kinds of operations[#列,只是使用colmask()和不同种业务]
rowMasked <- origMAlign
rowmask(rowMasked) <- IRanges(start=1,end=3)
rowMasked

## remove rowumn masks[#删除rowumn口罩]
rowmask(rowMasked) <- NULL
rowMasked

## "select" rows of interest[#“,选择”行利益]
rowmask(rowMasked, invert=TRUE) <- IRanges(start=4,end=7)
rowMasked

## or mask the rows that intersect with masked rows[#或掩盖相交蒙面行与行]
rowmask(rowMasked, append="intersect") <- IRanges(start=1,end=5)
rowMasked

## TATA-masked[#塔塔屏蔽]
tataMasked <- maskMotif(origMAlign, "TATA")
colmask(tataMasked)

## automatically mask rows based on consecutive gaps[#自动屏蔽基于连续空白行]
autoMasked <- maskGaps(origMAlign, min.fraction=0.5, min.block.width=4)
colmask(autoMasked)
autoMasked

## calculate frequencies[#计算频率]
alphabetFrequency(autoMasked)
consensusMatrix(autoMasked, baseOnly=TRUE)[, 84:90]

## get consensus values[#取得共识值。]
consensusString(autoMasked)
consensusViews(autoMasked)

## cluster the masked alignments[#聚类蒙面路线]
sdist <- stringDist(as(autoMasked,"DNAStringSet"), method="hamming")
clust <- hclust(sdist, method = "single")
plot(clust)
fourgroups <- cutree(clust, 4)
fourgroups

## write out the alignement object (with current masks) to Phylip format[#写出来的alignement对象(与当前口罩)PHYLIP格式]
write.phylip(x = autoMasked, filepath = tempfile("foo.txt",tempdir()))


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-25 05:18 , Processed in 0.040541 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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