Skip to content

Commit

Permalink
Merge branch 'fix-expl-intensity-for-resolved-adducts' into 'stable'
Browse files Browse the repository at this point in the history
Fix expl intensity and SIRIUS score  for resolved adducts

See merge request bioinf-mit/ms/sirius_frontend!14
  • Loading branch information
mfleisch committed Oct 14, 2021
2 parents 7281794 + f581ce8 commit 2c5ef22
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,17 @@ protected void computeAndAnnotateResult(final @NotNull Instance inst) throws Exc
addedResults.forEach((k, v) ->
inst.newFormulaResultWithUniqueId(k.getTree())
.ifPresent(fr -> {
fr.getAnnotationOrThrow(FormulaScoring.class).setAnnotationsFrom(
formulaResultsMap.get(v.getTree()).getAnnotationOrThrow(FormulaScoring.class));
// fr.getAnnotationOrThrow(FormulaScoring.class).setAnnotationsFrom(
// formulaResultsMap.get(v.getTree()).getAnnotationOrThrow(FormulaScoring.class));
//do not override but only set missing scores (may have different tree/SIRIUS score)
FormulaScoring formulaScoring = fr.getAnnotationOrThrow(FormulaScoring.class);
final Iterator<Map.Entry<Class<FormulaScore>, FormulaScore>> iter = formulaResultsMap.get(v.getTree()).getAnnotationOrThrow(FormulaScoring.class).annotationIterator();
while (iter.hasNext()) {
final Map.Entry<Class<FormulaScore>, FormulaScore> e = iter.next();
if (!formulaScoring.hasAnnotation(e.getKey())){
formulaScoring.setAnnotation(e.getKey(), e.getValue());
}
}
inst.updateFormulaResult(fr, FormulaScoring.class);

formulaResultsMap.put(fr.getAnnotationOrThrow(FTree.class), fr);
Expand Down

0 comments on commit 2c5ef22

Please sign in to comment.