Mercurial > repos > recetox > matchms_remove_key
annotate matchms_remove_key.xml @ 0:ea891750acfc draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
author | recetox |
---|---|
date | Mon, 04 Dec 2023 19:17:25 +0000 |
parents | |
children | 8a8a58be3929 |
rev | line source |
---|---|
0
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
1 <tool id="matchms_remove_key" name="matchms remove key" version="@TOOL_VERSION@+galaxy0" profile="21.09"> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
2 <description>Remove metadata entry for all spectra in a library</description> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
3 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
4 <macros> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
5 <import>macros.xml</import> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
6 <import>help.xml</import> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
7 </macros> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
8 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
9 <expand macro="creator"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
10 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
11 <edam_operations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
12 <edam_operation>operation_3695</edam_operation> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
13 </edam_operations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
14 <expand macro="bio.tools"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
15 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
16 <requirements> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
17 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
18 </requirements> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
19 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
20 <command detect_errors='aggressive'><![CDATA[ |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
21 python3 '${matchms_python_cli}' |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
22 ]]></command> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
23 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
24 <configfiles> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
25 <configfile name="matchms_python_cli"> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
26 import matchms |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
27 @init_logger@ |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
28 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
29 matchms.Metadata.set_key_replacements({}) |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
30 key = "${key}".lower() |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
31 spectra = list(matchms.importing.load_from_msp("${spectral_library}", metadata_harmonization = "False")) |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
32 new_spectra = [] |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
33 for spectrum in spectra: |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
34 if spectrum.get(key) is not None: |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
35 metadata = spectrum.metadata |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
36 del metadata[key] |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
37 spectrum.metadata = metadata |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
38 new_spectra.append(spectrum) |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
39 matchms.exporting.save_as_msp(new_spectra, "${output}") |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
40 </configfile> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
41 </configfiles> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
42 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
43 <inputs> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
44 <param label="Spectra file" name="spectral_library" type="data" format="msp" |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
45 help="Mass spectral library file to add key." /> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
46 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
47 <param label="Attribute Name" name="key" type="text" value="" help="Name of the attribute which will be removed from all spectra records in the MSP." /> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
48 </inputs> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
49 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
50 <outputs> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
51 <data label="${tool.name} on ${on_string}" name="output" format="msp"> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
52 </data> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
53 </outputs> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
54 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
55 <tests> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
56 <test> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
57 <param name="spectral_library" value="filtering/input.msp" ftype="msp"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
58 <param name="key" value="ionmode"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
59 <output name="output" file="out_matchms_remove_key.msp" ftype="msp" compare="sim_size"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
60 </test> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
61 </tests> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
62 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
63 <help><![CDATA[ |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
64 Description |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
65 The tool take MSP file as an input and take as parameters the name of the |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
66 attribute which will be removed from all spectra records in the MSP. |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
67 ]]></help> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
68 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
69 <citations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
70 <citation type="doi">10.5281/zenodo.6035335</citation> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
71 </citations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
72 </tool> |