From 24e1cac5366410ca378bc8a149d2b92bedb2def2 Mon Sep 17 00:00:00 2001 From: hechth Date: Mon, 4 Dec 2023 19:49:08 +0100 Subject: [PATCH] changed test to sim size --- tools/matchms/matchms_remove_key.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/matchms/matchms_remove_key.xml b/tools/matchms/matchms_remove_key.xml index 95bb1c05..354fc916 100644 --- a/tools/matchms/matchms_remove_key.xml +++ b/tools/matchms/matchms_remove_key.xml @@ -31,12 +31,11 @@ key = "${key}".lower() spectra = list(matchms.importing.load_from_msp("${spectral_library}", metadata_harmonization = "False")) new_spectra = [] for spectrum in spectra: - new_spectrum = spectrum.clone() - if new_spectrum.get(key) is not None: - metadata = new_spectrum.metadata + if spectrum.get(key) is not None: + metadata = spectrum.metadata del metadata[key] - new_spectrum.metadata = metadata - new_spectra.append(new_spectrum) + spectrum.metadata = metadata + new_spectra.append(spectrum) matchms.exporting.save_as_msp(new_spectra, "${output}") @@ -57,7 +56,7 @@ matchms.exporting.save_as_msp(new_spectra, "${output}") - +