Mercurial > repos > recetox > matchms_add_key
comparison matchms_add_key.xml @ 0:ea00a749ec1f draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
| author | recetox |
|---|---|
| date | Thu, 12 Oct 2023 13:26:04 +0000 |
| parents | |
| children | fb80536001bc |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:ea00a749ec1f |
|---|---|
| 1 <tool id="matchms_add_key" name="matchms add key" version="@TOOL_VERSION@+galaxy1" profile="21.09"> | |
| 2 <description>Set metadata key in MSP to static value</description> | |
| 3 | |
| 4 <macros> | |
| 5 <import>macros.xml</import> | |
| 6 <import>help.xml</import> | |
| 7 </macros> | |
| 8 | |
| 9 <expand macro="creator"/> | |
| 10 | |
| 11 <edam_operations> | |
| 12 <edam_operation>operation_2409</edam_operation> | |
| 13 </edam_operations> | |
| 14 <expand macro="bio.tools"/> | |
| 15 | |
| 16 <requirements> | |
| 17 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement> | |
| 18 </requirements> | |
| 19 | |
| 20 <command detect_errors='aggressive'><![CDATA[ | |
| 21 python ${matchms_python_cli} | |
| 22 ]]></command> | |
| 23 | |
| 24 <configfiles> | |
| 25 <configfile name="matchms_python_cli"> | |
| 26 @init_logger@ | |
| 27 | |
| 28 from matchms.importing import load_from_msp | |
| 29 from matchms.exporting import save_as_msp | |
| 30 spectra = list(load_from_msp("${spectral_library}", metadata_harmonization = "False")) | |
| 31 new_spectra = [] | |
| 32 for spectrum in spectra: | |
| 33 spectrum.set("${key}", "${value}") | |
| 34 new_spectra.append(spectrum) | |
| 35 save_as_msp(new_spectra, "${output}") | |
| 36 </configfile> | |
| 37 </configfiles> | |
| 38 | |
| 39 <inputs> | |
| 40 <param label="Spectra file" name="spectral_library" type="data" format="msp" | |
| 41 help="Mass spectral library file to add key." /> | |
| 42 | |
| 43 <param label="Attribute Name" name="key" type="text" value="" help="Name of the attribute which will be assigned to all spectra records in the MSP." /> | |
| 44 <param label="Value" name="value" type="text" value="" help="Value of the attribute which will be assigned to all spectra records in the MSP." /> | |
| 45 </inputs> | |
| 46 | |
| 47 <outputs> | |
| 48 <data label="${tool.name} on ${on_string}" name="output" format="msp"> | |
| 49 </data> | |
| 50 </outputs> | |
| 51 | |
| 52 <tests> | |
| 53 <test> | |
| 54 <param name="spectral_library" value="filtering/input.msp" ftype="msp"/> | |
| 55 <param name="key" value="tool_used"/> | |
| 56 <param name="value" value="matchms"/> | |
| 57 <output name="output" file="out_matchms_add_key.msp" ftype="msp"/> | |
| 58 </test> | |
| 59 </tests> | |
| 60 | |
| 61 <help><![CDATA[ | |
| 62 Description | |
| 63 The tool take MSP file as an input and take as parameters the name of the | |
| 64 attribute and its value which will be assigned to all spectra records in the MSP. | |
| 65 ]]></help> | |
| 66 | |
| 67 <citations> | |
| 68 <citation type="doi">https://doi.org/10.5281/zenodo.6035335</citation> | |
| 69 </citations> | |
| 70 </tool> |
