Hi all,
I don't understand why I'm getting this error, when using ShortRead package' s FastqStreamerList function.
My code:
fql<-FastqStreamerList(c("a.fastq.gz", "b.fastq.gz"), n=1e6) while(length(object <- yield(fql))) { writeFastq(object, "pooled.fastq.gz", "a", compress=TRUE) } Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘yield’ for signature ‘"FastqStreamerList"’
It says that "FastqStreamerList" its not inherited method for "yield" function whereas, in ShortRead's Vignette "FastqStreamerList" usage is described like this:
## FastqSampler and FastqStreamer FastqSampler(con, n=1e6, readerBlockSize=1e8, verbose=FALSE,ordered = FALSE) FastqSamplerList(..., n=1e6, readerBlockSize=1e8, verbose=FALSE,ordered = FALSE) FastqStreamer(con, n, readerBlockSize=1e8, verbose=FALSE) FastqStreamerList(..., n, readerBlockSize=1e8, verbose=FALSE) yield(x, ...)
So where is the problem?
> sessionInfo() R version 3.2.2 (2015-08-14) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.3 LTS locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=lt_LT.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=lt_LT.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=lt_LT.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=lt_LT.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets methods base other attached packages: [1] ShortRead_1.26.0 GenomicAlignments_1.4.1 Rsamtools_1.20.4 GenomicRanges_1.20.5 GenomeInfoDb_1.4.2 [6] Biostrings_2.36.3 XVector_0.8.0 IRanges_2.2.7 S4Vectors_0.6.3 BiocParallel_1.2.20 [11] BiocGenerics_0.14.0 loaded via a namespace (and not attached): [1] lattice_0.20-33 bitops_1.0-6 grid_3.2.2 futile.options_1.0.0 zlibbioc_1.14.0 hwriter_1.3.2 [7] latticeExtra_0.6-26 futile.logger_1.4.1 RColorBrewer_1.1-2 lambda.r_1.1.7 tools_3.2.2 Biobase_2.28.0
Thank you for help, Martin! Yes, I was trying to concatenate .fasta.gz files. Usually I'm using this code:
fq<-readFastq(c("a.fastq.gz", "b.fastq.gz"))
writeFastq(fq, "pooled.fastq.gz", mode="a", compress=TRUE)
It works fine but it takes a lot of time to concatenate some files, so I was looking for better option to do this using R.