write.fasta(seqinr)
write.fasta()所属R语言包:seqinr
Write sequence(s) into a file in fasta format
FASTA格式的文件中写序列(S)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Writes one or more sequences into a file in FASTA format.
写入FASTA格式到一个文件中的一个或多个序列。
用法----------Usage----------
write.fasta(sequences, names, file.out, open = "w", nbchar = 60)
参数----------Arguments----------
参数:sequences
A DNA or protein sequence (in the form of a vector of single characters) or a list of such sequences.
的DNA或蛋白质序列(在一个向量的单个字符的形式),或这样的序列的列表。
参数:names
The name(s) of the sequences.
的名称(s)的序列。
参数:nbchar
The number of characters per line (default: 60)
每行的字符数(默认值:60)
参数:file.out
The name of the output file.
的输出文件的名称。
参数:open
Mode to open the output file, use "w" to write into a new file, use "a" to append at the end of an already existing file.
模式打开输出文件,使用“W”写入到一个新的文件,请使用“a”到附加在一个已经存在的文件。
值----------Value----------
none.
没有。
(作者)----------Author(s)----------
A. Necsulea
参考文献----------References----------
参见----------See Also----------
read.fasta
read.fasta
实例----------Examples----------
## Read 3 sequences from a FASTA file:[#读取3个序列从FASTA文件:]
ortho <- read.fasta(file = system.file("sequences/ortho.fasta", package =
"seqinr"))
## Select only third codon positions:[只选择密码子第三位置:]
ortho3 <- lapply(ortho, function(x) x[seq(from = 3, to = length(x), by = 3)])
## Write the 3 modified sequences to a file:[#写的3到一个文件的修改序列:]
write.fasta(sequences = ortho3, names = names(ortho3), nbchar = 80, file.out = "ortho3.fasta")
## Read them again from the same file and check that sequences are preserved:[#从同一个文件中读一遍,检查序列被保留:]
ortho3bis <- read.fasta("ortho3.fasta", set.attributes = FALSE)
stopifnot(identical(ortho3bis, ortho3))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|