Does anyone have any experience extracting unmapped reads from BAM files and converting them back to fastq format using Rsamtools? If you could provide some generic code to address this problem it would be greatly appreciated.
I am mapping C. elegans RNA library against E. coli genome to remove contamination. I would like to obtain the unmapped reads to then map against C. elegans genome for DGE.
PS. These are unpaired reads