Skip to content

Commit

Permalink
Reads were getting dropped due to bad else clause.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnothaft committed Mar 4, 2017
1 parent d00e7e2 commit e533c90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -412,10 +412,10 @@ private[read] class RealignIndels(
} else {
log.info("On " + refRegion + ", skipping realignment due to insufficient LOD improvement (" +
lodImprovement + "for consensus " + bestConsensus)
readsToClean.map(_._1) ++ realignedReads
reads
}
} else {
realignedReads
reads
}
// return all reads that we cleaned and all reads that were initially realigned
val endTime = System.nanoTime()
Expand Down
Expand Up @@ -541,4 +541,10 @@ class RealignIndelsSuite extends ADAMFunSuite {
assert(realignedStRead.getCigar === "2S5M")
assert(realignedStRead.getMismatchingPositions === "5")
}

sparkTest("if realigning a target doesn't improve the LOD, don't drop reads") {
val reads = sc.loadAlignments(testFile("NA12878.1_854950_855150.sam"))
val realignedReads = reads.realignIndels()
assert(reads.rdd.count === realignedReads.rdd.count)
}
}

0 comments on commit e533c90

Please sign in to comment.