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

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

[复制链接]
发表于 2012-2-26 14:04:29 | 显示全部楼层 |阅读模式
FastqFile-class(ShortRead)
FastqFile-class()所属R语言包:ShortRead

                                        Sampling and streaming records from fastq files
                                         采样和流fastq文件记录

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

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

FastqFile represents a path and connection to a fastq file. FastqFileList is a list of such connections.
FastqFile代表到fastq文件的路径和连接。 FastqFileList是一个这样的连接列表。

FastqSampler draws a subsample from a fastq file. yield is the method used to extract the sample from the FastqSampler instance; a short illustration is in the example below.
FastqSampler绘制一个从fastq文件的子样本。 yield是FastqSampler实例提取样品使用的方法,在下面的例子是一个简短的插图。

FastqStreamer draws successive subsets from a fastq file. Iterating over the stream will eventually yield the entire file; a short illustration is in the example below.
FastqStreamer投篮连续从fastq文件的子集。迭代流,最终将产生整个文件,在下面的例子是一个简短的插图。


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


## FastqFile and FastqFileList
FastqFile(con, ...)
FastqFileList(...)
## S3 method for class 'ShortReadFile'
open(con, ...)
## S3 method for class 'ShortReadFile'
close(con, ...)
## S4 method for signature 'FastqFile'
readFastq(dirPath, pattern=character(), ...)

## FastqSampler and FastqStreamer
FastqSampler(con, n=1e6, readerBlockSize=1e8, verbose=FALSE)
FastqStreamer(con, n=1e6, readerBlockSize=1e8, verbose=FALSE)
yield(x, ...)



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

参数:con, dirPath
A character string naming a connection, or (for con) an R connection (e.g., file, gzfile).
一个字符串,命名连接,或(con)的R连接(例如,file,gzfile)。


参数:n
The size of the sample (number of records) to be drawn.
要绘制的样本大小(记录数)。


参数:readerBlockSize
The number of bytes or characters to be read at one time; smaller readerBlockSize reduces memory requirements but is less efficient.
字节或字符数要读一次;小readerBlockSize降低内存需求,但效率较低。


参数:verbose
Display progress.
显示进度。


参数:x
An instance from the FastqSampler or FastqStreamer class.
FastqSampler或FastqStreamer类的实例。


参数:...
Additional arguments. For FastqFileList, this can either be a single character vector of paths to fastq files, or several instances of FastqFile objects.
额外的参数。 FastqFileList,这可以是一个单个字符fastq文件,或FastqFile对象的多个实例的路径向量。


参数:pattern
Ignored.
忽略。


类的对象----------Objects from the class----------

Available classes include:
可用的类别包括:




FastqFile A file path and connection to a fastq file.
FastqFile文件路径和连接到fastq文件。




FastqFileList A list of FastqFile instances.
FastqFileList的FastqFile实例列表。




FastqSampler Uniformly sample records from a fastq
FastqSampler一致样品从fastq记录




FastqStreamer Iterate over a fastq file, returning
FastqStreamer迭代超过fastq文件的,返回


方法----------Methods----------

The following methods are available to users:
用户可用下列方法:




readFastq,FastqFile-method: see also
readFastq,FastqFile-method:又见




writeFastq,ShortReadQ,FastqFile-method: see also ?writeFastq,
writeFastq,ShortReadQ,FastqFile-method:又见?writeFastq




yield: Draw a single sample from the instance. Operationally this requires that the underlying data (e.g., file) represented by the Sampler instance be
yield从实例:绘制单一样本。运作,这要求Sampler实例为代表的底层数据(例如,文件)


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

readFastq, writeFastq, yield.
readFastq,writeFastq,yield。


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


sp <- SolexaPath(system.file('extdata', package='ShortRead'))
fl <- file.path(analysisPath(sp), "s_1_sequence.txt")

f <- FastqFile(fl)
rfq <- readFastq(f)

f <- FastqSampler(fl, 50)
yield(f)    # sample of size n=50[样本大小n = 50]
yield(f)    # independent sample of size 50[独立样本的大小50]

f <- FastqStreamer(fl, 50)
yield(f)    # records 1 to 50[记录1到50]
yield(f)    # records 51 to 100[记录51到100]

## iterating over an entire file[#遍历整个文件]
f <- FastqStreamer(fl, 50)
while (length(fq <- yield(f))) {
    ## do work here[#在这里工作]
    print(length(fq))
}

## Internal fields, methods, and help; for developers[#内部字段,方法,并帮助开发人员]
ShortRead:::.FastqSampler_g$methods()
ShortRead:::.FastqSampler_g$fields()
ShortRead:::.FastqSampler_g$help("yield")


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 11:02 , Processed in 0.020616 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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