comparison matchms_convert.xml @ 3:4216e42a5534 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit f79a5b51599254817727bc9028b9797ea994cb4e
author recetox
date Tue, 27 Jun 2023 14:21:13 +0000
parents 8c3433c6b39c
children
comparison
equal deleted inserted replaced
2:8c3433c6b39c 3:4216e42a5534
1 <tool id="matchms_convert" name="matchms convert" version="0.19.0+galaxy0" profile="21.05"> 1 <tool id="matchms_convert" name="matchms convert" version="@TOOL_VERSION@+galaxy0" profile="21.05">
2 <description>convert between mass spectral library formats using matchms</description> 2 <description>convert between mass spectral library formats (.mgf/.msp/.json) using matchms</description>
3
3 <macros> 4 <macros>
4 <import>macros.xml</import> 5 <import>macros.xml</import>
6 <import>help.xml</import>
5 </macros> 7 </macros>
8
6 <expand macro="creator"/> 9 <expand macro="creator"/>
10
11 <edam_operations>
12 <edam_operation>operation_3434</edam_operation>
13 </edam_operations>
14 <expand macro="bio.tools"/>
15
7 <requirements> 16 <requirements>
8 <requirement type="package" version="0.19.0">matchms</requirement> 17 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
9 </requirements> 18 </requirements>
10 19
11 <command detect_errors='aggressive'><![CDATA[ 20 <command detect_errors='aggressive'><![CDATA[
12 python ${matchms_python_cli} 21 python ${matchms_python_cli}
13 ]]></command> 22 ]]></command>
14 23
15 <configfiles> 24 <configfiles>
16 <configfile name="matchms_python_cli"> 25 <configfile name="matchms_python_cli">
26 @init_logger@
27
17 from matchms.importing import load_from_msp, load_from_mgf, load_from_json 28 from matchms.importing import load_from_msp, load_from_mgf, load_from_json
18 from matchms.exporting import save_as_msp, save_as_mgf, save_as_json 29 from matchms.exporting import save_as_msp, save_as_mgf, save_as_json
19 spectra = list(load_from_${spectral_library.ext}("${spectral_library}", ${harmonization_metadata})) 30 spectra = list(load_from_${spectral_library.ext}("${spectral_library}", ${harmonization_metadata}))
20 #if $output_file.output_format == "msp" 31 #if $output_file.output_format == "msp"
21 save_as_msp(spectra, "${converted_library}", write_peak_comments = ${output_file.export_peak_comments}, style = "${output_file.export_style}") 32 save_as_msp(spectra, "${converted_library}", write_peak_comments = ${output_file.export_peak_comments}, style = "${output_file.export_style}")
29 <param label="Spectra file" name="spectral_library" type="data" format="msp,mgf,json" 40 <param label="Spectra file" name="spectral_library" type="data" format="msp,mgf,json"
30 help="Mass spectral library file to convert." /> 41 help="Mass spectral library file to convert." />
31 42
32 <param label="Harmonization metadata" name="harmonization_metadata" type="boolean" truevalue="True" falsevalue="False" 43 <param label="Harmonization metadata" name="harmonization_metadata" type="boolean" truevalue="True" falsevalue="False"
33 checked="true" 44 checked="true"
34 help="Set to False if metadata harmonization to default keys is not desired. The default is True." /> 45 help="Apply metadata harmonization, parsing certain keys required by additional filters or initializing other attributes. The default is True." />
35 46
36 <conditional name="output_file"> 47 <conditional name="output_file">
37 <param label="Spectral library format" name="output_format" type="select" 48 <param label="Spectral library format" name="output_format" type="select"
38 help="Output format to convert the spectral library into."> 49 help="Output format to convert the spectral library into.">
39 <option value="msp" selected="true">msp</option> 50 <option value="msp" selected="true">msp</option>
41 <option value="json">json</option> 52 <option value="json">json</option>
42 </param> 53 </param>
43 <when value="msp"> 54 <when value="msp">
44 <param label="Export peak comments" name="export_peak_comments" type="boolean" 55 <param label="Export peak comments" name="export_peak_comments" type="boolean"
45 truevalue="True" falsevalue="False" checked="true" 56 truevalue="True" falsevalue="False" checked="true"
46 help="Writes peak comments to individual peaks after the respective mz/intensity pair when selected." /> 57 help="Retain peak comments from individual peaks after the respective mz and intensity pairs when selected." />
47 <param label="Export style" name="export_style" type="select" 58 <param label="Export style" name="export_style" type="select"
48 help="Converts the keys to required Export style. One of ['matchms', 'massbank', 'nist', 'riken', 'gnps']. Default is 'matchms'"> 59 help="Converts the keys to a specific style - see [1] for details.. One of ['matchms', 'massbank', 'nist', 'riken', 'gnps']. Default is 'matchms'.">
49 <option value="matchms" selected="true">matchms</option> 60 <option value="matchms" selected="true">matchms</option>
50 <option value="massbank">massbank</option> 61 <option value="massbank">massbank</option>
51 <option value="nist">nist</option> 62 <option value="nist">nist</option>
52 <option value="riken">riken</option> 63 <option value="riken">riken</option>
53 <option value="gnps">gnps</option> 64 <option value="gnps">gnps</option>
54 </param> 65 </param>
55 </when> 66 </when>
67 <when value="mgf" />
68 <when value="json" />
56 </conditional> 69 </conditional>
57 </inputs> 70 </inputs>
58 71
59 <outputs> 72 <outputs>
60 <data label="${tool.name} from ${spectral_library.ext} to ${output_file.output_format} on ${on_string}" name="converted_library" format="msp"> 73 <data label="${tool.name} from ${spectral_library.ext} to ${output_file.output_format} on ${on_string}" name="converted_library" format="msp">
104 </test> 117 </test>
105 </tests> 118 </tests>
106 119
107 120
108 <help><![CDATA[ 121 <help><![CDATA[
109 Documentation 122 Description
110 Mass spectral libraries are often stored in various formats, such as `msp`, `mgf` or `json`. 123 Mass spectral libraries are often stored in various formats, such as `msp`, `mgf` or `json`.
111 This tool can be used to convert from one library format to another. 124 This tool can be used to convert from one library format to another.
125 Some of the metadata keywords might change during the conversion process, as they are harmonized internally with matchms.
112 126
113 Please note that peak comments in `RIKEN` style `msp` files are lost upon conversion. 127 .. rubric:: **Footnotes**
114 Additionally, some of the metadata keywords might change during the conversion process, as they are harmonized internally with matchms. 128 .. [1] Export styles - see this `table <https://github.com/matchms/matchms/blob/master/matchms/data/export_key_conversions.csv>`_ for supported key conversions and detailed description of the export styles.
115 129
116 For more documentation on the matchms library see https://github.com/matchms/matchms/blob/master/README.rst and https://matchms.readthedocs.io/en/latest/. 130 @HELP_matchms@
117 ]]></help> 131 ]]></help>
118 132
119 133
120 <expand macro="citations"/> 134 <expand macro="citations"/>
121 </tool> 135 </tool>