Commit 5b340f1e authored by bow's avatar bow
Browse files

Update WipeReads mate query to propagate exceptions

parent 149f43d4
...@@ -110,10 +110,14 @@ object WipeReads { ...@@ -110,10 +110,14 @@ object WipeReads {
// TODO: can we accumulate errors / exceptions instead of ignoring them? // TODO: can we accumulate errors / exceptions instead of ignoring them?
def monadicMateQuery(inBAM: SAMFileReader, rec: SAMRecord): Option[SAMRecord] = def monadicMateQuery(inBAM: SAMFileReader, rec: SAMRecord): Option[SAMRecord] =
try { // catching unpaired read here since queryMate will raise an exception if not
Some(inBAM.queryMate(rec)) if (!rec.getReadPairedFlag) {
} catch { None
case e: Exception => None } else {
inBAM.queryMate(rec) match {
case null => None
case qres @ _ => Some(qres)
}
} }
// filter function for read IDs // filter function for read IDs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment