Hi All,

I would like to ask that is there an accurate tool/script for deinterleaving fastq files? I managed a 'bam to fastq' conversion according to http://gatkforums.broadinstitute.org/discussion/2908/howto-revert-a-bam-file-to-fastq-format and I would like to deinterleave the output fastq.

Many thanks!
In terms of performance, I have yet to see any program written in Perl, Python, C++, or C outperform [this combination of shell tools][1]. Other tools may be more convenient--and often that is more than a good enough reason to use them--but if you need blistering speed then there is no substitute for native built-in commands.

To summarize, the solution (using paste and process substitution) looks something like this.

```
paste - - - - - - - - < reads-int.fq \
    | tee >(cut -f 1-4 | tr "\t" "\n" > reads-1.fq) \
    | cut -f 5-8 | tr "\t" "\n" > reads-2.fq
```

 [1]: https://gist.github.com/nathanhaigh/3521724