Tuesday, August 6, 2013

Trimming FastQ reads with FastX : Sanger quality

Well, this is something simple and stupid.

We just want to trim 20 nucleotides from the right end of the read. There is a FastX toolkit designed for this kind of tasks. Running a very simple command:

fastx_trimmer -t 20 -i reads.fq -o reads.trimmed.fq


But suddenly this error occurs:

fastx_trimmer: Invalid quality score value (char ',' ord 44 quality value -20) on line 20


Whatta?? Ok, the problem is with the quality encoding. There is a magic parameter -Q which allows to set the offset for quality values and by some reason it is not described in the documentation of FastX.

Here is a working command:

fastx_trimmer -Q33 -t 20 -i reads.fq -o reads.trimmed.fq


Thanks to my supervisor and this thread for help.


2 comments:

Unknown said...

Hi. I also encountered this error and I used the -Q33. But still I got this:

fastx_trimmer: Error: invalid quality score data on line 4209592 (quality_tok = "@@CFFDFFFFFDFGEIGBFHHIEECGGFG"

Do you have an idea how to troubleshoot this?

Thanks,
Venice Juanillas

Jacobo said...

I know its a very old post but:

I think its because the LAST line of the file is trying to read it as a quality score, but it should only be a problem with the very last line in the file