consensus(seqinr)
consensus()所属R语言包:seqinr
Consensus and profiles for sequence alignments
序列比对的共识和配置文件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function returns a consensus using variuous methods (see details) or a profile from a sequence alignment.
这个函数返回一个共识,的使用variuous方法(见详情)或序列比对的档案。
用法----------Usage----------
consensus(matali, method = c( "majority", "threshold", "IUPAC", "profile"),
threshold = 0.60, warn.non.IUPAC = FALSE, type = c("DNA", "RNA"))
con(matali, method = c( "majority", "threshold", "IUPAC", "profile"),
threshold = 0.60, warn.non.IUPAC = FALSE, type = c("DNA", "RNA"))
参数----------Arguments----------
参数:matali
an object of class alignment as returned by read.alignment, or a matrix of characters.
类的一个对象alignment返回read.alignment,或矩阵的字符。
参数:method
select the method to use, see details.
选择所使用的方法,查看详细信息。
参数:threshold
for the threshold method, a numeric value beteen 0 and 1 indicating the minimum relative frequency for a character to be returned as the consensus character. If none, NA is returned.
threshold方法,一个数值的承继0和1表示的字符被返回作为的共识字符的最小相对频率。如果没有,则返回NA。
参数:warn.non.IUPAC
for the IUPAC method this argument is passed to bma with a default value set to FALSE to avoid warnings due to gap characters in the alignment.
IUPAC方法的参数被传递给bma的默认值设置为false,以避免由于差距的对齐字符的警告。
参数:type
for the IUPAC method this argument is passed to bma.
IUPAC方法参数被传递给bma。
Details
详细信息----------Details----------
"majority" The character with the higher frequency is returned as the
“多数”的字符被返回作为具有较高的频率
"threshold" As above but in addition the character relative frequency must be higher than the value controled by the threshold argument.
“阈值”以上,但在另外的字符相对频率必须高于基于PLC控制的threshold参数的值。
"IUPAC" Make sense only for nucleic acid sequences (DNA or RNA). The consensus character is defined if possible by an IUPAC symbol by function bma. If this is not possible, when there is a gap
“IUPAC”品牌感仅用于核酸序列(DNA或RNA)。字符被定义的共识,如果可能的话,由IUPAC符号的功能bma。如果这是不可能的,当存在一间隙
"profile" With this method a matrix with the count of each possible
使用这种方法的“个人档案”的计数每一个可能的矩阵
con is a short form for consensus.
con是一个简短的形式consensus。
值----------Value----------
Either a vector of single characters with possible NA or a matrix with the method profile.
无论是矢量的单个字符可能不适用或矩阵的方法profile。
(作者)----------Author(s)----------
J.R. Lobry
参考文献----------References----------
参见----------See Also----------
See read.alignment to import alignment from files.
见read.alignment从文件导入对准。
实例----------Examples----------
#[]
# Read 5 aligned DNA sequences at 42 sites:[5排列的DNA序列在42个:]
#[]
phylip <- read.alignment(file = system.file("sequences/test.phylip",
package = "seqinr"), format = "phylip")
#[]
# Show data in a matrix form:[以矩阵形式的数据显示:]
#[]
(matali <- as.matrix(phylip))
#[]
# With the majority rule:[多数规则:]
#[]
res <- consensus(phylip)
stopifnot(c2s(res) == "aaaccctggccgttcagggtaaaccgtggccgggcagggtat")
#[]
# With a threshold:[与阈值:]
#[]
res.thr <- consensus(phylip, method = "threshold")
res.thr[is.na(res.thr)] <- "." # change NA into dots[改变NA点]
# stopifnot(c2s(res.thr) == "aa.c..t.gc.gtt..g..t.a.cc..ggccg.......ta.")[stopifnot的(C2S(res.thr)的==“aa.c.。t.gc.gtt。G .. TACC .. ggccg ....... TA”。)]
stopifnot(c2s(res.thr) == "aa.cc.tggccgttcagggtaaacc.tggccgg.cagggtat")
#[]
# With an IUPAC summary:[与IUPAC总结:]
#[]
res.iup <- consensus(phylip, method = "IUPAC")
stopifnot(c2s(res.iup) == "amvsbnkkgcmkkkmmgsktrmrssndkgcmrkdmmvskyaw")
# replace 3 and 4-fold symbols by dots:[更换3和4倍的符号由点:]
res.iup[match(res.iup, s2c("bdhvn"), nomatch = 0) > 0] <- "."
stopifnot(c2s(res.iup) == "am.s..kkgcmkkkmmgsktrmrss..kgcmrk.mm.skyaw")
#[]
# With a profile method:[使用配置文件的方法:]
#[]
(res <- consensus(phylip, method = "profile"))
#[]
# Show the connection between the profile and some consensus:[显示之间的连接配置文件和一些共识:]
#[]
bxc <- barplot(res, col = c("green", "blue", "orange", "white", "red"), border = NA,
space = 0, las = 2, ylab = "Base count",
main = "Profile of a DNA sequence alignment",
xlab = "sequence position", xaxs = "i")
text(x = bxc, y = par("usr")[4],lab = res.thr, pos = 3, xpd = NA)
text(x = bxc, y = par("usr")[1],lab = res.iup, pos = 1, xpd = NA)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|