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.