dada2 icon indicating copy to clipboard operation
dada2 copied to clipboard

Error in add(bin) : record does not start with '@'

Open JackLI002021 opened this issue 3 years ago • 6 comments

Dear,

When I use filterAndTrim to clean the gzip fastq file, I always get the error "Error in add(bin) : record does not start with '@'". I guess the error is related to ShortRead but I don't know how to solve it. Could you help me with the problem?

The dada2 version is 1.20. The operation system is Win10.

Thanks in advance!

JackLI002021 avatar Oct 14 '21 20:10 JackLI002021

Do you get this error with the following?

library(ShortRead)
fn <- "path/to/example.fastq.gz"
reads <- readFastq(fn)

If that gives the same error, I'd start by gunzipping one of the fastq files, and just looking at the first few lines (e.g. head -n8 example.fastq in the shell). Do they look like proper fastq format?

benjjneb avatar Oct 15 '21 21:10 benjjneb

Dear benjjneb,

I also encountered the same problem yesterday. In order to check the filtered fastq files, I entered the code as you say and there's no error information. Then I opened file with Notepad and I found the record start with '@' so the fastq format is correct. The screenshot is below.

QQ截图20211109150353 QQ截图20211109151437

I hope my feedback can help you solve the problem.

M1chibata avatar Nov 09 '21 07:11 M1chibata

@M1chibata To troubleshoot this you'll want to isolate a single fastq file (rather than a collection) that might be causing this issue. That is, for what single file fn does readFastq(fn) work and learnErrors (or equivalently and much faster derepFastq) fail?

In your case, you might want to look if any of the samples failed filtering, i.e. had zero reads pass the filter. If there are any such, you need to remove them from filtFs/filtRs before proceeding to denoising.

benjjneb avatar Nov 09 '21 15:11 benjjneb

@benjjneb I moved the fastq files to another path and the pipeline runned normally. This problem may caused by invalid path name with Chinese or other non-English characters. Thanks a lot!

M1chibata avatar Nov 10 '21 02:11 M1chibata

This problem may caused by invalid path name with Chinese or other non-English characters Yes,i invalid

LuyangSong avatar Sep 07 '22 02:09 LuyangSong

This problem may caused by invalid path name with Chinese or other non-English characters Yes,i invalid

Indeed. The parent directory includes Chinese characters after changing to English letters, the problem is solved.

li081766 avatar Sep 07 '22 20:09 li081766