Skip to content

Commit

Permalink
Add check minimum len of 0 in calculate_tanimoto_scores.py
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdejonge committed Jun 24, 2024
1 parent 8a74aea commit 6c260d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ms2query/create_new_library/calculate_tanimoto_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_fingerprint(smiles: str):
def calculate_tanimoto_scores_from_smiles(list_of_smiles_1: List[str],
list_of_smiles_2: List[str]) -> np.ndarray:
"""Returns a 2d ndarray containing the tanimoto scores between the smiles"""
assert len(list_of_smiles_1) > 0 and len(list_of_smiles_2) > 0
fingerprints_1 = np.array([get_fingerprint(spectrum) for spectrum in tqdm(list_of_smiles_1,
desc="Calculating fingerprints")])
fingerprints_2 = np.array([get_fingerprint(spectrum) for spectrum in tqdm(list_of_smiles_2,
Expand Down

0 comments on commit 6c260d9

Please sign in to comment.