Skip to content

Commit

Permalink
Merge branch '104-structure-candidate-sorting-is-not-consistent-betwe…
Browse files Browse the repository at this point in the history
…en-fingerblastjjob-and-fingerblastsearchjjob' into 'master'

Resolve "structure candidate sorting is not consistent between FingerBlastJjob and FingerblastSearchJJob if CSI score is equal"

Closes #104

See merge request bright-giant/sirius/sirius-libs!66
  • Loading branch information
Martin Andre Hoffmann committed May 21, 2024
2 parents c5b63bc + f1c7cc5 commit f81feaa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ protected FingerblastResult compute() throws Exception {
checkForInterruption();
scoreJobs.forEach(this::submitSubJob);
checkForInterruption();
scoredCandidates = scoreJobs.stream().flatMap(r -> r.takeResult().stream()).sorted(Comparator.reverseOrder()).map(fpc -> new Scored<>(fpc.getCandidate(), fpc.getScore())).collect(Collectors.toList());
//This sorting here needs to be consistent with the sorting everywhere else
scoredCandidates = scoreJobs.stream().flatMap(r -> r.takeResult().stream()).sorted(Comparator.<Scored<FingerprintCandidate>>reverseOrder().thenComparing((Scored<FingerprintCandidate> s) -> s.getCandidate().getInchiKey2D())).map(fpc -> new Scored<>(fpc.getCandidate(), fpc.getScore())).collect(Collectors.toList());
checkForInterruption();
scoredCandidates.forEach(sc -> postprocessCandidate(sc.getCandidate()));
checkForInterruption();
Expand Down

0 comments on commit f81feaa

Please sign in to comment.