Skip to content

Commit

Permalink
bugfix: ZipperBams should consume any remaining mapped reads
Browse files Browse the repository at this point in the history
So that pipes do not cause failure when unread data exists in bash
strict mode
  • Loading branch information
nh13 committed Aug 17, 2023
1 parent 8d40e74 commit 663eb71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/scala/com/fulcrumgenomics/bam/ZipperBams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ class ZipperBams
}
}

// There really should be no more reads, but lets continue on if so
if (mappedIter.hasNext) {
logger.warning("Processed all unmapped reads but mapped reads remaining, continuing")
// consume the remaining so piping in strict mode does not fail
mappedIter.foreach { _ => }
}

out.close()
unmappedSource.safelyClose()
mappedSource.safelyClose()
Expand Down

0 comments on commit 663eb71

Please sign in to comment.