<p>Hello!
I obtained a list of unmapped reads IDs from my BAM file and I want to remap only the unmapped reads with other parameters.
How can I extract the subset of unmapped reads from my original fastq file?
Thank you in advance,
Luke</p>

I also wrote a program for this purpose, distributed with [BBMap][1]. Usage:

    filterbyname.sh in=reads.fq out=filtered.fq names=names.txt include=t

The `include` flag will toggle between including or excluding the names in `names.txt` (which can, alternately, be another fastq or fasta file). This also supports paired input/output, and names being substrings or superstrings of read IDs.

 [1]: https://sourceforge.net/projects/bbmap/