This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error while using the Cutadapt 2.6 ouput fastq file as input for alignment Rsubread

I have cut the 3`adapters from my RNA-Seq sequences with cutadapt 2.6 and when loading the trimmed sequences for alignment in Rsubread, program is aborted after several lines with the "ERROR: a format issue @ is found on the 393884-th line in input file".

I did not find anything about this issue in any of the manuals for either cutadapt or Rsubread. I am also quiet new to this, so don´t know if I did not just overlooked something obvious...

Would anyone know how to proceed further, please?

rna-seq software error alignment

Output of head -n 393884 your.fastq | tail?

Did not work for some reason, so I tried in R:

x <- scan('my.fastq', '', skip = 393884, nlines = 1, sep = '\n')

Read 1 item

x

[1] "@7001425F:195:CDYHMANXX:3:1102:19436:35854 1:N:0:CACTCA"

Can you show a few lines before and after than. The issue is probably somewhere there.

It seems there is missing line, for some reason:

 x <- scan('file.fastq', '', skip = 393870, nlines = 20, sep = '\n')

Read 18 items

   x



[1] "+"                                                      
 [2] "BBBBBF/FFB///<FBFB/<FFB<B</<BB//FBFF<FFFF<FF<F/F/FBF///"
 [3] "@7001425F:195:CDYHMANXX:3:1102:19146:35958 1:N:0:CACTCA"
 [4] "CGTCCTCGCCCGCGCGAATGCGGCCCAGCTTGTTGAGCAAGGCAACGGCCGCCGT"
 [5] "+"                                                      
 [6] "BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
 [7] "@7001425F:195:CDYHMANXX:3:1102:19288:35764 1:N:0:CACTCA"
 [8] "CTTCGCGATCGATGTCGATGGTGCGCAGCAGTTCGCGCACGGCCTCGGCGCCCAT"
 [9] "+"                                                      
[10] "BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
[11] "@7001425F:195:CDYHMANXX:3:1102:19414:35790 1:N:0:CACTCA"

**[12]"+"                                                      
[13] "@7001425F:195:CDYHMANXX:3:1102:19436:35854 1:N:0:CACTCA"
[14] "CGGGCTGCTGCACGCCGCGCAGGATGCCGTTGAGAGCCCCGGTCAGCAAGGAAGT"**

[15] "+"                                                      
[16] "BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
[17] "@7001425F:195:CDYHMANXX:3:1102:19382:35879 1:N:0:CACTCA"
[18] "GGCAGTTTCTTAAGAGCGTCGATGTCGTAGGCATTCTGCAACGAGCCCGCGCCTT"

Yes, the file is corrupted as for "@7001425F:195:CDYHMANXX:3:1102:19414:35790 1:N:0:CACTCA" two lines are missing. Consider to use e.g. repair.sh from BBmap to try and fix the file, discarding the corrupted part.

Thank you for your help. But as this is becoming far too "black box" for me and as there is only small fraction of sequences with adapters, I´ll probably try to go for alignment without trimming. Or try different tool to cut the adapter. Is it legitimate?

Filtering all the reads (minimal length was set to 10) solved the issue!

Thank you all for your help!

I moved @cpad0112's comment to an answer. Since it worked in your case you can accept the answer to provide closure to this thread.

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Upvote|Bookmark|Accept

2 answers

My suspicion is that cutadapt trimmed entire sequence (and corresponding quality values) based on trimming parameters . From the trimmed reads, filter all the reads with sequence length <1 or use some minimum length to retain during trimming (for eg. -m for cutadapt) @ kubano

This is worth of trying, thank you!

@ kubano try with seqkit to check for records/reads with no sequences:

$ seqkit seq -M 0 <input.fastq/fastq.gz>

to count the reads without sequences, try:

$ seqkit seq -M 0 <input.fastq/fastq.gz> | seqkit stats

Column with number of sequences would list the number of reads

Kudos to Marcel M (developer of Cutadapt) for addressing this issue after quoting biostars post and same issue raised by another user on github.

https://github.com/marcelm/cutadapt/issues/428

(pardon me for making this as a separate comment to the issue)

Log in to answer this question.