From 6c6db6e50f7e914af5cd59b1de1e9b196640ccdf Mon Sep 17 00:00:00 2001 From: jamesemery Date: Thu, 19 May 2022 14:06:04 -0400 Subject: [PATCH] Fixed a rare edge case in the AdaptiveChainPruner where the JavaPriorityQueue is undefined for tied elements (#7851) --- .../walkers/haplotypecaller/graphs/AdaptiveChainPruner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/AdaptiveChainPruner.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/AdaptiveChainPruner.java index 1947a77b632..72f5ae77508 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/AdaptiveChainPruner.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/graphs/AdaptiveChainPruner.java @@ -78,7 +78,8 @@ private Collection> likelyErrorChains(final List> chains, f // Note that chains can we added twice to the queue, once for each side final PriorityQueue, Double>> chainsToAdd = new PriorityQueue<>( Comparator.comparingDouble((Pair, Double> p) -> -p.getRight()) - .thenComparing((Pair, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR)); + .thenComparing((Pair, Double> p) -> p.getLeft().getFirstVertex().getSequence(), BaseUtils.BASES_COMPARATOR) + .thenComparing((Pair, 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