-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
iterate ONLY over the unmapped reads #424
Comments
Good question, but I don't think there is, other than iterating over the complete file and filtering by 'unmapped' flag. The problem, I believe, is that unmapped reads can have a contig assigned to them, or not. Thus, unmapped reads might appear in several locations in a sorted BAM and not as a contiguous block. |
In my case all unmapped alignments are not assigned to any contig. Still no better way than just iterate over whole file? |
Same feature request - adding a way to iterate only over the unmapped read pairs at the end of a cram file (ie. those with ref seq id = -1 in the cram index). |
Have you tried the documented way of doing this, which uses the same syntax as the underlying samtools queries: AlignmentFile.fetch('*') |
Wow, thanks! That's exactly what I was looking for! The top google hits currently talk about doing this using |
The default fetch() *does* return unmapped reads that have been placed alongside their mapped mates. Add note about using fetch("*") to return only unplaced unmapped reads. Fixes #424.
Is there a way to iterate ONLY over the unmapped reads?
Thanks,
Serghei
The text was updated successfully, but these errors were encountered: