-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove get_tanimoto_score_between_spectra since not needed anymore
- Loading branch information
1 parent
f041d38
commit ab1e5f9
Showing
3 changed files
with
3 additions
and
81 deletions.
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
ms2deepscore/benchmarking/calculate_scores_for_validation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +0,0 @@ | ||
from typing import List | ||
from matchms.Spectrum import Spectrum | ||
from ms2deepscore.benchmarking.CalculateScoresBetweenAllIonmodes import calculate_tanimoto_scores_unique_inchikey | ||
|
||
|
||
def get_tanimoto_score_between_spectra(spectra_1: List[Spectrum], | ||
spectra_2: List[Spectrum], | ||
fingerprint_type="daylight", | ||
nbits=2048): | ||
"""Gets the tanimoto scores between two list of spectra | ||
It is optimized by calculating the tanimoto scores only between unique fingerprints/smiles. | ||
The tanimoto scores are derived after. | ||
""" | ||
tanimoto_df = calculate_tanimoto_scores_unique_inchikey(spectra_1, spectra_2, | ||
fingerprint_type, | ||
nbits) | ||
inchikeys_1 = [spectrum.get("inchikey")[:14] for spectrum in spectra_1] | ||
inchikeys_2 = [spectrum.get("inchikey")[:14] for spectrum in spectra_2] | ||
tanimoto_scores = tanimoto_df.loc[inchikeys_1, inchikeys_2].values | ||
return tanimoto_scores | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters