comparison genform.xml @ 0:963722c4e1da draft default tip

"planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/blob/master/tools/genform/ commit d73f3664336def878419e019920d209f3bfb4fa9"
author workflow4metabolomics
date Tue, 08 Oct 2019 05:51:40 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:963722c4e1da
1 <tool id="genform" name="genform" version="@GENFORM_VERSION@" python_template_version="3.5">
2 <description>Generation of molecular formulas by high-resolution MS and MS/MS data</description>
3 <macros>
4 <token name="@GENFORM_VERSION@">8</token>
5 </macros>
6 <requirements>
7 <requirement type="package" version="r@GENFORM_VERSION@">genform</requirement>
8 </requirements>
9 <command detect_errors="exit_code"><![CDATA[
10 genform
11 ms='$ms'
12 #if $msms
13 msms='$msms'
14 #end if
15 #if $formula_cond.formula_select != 'advanced'
16 $formula_cond.formula_select
17 #else
18 $formula_cond.vsp
19 #if str($formula_cond.vsm2mv)
20 vsm2mv=$formula_cond.vsm2mv
21 #end if
22 #if str($formula_cond.vsm2ap2)
23 vsm2ap2=$formula_cond.vsm2ap2
24 #end if
25 #if str($formula_cond.ivsm2mv)
26 ivsm2mv=$formula_cond.ivsm2mv
27 #end if
28 #if str($formula_cond.ivsm2ap2)
29 ivsm2ap2=$formula_cond.ivsm2ap2
30 #end if
31 #end if
32 #if str($m)
33 m=$m
34 #end if
35 ion=$ion
36 ppm=$ppm
37 $msmv
38 acc=$acc
39 rej=$rej
40 thms=$thms
41 thmsms=$thmsms
42 thcomb=$thcomb
43 #if $sort
44 $sort
45 #end if
46 #if $elemfilt_cond.elemfilt_select == 'elem'
47 el=#echo "".join(str($elemfilt_cond.el).split(','))
48 #elif $elemfilt_cond.elemfilt_select == 'oc'
49 oc
50 #elif $elemfilt_cond.elemfilt_select == 'fuzzy'
51 ff=$elemfilt_cond.ff
52 #end if
53 $het
54 $hcf
55 $wm
56 $wi_cond.wi
57 #if $wi_cond.wi == 'wi=log' and str($wi_cond.exp)
58 exp=$wi_cond.exp
59 #end if
60 $oei
61 #if str($dbeexc)
62 dbeexc=$dbeexc
63 #end if
64 #if $output.out_cond.out_select == 'analyze':
65 analyze
66 $output.out_cond.loss
67 $output.out_cond.intens
68 #end if
69 $output.dbe
70 $output.cm
71 $output.pc
72 $output.sc
73 out=out
74 #if $addoutput.oms
75 oms='$outoms'
76 #end if
77 #if $addoutput.omsms
78 omsms='$outomsms'
79 #end if
80 #if $addoutput.oclean
81 oclean='$outoclean'
82 #end if
83
84 ## for some reason genform prints the file twice if sorting is selected
85 ## (once unsorted and once sorted). hence, if soring is enabled just
86 ## the lower half of the file is returned
87 #if $sort
88 &&
89 wc=\$(wc -l out | cut -d" " -f 1 )
90 &&
91 hwc=\$(echo "\$wc/2" | bc)
92 &&
93 tail -n \$hwc > '$out'
94 #else
95 && cp out '$out'
96 #end if
97 ]]></command>
98 <inputs>
99 <param type="data" argument="ms" label="MS data" format="tabular" help="" />
100 <param type="data" argument="msms" label="MS/MS data (optional)" optional="true" format="tabular" help="" />
101 <conditional name="formula_cond">
102 <param type="select" name="formula_select" label="Structural formula existence check" help="Allow only molecular formulas for that at least one structural formula exists or specify advanced restictions, note that the default of genform is 'no existence check'">
103 <option value="">No existence check</option>
104 <option value="exist" selected="true">Only molecular formulas for that at least one structural formula exists (exist)</option>
105 <option value="exist=mv">Enable multiple valencies for P and S (exist=mv)</option>
106 <option value="advanced">Advanced</option>
107 </param>
108 <when value=""/>
109 <when value="exist"/>
110 <when value="exist=mv"/>
111 <when value="advanced">
112 <param type="select" argument="vsp" label="Valency sum parity" help="Even for graphical formulas" >
113 <option value="">Use default</option>
114 <option value="vsp=even">Even</option>
115 <option value="vsp=odd">Odd</option>
116 </param>
117 <param type="integer" argument="vsm2mv" label="Lower bound for valency sum - 2 * maximum valency for graphical formulas" min="0" value="" help="" />
118 <param type="integer" argument="vsm2ap2" label="Lower bound for valency sum - 2 * number of atoms + 2 for graphical connected formulas" min="0" value="" help="" />
119 <param type="integer" argument="ivsm2mv" label="Lower bound for valency sum - 2 * maximum valency for fragment ions" min="0" value="" help="" />
120 <param type="integer" argument="ivsm2ap2" label="Lower bound for valency sum - 2 * number of atoms + 2 for fragment ions" min="0" value="" help="" />
121 </when>
122 </conditional>
123 <param type="float" argument="m" label="Experimental molecular mass" min="0" optional="true" help="(default: mass of MS basepeak)" />
124 <param type="select" argument="ion" label="Type of ion measured" help="" >
125 <option value="M+H">[M+H]+</option>
126 <option value="M-H">[M-H]-</option>
127 <option value="M+e">M+</option>
128 <option value="M-e">M-</option>
129 <option value="M+Na">[M+Na]+</option>
130 </param>
131 <param type="integer" argument="ppm" label="Accuracy of measurement of MS1" min="0" value="5" help="In parts per million" />
132 <param type="select" argument="msmv" label="MS match value" help="Select output type of the MS match value" >
133 <option value="msmv=ndp">Normalized dot product</option>
134 <option value="msmv=nsse">Normalized sum of squared</option>
135 <option value="msmv=nsae" selected="true">Absolute errors</option>
136 </param>
137 <param type="integer" argument="acc" label="Allowed deviation for full acceptance" min="0" value="2" help="of MS/MS peak in ppm" />
138 <param type="integer" argument="rej" label="Allowed deviation for total rejection" min="0" value="4" help="of MS/MS peak in ppm" />
139 <param type="float" argument="thms" label="Threshold for the MS match value" min="0" max="1" value="0" help="" />
140 <param type="float" argument="thmsms" label="Threshold for the MS/MS match value" min="0" max="1" value="0" help="" />
141 <param type="float" argument="thcomb" label="Threshold for the combined match value" min="0" max="1" value="0" help="" />
142 <param type="select" argument="sort" optional="true" label="Sort generated formulas by" help="" >
143 <option value="sort=ppm">Mass deviation in ppm</option>
144 <option value="sort=msmv">MS match value</option>
145 <option value="sort=msmsmv">MS/MS match value</option>
146 <option value="sort=combmv">Combined match value</option>
147 </param>
148 <conditional name="elemfilt_cond">
149 <param type="select" name="elemfilt_select" label="Chemical element filtering">
150 <option value="nofilter">No filter</option>
151 <option value="elem">By used elements</option>
152 <option value="oc">Only organic compounds (oc)</option>
153 <option value="fuzzy">By fuzzy formula</option>
154 </param>
155 <when value="nofilter"/>
156 <when value="elem">
157 <param type="select" multiple="true" argument="el" label="Used chemical elements" help="" >
158 <option selected="true" value="C">C</option>
159 <option selected="true" value="N">N</option>
160 <option selected="true" value="O">O</option>
161 <option selected="true" value="P">P</option>
162 <option selected="true" value="S">S</option>
163 <option selected="true" value="H">H</option>
164 <option selected="true" value="Cl">Cl</option>
165 <option selected="true" value="Br">Br</option>
166 <option selected="true" value="F">F</option>
167 <option selected="true" value="I">I</option>
168 <option selected="true" value="Si">Si</option>
169 </param>
170 </when>
171 <when value="oc"/>
172 <when value="fuzzy">
173 <param type="text" argument="ff" checked="false" label="Uses fuzzy formula for limits of element multiplicities" help="" />
174 </when>
175 </conditional>
176 <param type="boolean" argument="het" checked="false" truevalue="het" falsevalue="" label="Formulas must have at least one hetero atom" help="" />
177 <param type="boolean" argument="hcf" checked="false" truevalue="hcf" falsevalue="" label="Apply Heuerding-Clerc filter" help="" />
178 <param type="select" argument="wm" label="Weighting of m/z for MS/MS match value" help="" >
179 <option value="">No weighting</option>
180 <option value="wm=lin">Linear</option>
181 <option value="wm=sqrt">Square root</option>
182 <option value="wm=log">Logarithmic</option>
183 </param>
184 <conditional name="wi_cond">
185 <param type="select" argument="wi" label="Intensity weighting for MS/MS match value" help="" >
186 <option value="">No weighting</option>
187 <option value="wi=lin">Linear</option>
188 <option value="wi=sqrt">Square root</option>
189 <option value="wi=log">Logarithmic</option>
190 </param>
191 <when value=""/>
192 <when value="wi=lin"/>
193 <when value="wi=sqrt"/>
194 <when value="wi=log">
195 <param type="float" argument="exp" optional="true" label="Exponent" value="" help="" />
196 </when>
197 </conditional>
198 <param type="boolean" argument="oei" checked="false" truevalue="oei" falsevalue="" label="Allow odd electron ions for explaining MS/MS peaks" help="" />
199 <param type="integer" argument="dbeexc" optional="true" label="Excess of double bond equivalent for ions" help="" />
200 <section name="output" title="Output options for main output" expanded="true">
201 <conditional name="out_cond">
202 <param type="select" name="out_select" label="Write explanations for MS/MS peaks to output" help="" >
203 <option value="">no</option>
204 <option value="analyze">yes</option>
205 </param>
206 <when value=""/>
207 <when value="analyze">
208 <param type="boolean" argument="loss" checked="false" truevalue="loss" falsevalue="" label="For analyzing MS/MS peaks write losses instead of fragments" help="" />
209 <param type="boolean" argument="intens" checked="false" truevalue="intens" falsevalue="" label="Write intensities of MS/MS peaks to output" help="" />
210 </when>
211 </conditional>
212 <param type="boolean" argument="dbe" checked="false" truevalue="dbe" falsevalue="" label="Write double bond equivalents to output" help="" />
213 <param type="boolean" argument="cm" checked="false" truevalue="cm" falsevalue="" label="Write calculated ion masses to output" help="" />
214 <param type="boolean" argument="pc" checked="false" truevalue="pc" falsevalue="" label="Output match values in percent" help="" />
215 <param type="boolean" argument="sc" checked="false" truevalue="sc" falsevalue="" label="Strip calculated isotope distributions" help="" />
216 </section>
217 <section name="addoutput" title="Additional output data sets" expanded="true">
218 <param type="boolean" argument="oms" checked="false" truevalue="oms" falsevalue="" label="Write scaled MS peaks output" help="" />
219 <param type="boolean" argument="omsms" checked="false" truevalue="omsms" falsevalue="" label="Write scaled MS/MS peaks output" help="" />
220 <param type="boolean" argument="oclean" checked="false" truevalue="oclean" falsevalue="" label="Write MS/MS with only explained peaks" help="" />
221 <param type="boolean" argument="oclean" checked="false" truevalue="oms" falsevalue="" label="Write MS/MS with only explained peaks" help="" />
222 </section>
223 </inputs>
224 <outputs>
225 <data name="out" format="tabular" />
226 <data name="outoms" format="tabular" label="${tool.name} on ${on_string}: MS">
227 <filter>addoutput['oms']</filter>
228 </data>
229 <data name="outomsms" format="tabular" label="${tool.name} on ${on_string}: MS/MS" >
230 <filter>addoutput['omsms']</filter>
231 </data>
232 <data name="outoclean" format="tabular" label="${tool.name} on ${on_string}: clean">
233 <filter>addoutput['oclean']</filter>
234 </data>
235 </outputs>
236 <tests>
237 <!-- test with MS input and mostly default values -->
238 <test expect_num_outputs="1">
239 <param name="ms" ftype="tabular" value="CreatineMs.txt" />
240 <param name="acc" value="20" />
241 <param name="rej" value="40" />
242 <output name="out" ftype="tabular" file="CreatineMs.out"/>
243 <assert_command>
244 <has_text text=" ms=" />
245 <not_has_text text=" msms=" />
246 <has_text text=" exist " />
247 <not_has_text text=" m=" />
248 <has_text text=" ion=M+H " />
249 <has_text text=" ppm=5 " />
250 <has_text text=" msmv=nsae " />
251 <has_text text=" acc=20 " />
252 <has_text text=" rej=40 " />
253 <has_text text=" thmsms=0.0 " />
254 <has_text text=" thmsms=0.0 " />
255 <has_text text=" thcomb=0.0 " />
256 <not_has_text text=" sort" />
257 <not_has_text text=" el=" />
258 <not_has_text text=" oc " />
259 <not_has_text text=" ff=" />
260 <not_has_text text=" het " />
261 <not_has_text text=" vsp=" />
262 <not_has_text text=" vsp2mv=" />
263 <not_has_text text=" vsm2ap2=" />
264 <not_has_text text=" hcf " />
265 <not_has_text text=" wm=" />
266 <not_has_text text=" wi=" />
267 <not_has_text text=" exp=" />
268 <not_has_text text=" oei " />
269 <not_has_text text=" dbeexc=" />
270 <not_has_text text=" ivsm2mv=" />
271 <not_has_text text=" ivsm2ap2=" />
272 <not_has_text text=" oms=" />
273 <not_has_text text=" omsms=" />
274 <not_has_text text=" oclean=" />
275 <not_has_text text=" analyze " />
276 <not_has_text text=" loss " />
277 <not_has_text text=" intens " />
278 <not_has_text text=" dbe " />
279 <not_has_text text=" cm " />
280 <not_has_text text=" pc " />
281 <not_has_text text=" sc " />
282 </assert_command>
283 </test>
284 <!-- test with MS/MS input and non default output options -->
285 <test expect_num_outputs="4">
286 <param name="ms" ftype="tabular" value="CreatineMs.txt" />
287 <param name="msms" ftype="tabular" value="CreatineMsMs.txt" />
288 <param name="acc" value="20" />
289 <param name="rej" value="40" />
290 <section name="output">
291 <conditional name="out_cond">
292 <param name="out_select" value="analyze"/>
293 <param name="loss" value="loss" />
294 <param name="intens" value="intens" />
295 </conditional>
296 <param name="dbe" value="dbe" />
297 <param name="cm" value="cm" />
298 <param name="pc" value="pc" />
299 <param name="sc" value="sc" />
300 </section>
301 <section name="addoutput">
302 <param name="oms" value="oms" />
303 <param name="omsms" value="omsms" />
304 <param name="oclean" value="oclean" />
305 <param name="oclean" value="oms"/>
306 </section>
307 <output name="out" ftype="tabular" file="CreatineMsMs.out"/>
308 <output name="outoms" ftype="tabular" file="CreatineMsMs-oms.out"/>
309 <output name="outomsms" ftype="tabular" file="CreatineMsMs-omsms.out"/>
310 <output name="outoclean" ftype="tabular" file="CreatineMsMs-oclean.out"/>
311 <assert_command>
312 <has_text text=" ms=" />
313 <has_text text=" msms=" />
314 <has_text text=" exist" />
315 <not_has_text text=" m=" />
316 <has_text text=" ion=M+H " />
317 <has_text text=" ppm=5 " />
318 <has_text text=" msmv=nsae " />
319 <has_text text=" acc=20 " />
320 <has_text text=" rej=40 " />
321 <has_text text=" thmsms=0.0 " />
322 <has_text text=" thmsms=0.0 " />
323 <has_text text=" thcomb=0.0 " />
324 <not_has_text text=" sort" />
325 <not_has_text text=" el=" />
326 <not_has_text text=" oc " />
327 <not_has_text text=" ff=" />
328 <not_has_text text=" het " />
329 <not_has_text text=" vsp=" />
330 <not_has_text text=" vsp2mv=" />
331 <not_has_text text=" vsm2ap2=" />
332 <not_has_text text=" hcf " />
333 <not_has_text text=" wm=" />
334 <not_has_text text=" wi=" />
335 <not_has_text text=" exp=" />
336 <not_has_text text=" oei " />
337 <not_has_text text=" dbeexc=" />
338 <not_has_text text=" ivsm2mv=" />
339 <not_has_text text=" ivsm2ap2=" />
340 <has_text text=" oms=" />
341 <has_text text=" omsms=" />
342 <has_text text=" oclean=" />
343 <has_text text=" analyze " />
344 <has_text text=" loss " />
345 <has_text text=" intens " />
346 <has_text text=" dbe " />
347 <has_text text=" cm " />
348 <has_text text=" pc " />
349 <has_text text=" sc " />
350 </assert_command>
351 </test>
352 <!-- test with MS/MS input and other non-default values
353 (creates empty output .. but test is still usefull) -->
354 <test expect_num_outputs="1">
355 <param name="ms" ftype="tabular" value="CreatineMs.txt" />
356 <param name="msms" ftype="tabular" value="CreatineMsMs.txt" />
357 <conditional name="formula_cond">
358 <param name="formula_select" value=""/>
359 </conditional>
360 <param name="m" value="111.0201" />
361 <param name="ion" value="M-H" />
362 <param name="ppm" value="4" />
363 <param name="msmv" value="msmv=ndp"/>
364 <param name="acc" value="21" />
365 <param name="rej" value="39" />
366 <param name="thms" value="0.3" />
367 <param name="thmsms" value="0.2" />
368 <param name="thcomb" value="0.1" />
369 <param name="sort" value="sort=combmv" />
370 <conditional name="elemfilt_cond">
371 <param name="elemfilt_select" value="elem"/>
372 <param name="el" value="C,N,O,P,S,H,Cl,Br,F,I" />
373 </conditional>
374 <param name="het" value="het" />
375 <param name="hcf" value="hcf" />
376 <param name="wm" value="wm=sqrt"/>
377 <conditional name="wi_cond">
378 <param name="wi" value="wi=log"/>
379 <param name="exp" value="2.31"/>
380 </conditional>
381 <param name="oei" value="oei" />
382 <param name="dbeexc" value="1" />
383 <output name="out" ftype="tabular" file="CreatineMsMs.out" lines_diff="3"/>
384 <assert_command>
385 <has_text text=" ms=" />
386 <has_text text=" msms=" />
387 <not_has_text text=" exist" />
388 <has_text text=" m=111.0201" />
389 <has_text text=" ion=M-H" />
390 <has_text text=" ppm=4" />
391 <has_text text=" msmv=ndp" />
392 <has_text text=" acc=21" />
393 <has_text text=" rej=39" />
394 <has_text text=" thms=0.3" />
395 <has_text text=" thmsms=0.2" />
396 <has_text text=" thcomb=0.1" />
397 <has_text text=" sort=combmv" />
398 <has_text text=" el=CNOPSHClBrFI" />
399 <not_has_text text=" oc " />
400 <not_has_text text=" ff=" />
401 <has_text text=" het " />
402 <not_has_text text=" vsp=" />
403 <not_has_text text=" vsp2mv=" />
404 <not_has_text text=" vsm2ap2=" />
405 <has_text text=" hcf " />
406 <has_text text=" wm=sqrt " />
407 <has_text text=" wi=log " />
408 <has_text text=" exp=2.31 " />
409 <has_text text=" oei " />
410 <has_text text=" dbeexc=1" />
411 <not_has_text text=" ivsm2mv=" />
412 <not_has_text text=" ivsm2ap2=" />
413 <not_has_text text=" oms=" />
414 <not_has_text text=" omsms=" />
415 <not_has_text text=" oclean=" />
416 <not_has_text text=" analyze " />
417 <not_has_text text=" loss " />
418 <not_has_text text=" intens " />
419 <not_has_text text=" dbe " />
420 <not_has_text text=" cm " />
421 <not_has_text text=" pc " />
422 <not_has_text text=" sc " />
423 </assert_command>
424 </test>
425 </tests>
426 <help><![CDATA[
427
428 **Overview**
429
430 Genform generates candidate molecular formulas from high-resolution
431 MS data. It calculates match values (MV) that show how well candidate molecular formulas fit the MS
432 isotope peak distributions (MS MV) and the high-resolution MS/MS fragment peak masses (MSMS
433 MV). Finally it computes a combined match value from these two scores. This software can be
434 regarded as a further development of the ElCoCo and MolForm modules of MOLGEN-MS with a clear
435 specialization towards MS/MS.
436
437 **Input**
438
439 MS and MS/MS centroided spectra are given as tab separated files with two columns:
440
441 1. m/z
442 2. intensity
443
444 **Output**
445
446 Main output containing a list of all possible molecular formulas, further options can be chosen:
447
448 1. if the explained peaks shall also be written to the output
449 2. if the explanation shall be given as molecular formulas for the fragment or as neutral losses
450 3. double bond equivalents for each molecular formula
451 4. calculated ion masses
452 5. output match values in percent
453
454 Output structure:
455
456 molecular fomula / (double bond equivalent) / (calculated mass) / ppm / MS MV / MSMS MV / combined MV
457
458 ppm: The value ppm denotes the relative deviation of
459 the calculated mass of the molecular ion from the mass of the basepeak (basemass) in the MS in
460 parts per million (ppm).
461
462 MS MV: It is calculated from measured and
463 theoretical isotope peak intensities. The MV ranges from 0 to 1. The better theoretical and measured
464 isotope distributions fit, the higher is the MV. There are three different algorithms implemented for
465 calculating the MS MV, which are nomalized dot product, nomalized sum of squared errors and the normalized sum of absolute errors.
466
467 MSMS MV: It shows how well the masses of the MS/MS fit possible fragments of the candidate molecular formula. Again, the MS/MS MV is a value
468 between 0 and 1, whereby higher values reflect a better fit.
469
470 combined MV: combined match value
471
472 Example output:
473
474 ======== === =========== ====== ======== ========= ========
475 C4H9N3O2 2 132.07675 -0.8 96.674 100.000 96.674
476 ======== === =========== ====== ======== ========= ========
477
478 **Advanced options**
479
480 For undersanding of the parameters and rules for creating possible molecular formulas, see `the manual of the commandline tool <https://depot.galaxyproject.org/software/molgen_manual/molgen_manual_1.0.1.5_src_all.pdf>`_ for info.
481
482 ]]></help>
483
484 <citations>
485 <citation type="doi">10.3390/metabo3020440</citation>
486 <citation type="bibtex">@article{meringer2011ms,
487 title={MS/MS data improves automated determination of molecular formulas by mass spectrometry},
488 author={Meringer, Markus and Reinker, Stefan and Zhang, Juan and Muller, Alban},
489 journal={MATCH Commun. Math. Comput. Chem},
490 volume={65},
491 number={2},
492 pages={259--290},
493 year={2011}
494 }</citation>
495 </citations>
496 </tool>