fastx_toolkitzcat -f '$input' | fastq_quality_filter -q $quality -p $percent -v -o $output
**What it does**
This tool filters reads based on quality scores.
.. class:: infomark
Using **percent = 100** requires all cycles of all reads to be at least the quality cut-off value.
.. class:: infomark
Using **percent = 50** requires the median quality of the cycles (in each read) to be at least the quality cut-off value.
--------
Quality score distribution (of all cycles) is calculated for each read. If it is lower than the quality cut-off value - the read is discarded.
**Example**::
@CSHL_4_FC042AGOOII:1:2:214:584
GACAATAAAC
+CSHL_4_FC042AGOOII:1:2:214:584
30 30 30 30 30 30 30 30 20 10
Using **percent = 50** and **cut-off = 30** - This read will not be discarded (the median quality is higher than 30).
Using **percent = 90** and **cut-off = 30** - This read will be discarded (90% of the cycles do no have quality equal to / higher than 30).
Using **percent = 100** and **cut-off = 20** - This read will be discarded (not all cycles have quality equal to / higher than 20).
------
This tool is based on `FASTX-toolkit`__ by Assaf Gordon.
.. __: http://hannonlab.cshl.edu/fastx_toolkit/