@@ -506,6 +506,7 @@ inline bool setGenotypes(const Iterator<String<Call>, Standard >::Type & start,
506506// startPositions is cleared during this process.
507507inline unsigned getStartPosition (String<unsigned > & startPositions)
508508{
509+ SEQAN_ASSERT (!empty (startPositions));
509510 std::sort (begin (startPositions), end (startPositions));
510511 unsigned start = startPositions[length (startPositions) / 2 ];
511512 clear (startPositions);
@@ -518,6 +519,7 @@ inline unsigned getStartPosition(String<unsigned> & startPositions)
518519// sizeEstimates is cleared during this process.
519520inline unsigned getDeletionLength (String<unsigned > & sizeEstimates)
520521{
522+ SEQAN_ASSERT (!empty (sizeEstimates));
521523 std::sort (begin (sizeEstimates), end (sizeEstimates));
522524 unsigned len = sizeEstimates[length (sizeEstimates) / 2 ];
523525 clear (sizeEstimates);
@@ -610,13 +612,15 @@ inline bool unifyCalls(String<Call> & calls, const double & stddev, const double
610612
611613 if (it == last)
612614 {
613- mergeWindowRange (currentIt, it, lads, dads, genotypes, startPositions, sizeEstimates, lr, callCount, winCount, significantWindows, r);
615+ if (!empty (startPositions))
616+ mergeWindowRange (currentIt, it, lads, dads, genotypes, startPositions, sizeEstimates, lr, callCount, winCount, significantWindows, r);
617+
614618 break ;
615619 }
616620 }
617621 else
618622 {
619- if (winCount != 1 )
623+ if (winCount != 1 && ! empty (startPositions) )
620624 mergeWindowRange (currentIt, it, lads, dads, genotypes, startPositions, sizeEstimates, lr, callCount, winCount, significantWindows, r);
621625 else
622626 markInvalidCall (*currentIt);
0 commit comments