Skip to content

Commit

Permalink
changed test to sim size
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Dec 4, 2023
1 parent 321ae24 commit 24e1cac
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/matchms/matchms_remove_key.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
</configfile>
</configfiles>
Expand All @@ -57,7 +56,7 @@ matchms.exporting.save_as_msp(new_spectra, "${output}")
<test>
<param name="spectral_library" value="filtering/input.msp" ftype="msp"/>
<param name="key" value="ionmode"/>
<output name="output" file="out_matchms_remove_key.msp" ftype="msp"/>
<output name="output" file="out_matchms_remove_key.msp" ftype="msp" compare="sim_size"/>
</test>
</tests>

Expand Down

0 comments on commit 24e1cac

Please sign in to comment.