Skip to content

Commit

Permalink
adapted implementation with empty scores
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Sep 11, 2023
1 parent f7a9e4d commit f651323
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/matchms/matchms_spectral_similarity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,21 @@ name="${similarity_metric}_${algorithm.tolerance}_${algorithm.mz_power}_${algori

@init_scores@

#if $scores.use_scores
layer = similarity.sparse_array(
references=scores.references,
queries=scores.queries,
idx_row = scores._scores.row,
idx_col = scores._scores.col,
is_symmetric=False)

scores._scores.add_sparse_data(scores._scores.row, scores._scores.col, layer, name)
#else
scores._scores = similarity.matrix(
references=scores.references,
queries=scores.queries,
array_type="sparse",
is_symmetric=False)
#end if

scores.filter_by_range(name=name+"_matches", low=0)
scores.to_json("$similarity_scores")
Expand Down

0 comments on commit f651323

Please sign in to comment.