Skip to content

Commit

Permalink
Simplify ratio and jaccard calculator calls in get_msms_hits
Browse files Browse the repository at this point in the history
  • Loading branch information
bkieft-usa committed Jul 23, 2024
1 parent 3ce2546 commit ec012f3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions metatlas/plots/dill2plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2388,12 +2388,8 @@ def get_msms_hits(metatlas_dataset: MetatlasDataset, extra_time: bool | float =
msms_hits.dropna(subset=['database', 'id'], how='all', inplace=True)

for index, row in msms_hits.iterrows():
if row['spectrum'].any() and row['query_spectrum'].any():
msms_hits.at[index, 'msms_frag_jaccard'] = sp.calc_jaccard_of_spectra(row)
msms_hits.at[index, 'msms_frag_ratio'] = sp.calc_data_to_ref_frag_ratio(row)
else:
msms_hits.at[index, 'msms_frag_jaccard'] = 0.0
msms_hits.at[index, 'msms_frag_ratio'] = 0.0
msms_hits.at[index, 'msms_frag_jaccard'] = sp.calc_jaccard_of_spectra(row)
msms_hits.at[index, 'msms_frag_ratio'] = sp.calc_data_to_ref_frag_ratio(row)

msms_hits = msms_hits[msms_hits_cols].set_index(['database', 'id', 'file_name', 'msms_scan'])

Expand Down

0 comments on commit ec012f3

Please sign in to comment.