comparison thermo_converter.xml @ 5:77a18a61aeed draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/ThermoRawfileParser commit 2c29e2fadeba9be11e81420f24e7a6429ef52aa7"
author galaxyp
date Fri, 30 Aug 2019 10:28:22 -0400
parents 344e10282449
children 2d80c8b2dfc2
comparison
equal deleted inserted replaced
4:344e10282449 5:77a18a61aeed
1 <tool id="thermo_raw_file_converter" name="Thermo" version="1.1.2"> 1 <tool id="thermo_raw_file_converter" name="Thermo" version="1.1.10">
2 <description>RAW file converter</description> 2 <description>RAW file converter</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="1.1.2">ThermoRawFileParser</requirement> 4 <requirement type="package" version="1.1.10">ThermoRawFileParser</requirement>
5 </requirements> 5 </requirements>
6 <command> 6 <command>
7 <![CDATA[ 7 <![CDATA[
8 8 #import re
9 ln -s '$input' ./input.raw && 9
10 10 #set $temp_stderr = "thermo_converter_stderr"
11 ThermoRawFileParser.sh 11
12 -i=input.raw 12 echo "" > $temp_stderr &&
13 -o=./ 13
14 mkdir ./raws_folder &&
15 mkdir ./output_folder &&
16 #for $input_raw in $input:
17 #if len($input) > 1
18 #set $input_name = re.sub('[^\w\-\.]', '_',$input_raw.element_identifier.split('/')[-1].replace(".raw", "") + ".raw")
19 ln -s -f '${input_raw}' './raws_folder/${input_name}' &&
20 #else:
21 ln -s -f '${input_raw}' './raws_folder/input.raw' &&
22 #end if
23 #end for
24
25 (ThermoRawFileParser.sh
26 -d=./raws_folder
27 -o=./output_folder
14 -f=$output_format 28 -f=$output_format
15 #if $metadata: 29 #if $output_metadata_selector != "off":
16 --metadata=1 30 --metadata="${output_metadata_selector}"
17 #end if 31 #end if
32 $zlib_boolean
33 $peakpicking_boolean
34 $ignore_instrument_errors_boolean
35
36 2>> $temp_stderr)
37
18 && 38 &&
19 #if $output_format == '0': 39
20 mv ./input.mgf '$output' 40 #if len($input) == 1:
21 #else: 41 #if $output_format == "0":
22 mv ./input.mzML '$output' 42 mv ./output_folder/input.mgf ./output_file.out &&
43 #else if $output_format == "1":
44 mv ./output_folder/input.mzML ./output_file.out &&
45 #else if $output_format == "2":
46 mv ./output_folder/input.mzML ./output_file.out &&
47 #end if
48
49 #if $output_metadata_selector != "off":
50 #if $output_metadata_selector == "0":
51 mv ./output_folder/input-metadata.json ./input-metadata.txt &&
52 #else if $output_metadata_selector == "1":
53 mv ./output_folder/input-metadata.txt ./input-metadata.txt &&
54 #end if
55 #end if
23 #end if 56 #end if
57
58 cat $temp_stderr 2>&1;
24 ]]> 59 ]]>
25 </command> 60 </command>
26 <inputs> 61 <inputs>
27 <param name="input" type="data" format="thermo.raw" label="Thermo RAW file" help="" /> 62 <param name="input" type="data" format="thermo.raw" label="Thermo RAW file" help="" multiple="true"
28 <param name="metadata" type="boolean" truevalue="" falsevalue="" checked="False" 63 optional="False" />
29 label="Output metadata" help="" /> 64
30 <param name="output_format" type="select" label="Choose an output format"> 65 <param name="output_format" type="select" label="Output format">
31 <option value="0">mgf</option> 66 <option value="0">mgf</option>
32 <option value="1" selected="True">mzml</option> 67 <option value="1" selected="True">mzml</option>
68 <option value="2">Indexed mzml</option>
33 </param> 69 </param>
70
71 <param name="zlib_boolean" type="boolean" truevalue="" falsevalue="-z" checked="true"
72 label="Use zlib compression for the m/z ratios and intensities" help="" />
73
74 <param name="peakpicking_boolean" type="boolean" truevalue="" falsevalue="-p" checked="true"
75 label="Use the peak picking provided by the native thermo library" help="" />
76
77 <param name="ignore_instrument_errors_boolean" type="boolean" truevalue="-e" falsevalue="" checked="true"
78 label="Ignore missing instrument properties" help="If false, it stops the conversion if instrument properties are missing" />
79
80 <param name="output_metadata_selector" type="select" label="Output metadata" >
81 <option value="off" selected="True">No</option>
82 <option value="0">json</option>
83 <option value="1">txt</option>
84 </param>
85
34 </inputs> 86 </inputs>
35 <outputs> 87 <outputs>
36 <data format="mzml" name="output" from_work_dir="input.mzML" label="${tool.name} on ${on_string}"> 88
89 <!-- We use simple data outputs if we just have one file, for backwards compatibility -->
90
91 <data name="output" format="mzml" from_work_dir="output_file.out" label="${tool.name} on ${on_string}">
92 <filter>(str(input)).count(',') == 0</filter> <!-- funny way of counting the number of input files! -->
37 <change_format> 93 <change_format>
38 <when input="output_format" value="0" format="mgf" /> 94 <when input="output_format" value="0" format="mgf" />
95 <when input="output_format" value="2" format="txt" />
39 </change_format> 96 </change_format>
40 </data> 97 </data>
41 <data format="txt" name="output_metadata" from_work_dir="input-metadata.txt" label="${tool.name} on ${on_string}: Metadata"> 98
42 <filter>metadata</filter> 99 <data name="output_metadata" format="txt" label="${tool.name} on ${on_string}: Metadata" from_work_dir="input-metadata.txt">
100 <filter>str(output_metadata_selector) != "off"</filter>
101 <filter>(str(input)).count(',') == 0</filter>
102 <change_format>
103 <when input="output_metadata_selector" value="0" format="json" />
104 </change_format>
43 </data> 105 </data>
106
107 <!-- We use collections if we have multiple input files -->
108
109 <collection name="output_mgf_collection" type="list" label="${tool.name} on ${on_string}: MGF">
110 <filter>output_format == "0"</filter>
111 <filter>(str(input)).count(',') > 0</filter>
112 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mgf" directory="output_folder" ext="mgf"/>
113 </collection>
114
115 <collection name="output_mzml_collection" type="list" label="${tool.name} on ${on_string}: mzML">
116 <filter>output_format == "1"</filter>
117 <filter>(str(input)).count(',') > 0</filter>
118 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/>
119 </collection>
120
121 <collection name="output_indexedmzml_collection" type="list" label="${tool.name} on ${on_string}: Indexed mzML">
122 <filter>output_format == "2"</filter>
123 <filter>(str(input)).count(',') > 0</filter>
124 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.mzML" ext="mzml" directory="output_folder"/>
125 </collection>
126
127 <collection name="output_metadata_collection" type="list" label="${tool.name} on ${on_string}: metadata">
128 <filter>output_metadata_selector != "off"</filter>
129 <filter>(str(input)).count(',') > 0</filter>
130 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.txt" ext="txt" directory="output_folder"/>
131 <discover_datasets pattern="(?P&lt;designation&gt;.+)-metadata.json" ext="json" directory="output_folder"/>
132 </collection>
133
44 </outputs> 134 </outputs>
135
45 <tests> 136 <tests>
46 <test> 137 <!-- Basic test -->
47 <param name="input" value="fake_input.txt"/> 138 <test expect_num_outputs="1">
48 <assert_command> 139 <param name="input" value="really_small.raw"/>
49 <has_text text="ThermoRawFileParser.sh"/> 140 <param name="output_format" value="1"/>
50 </assert_command> 141 <output name="output" file="really_small.mzml" ftype="mzml" compare="sim_size" delta="3000" />
51 </test> 142 </test>
52 <test> 143
53 <param name="input" value="fake_input.txt"/> 144 <!-- Testing contents of converted mgf file with txt metadata -->
145 <test expect_num_outputs="2">
146 <param name="input" value="really_small.raw"/>
54 <param name="output_format" value="0"/> 147 <param name="output_format" value="0"/>
55 <assert_command> 148 <param name="output_metadata_selector" value="1"/>
56 <has_text text="-f=0"/> 149 <output name="output">
57 </assert_command> 150 <assert_contents>
151 <has_text text="SCANS=36"/>
152 <has_text text="RTINSECONDS=73.863181104"/>
153 <has_text text="PEPMASS=675.248779296875"/>
154 <has_text text="CHARGE=2+"/>
155 <has_text text="121.3116455 920.2367553711"/>
156 <has_text text="229.2241211 1137.6958007813"/>
157 <has_text text="1577.8967285 1487.9519042969"/>
158 </assert_contents>
159 </output>
160 <output name="output_metadata" ftype="txt">
161 <assert_contents>
162 <has_text text="Instrument model=[MS, MS:1000494, Thermo Scientific instrument model, Orbitrap Fusion]"/>
163 <has_text text="Instrument name=Orbitrap Fusion"/>
164 <has_text text="Instrument serial number=[MS, MS:1000529, instrument serial number, FSN10188]"/>
165 <has_text text="Software version=[NCIT, NCIT:C111093, Software Version, 3.1.2412.17]"/>
166 <has_text text="Mass resolution=[MS, MS:1000011, mass resolution, 0.500]"/>
167 <has_text text="Number of scans=101"/>
168 <has_text text="Scan range=1;101"/>
169 <has_text text="Scan start time=[MS, MS:1000016, scan start time, 0.89]"/>
170 <has_text text="Time range=0.89;1.59"/>
171 <has_text text="Mass range=120.0000;2000.0000"/>
172 </assert_contents>
173 </output>
174
175 </test>
176
177 <!-- Basic mzml collection test -->
178 <test expect_num_outputs="1">
179 <param name="input" value="really_small.raw,really_small_2.raw"/>
180 <param name="output_format" value="1"/>
181 <output_collection name="output_mzml_collection" type="list" count="2"/>
182 </test>
183
184 <!-- mgf collection test with metadata -->
185 <test expect_num_outputs="2">
186 <param name="input" value="really_small.raw,really_small_2.raw,really_small_3.raw"/>
187 <param name="output_format" value="0"/>
188 <param name="output_metadata_selector" value="0"/>
189 <output_collection name="output_mgf_collection" type="list" count="3"/>
190 <output_collection name="output_metadata_collection" type="list" count="3"/>
58 </test> 191 </test>
59 </tests> 192 </tests>
60 <help> 193 <help>
61 <![CDATA[ 194 <![CDATA[
62 195