Another corner condition fix: skip likelihood computation in case we cut so many bases there's no haplotype or read left

This commit is contained in:
Guillermo del Angel 2011-11-22 22:46:12 -05:00
parent 32a77a8a56
commit 75d93e6335
1 changed files with 4 additions and 1 deletions

View File

@ -556,8 +556,11 @@ public class PairHMMIndelErrorModel {
long indStart = start - haplotype.getStartPosition();
long indStop = stop - haplotype.getStartPosition();
double readLikelihood;
if (DEBUG)
System.out.format("indStart: %d indStop: %d WinStart:%d WinStop:%d start: %d stop: %d readLength: %d C:%s\n",
indStart, indStop, ref.getWindow().getStart(), ref.getWindow().getStop(), start, stop, read.getReadLength(), read.getCigar().toString());
if (indStart < 0 || indStop >= haplotype.getBasesAsBytes().length) {
if (indStart < 0 || indStop >= haplotype.getBasesAsBytes().length || indStart > indStop) {
// read spanned more than allowed reference context: we currently can't deal with this
readLikelihood =0;
} else