我想使用R的doMC包来读取fastq文件,但我遇到了这个问题。
do.ply(i)出错:任务1失败 - "记录不以' @'"
开头do.ply(i)出错:任务1失败 - "内部:buf!="
我的代码是
library(ShortRead)
library(foreach)
library(doMC)
library(plyr)
fastq_file <- '../quantibio/data/SRR038848.fastq'
n_cores <- 2
registerDoMC(n_cores)
parallel <- T
if(n_cores==1) parallel <- F
n_lines <- countLines(fastq_file)
n_reads <- n_lines/4
threshold=1e5
n_chuncks <- ceiling(n_reads/threshold)
fq <- FastqStreamer(fastq_file, threshold)
chunck_out <- llply(1:n_chuncks, function(ii){
f <- yield(fq)
width_max <<- max(width(f))
# chunck_list <- .proc_chunk(f, width_max)
f
}, .parallel=parallel,
.paropts = list(.export = c('fq'), .packages=c('ShortRead', 'Biostrings') ))
close(fq)