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

R语言 Biostrings包 FASTA-io-legacy()函数中文帮助文档(中英文对照)

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

                                        Legacy functions to read/write FASTA formatted files
                                         传统功能,读取/写入FASTA格式的文件

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

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

readFASTA and writeFASTA read from and write to a FASTA file.
readFASTA和writeFASTA读取和写入到一个FASTA文件。

Note that the object returned by readFASTA or passed to writeFASTA is a standard list. For faster and more memory efficient alternatives that return/accept an XStringSet object, see the read.DNAStringSet function and family.
注意,返回的对象readFASTA或传递给writeFASTA是一个标准的列表。为更快和更有效的替代返回/接受XStringSet对象的内存,请参阅read.DNAStringSet功能和家庭。


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


readFASTA(file, checkComments=TRUE, strip.descs=TRUE)
writeFASTA(x, file="", desc=NULL, append=FALSE, width=80)



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

参数:file
Either a character string naming a file or a connection. If "" (the default for writeFASTA), then the function writes to the standard output connection (the console) unless redirected by sink.  
无论是一个字符串,命名一个文件或一个连接。如果""(默认为writeFASTA),那么该函数写入到标准输出连接(控制台),除非sink重定向。


参数:checkComments
Whether or not comments, lines beginning with a semi-colon should be found and removed.  
是否或没有意见,以分号开头的行被发现和删除。


参数:strip.descs
Whether or not the ">" marking the beginning of the description lines should be removed. Note that this argument is new in Biostrings >= 2.8. In previous versions readFASTA was keeping the ">".  
应拆除与否的标志说明行开始“>”。请注意,这种说法是新Biostrings> = 2.8。在以前的版本readFASTA保持“>”。


参数:x
A list as one returned by readFASTA if desc is not specified (i.e. NULL). If desc is specified (see below) then x can also be a list-like object with XString elements (for example it can be an XStringSet, XStringViews or BSgenome object) or just a character vector.  
作为一个列表返回readFASTA如果desc未指定(即NULL)。如果desc指定(见下文),然后x也可以是一个与XString元素(例如,它可以是一个的XStringSet,XStringViews或BSgenome对象),或只是一个特征向量列表的对象。


参数:desc
If NULL (the default) then x must be a list as one returned by readFASTA and all the sequences in x are written to the file. Otherwise desc must be a character vector no longer than the number of sequences in x containing the descriptions of the sequences in x that must be written to the file.  
如果NULL(默认),然后x必须作为一个readFASTA和x被写入到文件中的所有序列返回一个列表。否则desc必须是一个字符向量序列数比不再x x必须被写入到文件中的序列的描述。


参数:append
TRUE or FALSE. If TRUE output will be appended to file; otherwise, it will overwrite the contents of file. See ?cat for the details.  
TRUE或FALSE。如果TRUE输出将被附加到file,否则,它会覆盖file内容。看到?cat细节。


参数:width
The maximum number of letters per line of sequence.  
的字母顺序每行的最大数量。


Details

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

FASTA is a simple file format for biological sequence data. A file may contain one or more sequences, for each sequence there is a description  line which begins with a >.
FASTA格式是一种简单的生物序列数据的文件格式。一个文件可能包含一个或多个序列,每个序列有一个描述行与>开始。

FASTA is a widely used format in biology. It is a relatively simple markup. I am not aware of a standard. It might be nice to check to see if the  data that were parsed are sequences of some appropriate type, but without a standard that does not seem possible.
FASTA格式是在生物学中广泛使用的格式。这是一个相对简单的标记。我不知道标准。这可能是不错的检查,看看是否被解析的数据是一些适当的类型的序列,但没有一个标准,似乎并不可能。

There are many other packages that provide similar, but different  capabilities.  The one in the package seqinr seems most similar but they separate the biological sequence into single character strings, which is too inefficient for large problems.
有很多其他软件包提供类似,但不同的功能。在的包seqinr之一似乎最相似的,但他们分开成单个字符串的生物序列,这是太低效的大问题。


值----------Value----------

For readFASTA: A list with one element per FASTA record in the file. Each element is in two parts, one is the description of the record and the second a character string of the biological sequence.
对于readFASTA:FASTA格式的文件记录的每一个元素的列表。每个元素是两个部分,一个是记录,并在第二个生物序列的字符串描述。


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


R. Gentleman, H. Pages. Improvements to writeFASTA by Kasper D. Hansen



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

read.DNAStringSet, fasta.info, write.XStringSet, read.table, scan, write.table, BSgenome-class
read.DNAStringSet,fasta.info,write.XStringSet,read.table,scan,write.table,BSgenome-class


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


  f1 <- system.file("extdata", "someORF.fa", package="Biostrings")
  ff <- readFASTA(f1, strip.descs=TRUE)
  desc <- sapply(ff, function(x) x$desc)
  desc

  ## Keep the "reverse complement" sequences only:[#保持“逆补”序列:]
  ff2 <- ff[grep("reverse complement", desc, fixed=TRUE)]

  ## Write them to a FASTA file:[#写一个FASTA文件:]
  temp_file <- file.path(tempdir(), "temp.fa")
  writeFASTA(ff2, file=temp_file)

  ## Write the first 2 to a FASTA file with a modified description:[#写的第2 FASTA格式的文件与修改后的描述:]
  writeFASTA(ff2, file=temp_file, desc=c("a", "b"))

  ## Write a genome to a FASTA file:[#写的一个基因组的一个FASTA文件:]
  library(BSgenome.Celegans.UCSC.ce2)
  writeFASTA(Celegans, file=temp_file, desc=seqnames(Celegans))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 22:53 , Processed in 0.022615 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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