najoshi/sickle — pull request #28 by kdmurray91 (2014-06-05 09:55:45+00:00)
Title: [WIP] implement a CLI option to output singles to same file as interleaved output

G'day Nik,

Firstly, thanks for an amazing tool, gets used all the time here.

However, in my (very) humble opinion, `sickle` is currently not so easy to use in the *middle* of a pipeline. If one wanted to pipe output to other commands, it would be more convenient to allow downstream commands to remove single reads, and not split the pipeline three ways at the sickle step. I've implemened a flag, `-M` or `--output-combo-only`, that allows interleaved input and output, without splitting out the bad quality single reads. They are instead replaced with a single `N`, which @vsbuffalo's `pairs` recognises as a failed read.

Basically, this patch allows one to do:

pairs join 1.fq.gz 2.fq.gz | scythe ... | sickle pe -c /dev/stdin -t sanger -M /dev/stdout |\
seqqs -i -e -p post_sickle /dev/stdin |\
pairs split -1 >(gzip >out1.fq.gz) -2 >(gzip >out2.fq.gz) -u >(gzip >singles.fq.gz)

Preliminary testing suggests that output after splitting the resulting interleaved fastq is identical to before this option was implemented. I've also `valgrind`'d it, finding no issues. I'll do some more rigorous testing over the next week, and comment & remove WIP from the title when I've finished. Release early and often, or so they say :smile:

Cheers, and thanks again for a cool tool!
Kevin