Skip to content

Commit

Permalink
Fixed a rare edge case in the AdaptiveChainPruner where the JavaPrior…
Browse files Browse the repository at this point in the history
…ityQueue is undefined for tied elements (#7851)
  • Loading branch information
jamesemery committed May 19, 2022
1 parent 752ee3c commit 6c6db6e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private Collection<Path<V,E>> likelyErrorChains(final List<Path<V, E>> chains, f
// Note that chains can we added twice to the queue, once for each side
final PriorityQueue<Pair<Path<V,E>, Double>> chainsToAdd = new PriorityQueue<>(
Comparator.comparingDouble((Pair<Path<V,E>, Double> p) -> -p.getRight())
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR));
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR)
.thenComparing((Pair<Path<V,E>, Double> p) -> p.getLeft().getBases(), BaseUtils.BASES_COMPARATOR)); // Handle rare edge case for non-determinism where two chains with equivalent score start on the same vertex

// seed the subgraph of good chains by starting with some definitely-good chains. These include the max-weight chain
// and chains emanating from vertices with two incoming or two outgoing chains (plus one outgoing or incoming for a total of 3 or more) with good log odds
Expand Down

0 comments on commit 6c6db6e

Please sign in to comment.