Mercurial > repos > recetox > matchms_remove_key
annotate matchms_remove_key.xml @ 9:19367db5cf3c draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 2abca9206b76bf42e6322d751ed3a31a6cc003a4
author | recetox |
---|---|
date | Tue, 04 Jun 2024 07:12:51 +0000 |
parents | 8c98b3cb320e |
children |
rev | line source |
---|---|
8
8c98b3cb320e
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 113433b8b9790405c2c5d054aee4a29a21b77dc7
recetox
parents:
5
diff
changeset
|
1 <tool id="matchms_remove_key" name="matchms remove key" version="@TOOL_VERSION@+galaxy0" profile="21.09"> |
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"/> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
63 <param name="key" value="ionmode"/> |
5
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
64 <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
|
65 </test> |
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
66 <test> |
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
67 <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
|
68 <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
|
69 <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
|
70 </repeat> |
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
71 <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
|
72 <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
|
73 </repeat> |
8a8a58be3929
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f14275bfdc2caa760d71d307ca1803eab1adde76
recetox
parents:
0
diff
changeset
|
74 <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
|
75 </test> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
76 </tests> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
77 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
78 <help><![CDATA[ |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
79 Description |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
80 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
|
81 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
|
82 ]]></help> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
83 |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
84 <citations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
85 <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
|
86 </citations> |
ea891750acfc
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 970c7dc210faacd545c740ddae0e5e78c2cecce4
recetox
parents:
diff
changeset
|
87 </tool> |