You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If the BaseSimilarity.matrix method is given two lists of spectrum objects which all have resulting scores of 0, and the array_type is set to "numpy", the indexing of the numpy score_array produces an error. When array_type is set to "sparse" no error is produced.
To Reproduce
Steps to reproduce the behavior:
Provide the BaseSimilarity.matrix method with two sets of spectra with no matching ions using the default array_type parameter.
Expected behavior
Output should give a numpy array with all zeros in the shape of the score_array.
Screenshots
Desktop (please complete the following information):
OS: cray_shasta_c
Version: 5.14.21-150400.24.81_12.0.87
Additional context
Looking at the source code, this seems to be caused from the BaseSimilarity.keep_score method filtering all scores resulting in the idx_row and idx_col lists remaining empty; which causes an error when they are used to index the score_array. Maybe bypass the keep_score method when the array_type == "numpy"?
Please let me know if any additional information is required. Thanks all for building and maintaining MatchMS! It is a great resource for the metabolomics community.
The text was updated successfully, but these errors were encountered:
Describe the bug
If the BaseSimilarity.matrix method is given two lists of spectrum objects which all have resulting scores of 0, and the array_type is set to "numpy", the indexing of the numpy score_array produces an error. When array_type is set to "sparse" no error is produced.
To Reproduce
Steps to reproduce the behavior:
Provide the BaseSimilarity.matrix method with two sets of spectra with no matching ions using the default array_type parameter.
Expected behavior
Output should give a numpy array with all zeros in the shape of the score_array.
Screenshots
Desktop (please complete the following information):
Additional context
Looking at the source code, this seems to be caused from the BaseSimilarity.keep_score method filtering all scores resulting in the idx_row and idx_col lists remaining empty; which causes an error when they are used to index the score_array. Maybe bypass the keep_score method when the array_type == "numpy"?
Please let me know if any additional information is required. Thanks all for building and maintaining MatchMS! It is a great resource for the metabolomics community.
The text was updated successfully, but these errors were encountered: