EnquistLab / TNRSweb

TNRS UI
http://tnrs.biendata.org
MIT License
0 stars 1 forks source link

"Best_match_overall_score" in "All matches" download is incorrect if best match setting "Sort by Higher Taxonomy" used #121

Closed ojalaquellueva closed 3 months ago

ojalaquellueva commented 4 months ago

If user applies best match setting, the values of "Best_match_overall_score" are changed to incorrect values in the downloaded results for "All matches". For some reason, they are altered to match the values of "Best_match_highertaxa". This should not be happening, as the values of both fields should be calculated only once, when the results JSON is first prepared. There is no reason to change them: Best_match_highertaxa always equals 1 where Overall_score_order=1, else 0. Best_match_highertaxa always equals 1 where Highertaxa_score_order=1. This relationship never changes; they do not need to be re-calculated when the user selects "Sort by Higher Taxonomy".

ojalaquellueva commented 4 months ago

To replicate, submit the following names:

Helotiaceae Diplothrix juniperifolia Campyliaceae Warnstorfia trichophylla (Warnst. ) Tuom. & T. J. Kop.

Resolve using default settings. Lower match threshold to 0 and chose "Yes". Download the names, checking option "All matches". Note that Best_match_overall_score and Best_match_highertaxa are both correct. Also, the rows in the downloaded file are sorted by "ID ASC, Overall_score_order ASC", which is correct for "Sort by Overall Score" (the default setting).

Next, keeping the match threshold at 0, apply best match option "Sort by Higher Taxonomy", chose "Yes", and download the results for "All matches". Note that Best_match_overall_score is now wrong; it has incorrectly been reset to be the same as Best_match_highertaxa. (The sort order is also now incorrect for Sort by Higher Taxonomy).

ojalaquellueva commented 4 months ago

This is related to issue #114 and may have the same cause.