Mercurial > repos > recetox > matchms_remove_key
annotate matchms_remove_key.xml @ 13:ef233c08112e draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit a57d984a9850c1faa44b6948981eb1303881ba9c
| author | recetox |
|---|---|
| date | Thu, 14 Aug 2025 12:43:54 +0000 |
| parents | 10908b5bb7c8 |
| children |
| rev | line source |
|---|---|
|
12
10908b5bb7c8
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit bd80a813fb2f01f22eed0c874f8911ce4d00762a
recetox
parents:
8
diff
changeset
|
1 <tool id="matchms_remove_key" name="matchms remove key" version="@TOOL_VERSION@+galaxy0" profile="23.0" license="MIT"> |
|
0
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 |
|
5
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
29 |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
30 #set keys_list = ([str($k.key) for $k in $attribute_repeat]) |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
31 |
|
0
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
32 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
|
33 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
|
34 new_spectra = [] |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
35 for spectrum in spectra: |
|
5
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
36 for key in $keys_list: |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
37 key = key.lower() |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
38 if spectrum.get(key) is not None: |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
39 metadata = spectrum.metadata |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
40 del metadata[key] |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
41 spectrum.metadata = metadata |
|
0
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
42 new_spectra.append(spectrum) |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
43 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
|
44 </configfile> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
45 </configfiles> |
|
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 <inputs> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
48 <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
|
49 help="Mass spectral library file to add key." /> |
|
5
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
50 <repeat name="attribute_repeat" title="Keys to remove"> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
51 <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." /> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
52 </repeat> |
|
0
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
53 </inputs> |
|
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 <outputs> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
56 <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
|
57 </data> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
58 </outputs> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
59 |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
60 <tests> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
61 <test> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
62 <param name="spectral_library" value="filtering/input.msp" ftype="msp"/> |
|
12
10908b5bb7c8
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit bd80a813fb2f01f22eed0c874f8911ce4d00762a
recetox
parents:
8
diff
changeset
|
63 <repeat name="attribute_repeat"> |
|
10908b5bb7c8
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit bd80a813fb2f01f22eed0c874f8911ce4d00762a
recetox
parents:
8
diff
changeset
|
64 <param name="key" value="ionmode"/> |
|
10908b5bb7c8
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit bd80a813fb2f01f22eed0c874f8911ce4d00762a
recetox
parents:
8
diff
changeset
|
65 </repeat> |
|
5
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
66 <output name="output" file="remove_key/out_matchms_remove_key.msp" ftype="msp"/> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
67 </test> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
68 <test> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
69 <param name="spectral_library" value="filtering/input.msp" ftype="msp"/> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
70 <repeat name="attribute_repeat"> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
71 <param name="key" value="ionmode"/> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
72 </repeat> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
73 <repeat name="attribute_repeat"> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
74 <param name="key" value="spectrumtype"/> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
75 </repeat> |
|
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
76 <output name="output" file="remove_key/out2_matchms_remove_key.msp" ftype="msp"/> |
|
0
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
77 </test> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
78 </tests> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
79 |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
80 <help><![CDATA[ |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
81 Description |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
82 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
|
83 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
|
84 ]]></help> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
85 |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
86 <citations> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
87 <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
|
88 </citations> |
|
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
89 </tool> |
