Skip to content

Commit

Permalink
bugfix: ZipperBams should fail if there any remaining mapped reads (#929
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nh13 authored Aug 18, 2023
1 parent 8d40e74 commit bcb5577
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/scala/com/fulcrumgenomics/bam/ZipperBams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@ class ZipperBams
}

out.close()

// There really should be no more mapped reads!
if (mappedIter.hasNext) {
throw new IllegalStateException(
"""Error: processed all unmapped reads but there are mapped reads remaining to be read.
|Please ensure the unmapped and mapped reads have the same set of read names in the same
|order, and reads with the same name are consecutive (grouped) in each input""".stripMargin
)
}

unmappedSource.safelyClose()
mappedSource.safelyClose()
}
Expand Down

0 comments on commit bcb5577

Please sign in to comment.