I've got a multi-threaded tool which opens a BAM file independently in each thread, and uses a query to extract each chromosome and process it independently. This seems to work pretty well, but I also want to process the unmapped reads which usually sort at the end of the BAM.
Is there a way to extract the region of the BAM from the index file so I can add that to the list of regions to process?
I've got a multi-threaded tool which opens a BAM file independently in each thread, and uses a query to extract each chromosome and process it independently. This seems to work pretty well, but I also want to process the unmapped reads which usually sort at the end of the BAM.
Is there a way to extract the region of the BAM from the index file so I can add that to the list of regions to process?