comparison matchms_split.xml @ 0:169c72b2ce79 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 5888b20035c9c782b7c94495b0760134f82f4c2e
author recetox
date Thu, 27 Apr 2023 12:02:44 +0000
parents
children 0cf68b536cd1
comparison
equal deleted inserted replaced
-1:000000000000 0:169c72b2ce79
1 <tool id="matchms_split" name="matchms split library" version="@TOOL_VERSION@+galaxy0" python_template_version="3.7">
2 <macros>
3 <import>macros.xml</import>
4 </macros>
5
6 <expand macro="creator"/>
7
8 <requirements>
9 <requirement type="package" version="@TOOL_VERSION@">matchms</requirement>
10 </requirements>
11
12 <command detect_errors='exit_code'><![CDATA[
13 python3 '$__tool_directory__/matchms_split.py'
14 --filename '$msp_input'
15 --method '${method.split_type}'
16 --outdir 'output'
17 #if $method.split_type == "chunk-size"
18 --parameter ${method.chunk_size}
19 #else if $method.split_type == "num-chunks"
20 --parameter ${method.num_chunks}
21 #end if
22 ]]></command>
23 <inputs>
24 <param type="data" name="msp_input" format="msp"
25 help="Spectral library (.msp) to split into smaller chunks. Requires keyword 'compound_name', 'compoundname' or 'name' to identify individual spectra using the one-per-file method."/>
26 <conditional name="method">
27 <param name="split_type" type="select" label="Splitting method" display="radio" help="Method on how to split the library.">
28 <option value="chunk-size" selected="true">Split into chunks of specified size</option>
29 <option value="num-chunks">Split into specified number of chunks</option>
30 <option value="one-per-file">Split to one spectrum per file</option>
31 </param>
32 <when value="chunk-size">
33 <param name="chunk_size" type="integer" value="1000" min="2" help="Number of spectra per output chunks."/>
34 </when>
35 <when value="num-chunks">
36 <param name="num_chunks" type="integer" value="5" min="2" help="Number of chunks into which to split the library."/>
37 </when>
38 <when value="one-per-file" />
39 </conditional>
40 </inputs>
41 <outputs>
42 <collection format="msp" name="sample" type="list">
43 <discover_datasets pattern="__designation_and_ext__" ext="msp" directory="output"/>
44 </collection >
45 </outputs>
46 <tests>
47 <test>
48 <param name="msp_input" value="split/sample_input.msp" />
49 <param name="split_type" value="one-per-file" />
50 <output_collection name="sample" type="list">
51 <element name="1NITROPYRENE" file="split/one-per-file/1NITROPYRENE.msp" ftype="msp" compare="contains"/>
52 <element name="35DICHLOROPHENOL" file="split/one-per-file/35DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
53 <element name="34DICHLOROPHENOL" file="split/one-per-file/34DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
54 <element name="26DICHLOROPHENOL" file="split/one-per-file/26DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
55 <element name="25DICHLOROPHENOL" file="split/one-per-file/25DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
56 <element name="24DINITROPHENOL" file="split/one-per-file/24DINITROPHENOL.msp" ftype="msp" compare="contains"/>
57 <element name="24DICHLOROPHENOL" file="split/one-per-file/24DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
58 <element name="246TRICHLOROPHENOL" file="split/one-per-file/246TRICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
59 <element name="245TRICHLOROPHENOL" file="split/one-per-file/245TRICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
60 <element name="23DICHLOROPHENOL" file="split/one-per-file/23DICHLOROPHENOL.msp" ftype="msp" compare="contains"/>
61 </output_collection>
62 </test>
63 <test>
64 <param name="msp_input" value="split/sample_input.msp" />
65 <param name="split_type" value="num-chunks" />
66 <param name="num_chunks" value="2" />
67 <output_collection name="sample" type="list">
68 <element name="chunk_0" file="split/num-chunks/chunk_0.msp" ftype="msp" compare="contains"/>
69 <element name="chunk_1" file="split/num-chunks/chunk_1.msp" ftype="msp" compare="contains"/>
70 </output_collection>
71 </test>
72 <test>
73 <param name="msp_input" value="split/sample_input.msp" />
74 <param name="split_type" value="chunk-size" />
75 <param name="chunk_size" value="4" />
76 <output_collection name="sample" type="list">
77 <element name="chunk_0" file="split/chunk-size/chunk_0.msp" ftype="msp" compare="contains"/>
78 <element name="chunk_1" file="split/chunk-size/chunk_1.msp" ftype="msp" compare="contains"/>
79 <element name="chunk_2" file="split/chunk-size/chunk_2.msp" ftype="msp" compare="contains"/>
80 </output_collection>
81 </test>
82 </tests>
83 <help><![CDATA[
84 Splitmsp handles input/output files in MSP format using the matchms.importing and matchms.exporting modules (https://matchms.readthedocs.io/en/latest/index.html).
85
86 Please observe that the `num-chunks` method does not preserve the order of the elements as it uses a `round robin` distribution.
87 ]]></help>
88 <expand macro="citations"/>
89 </tool>