comparison abims_xcms_retcor.xml @ 27:8242376d9f35 draft

planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit cc13a2654ccf6f9e55bc0120ea5518df3b045712
author workflow4metabolomics
date Thu, 14 Mar 2024 15:35:44 +0000
parents
children 33c0ca93f3ee
comparison
equal deleted inserted replaced
26:36480435e92b 27:8242376d9f35
1 <tool id="abims_xcms_retcor" name="xcms adjustRtime (retcor)" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2
3 <description>Retention Time Correction</description>
4
5 <macros>
6 <import>macros.xml</import>
7 <import>macros_xcms.xml</import>
8 </macros>
9
10 <expand macro="requirements"/>
11 <expand macro="stdio"/>
12
13 <command><![CDATA[
14 @COMMAND_RSCRIPT@/xcms_retcor.r
15 image '$image'
16
17 method $methods.method
18 #if $methods.method == "PeakGroups":
19 minFraction $methods.minFraction
20 extraPeaks $methods.extraPeaks
21 smooth $methods.smooth_cond.smooth
22 ## PeakGroupsSmoothLoess Advanced
23 span $methods.smooth_cond.PeakGroupsSmoothLoessAdv.span
24 family $methods.smooth_cond.PeakGroupsSmoothLoessAdv.family
25 #else
26 binSize $methods.binSize
27 ## Advanced
28 #if $methods.ObiwarpAdv.centerSample != "":
29 centerSample $methods.ObiwarpAdv.centerSample
30 #end if
31 response $methods.ObiwarpAdv.response
32 distFun $methods.ObiwarpAdv.distFunCond.distFun
33 gapInit $methods.ObiwarpAdv.distFunCond.gapInit
34 gapExtend $methods.ObiwarpAdv.distFunCond.gapExtend
35 factorDiag $methods.ObiwarpAdv.factorDiag
36 factorGap $methods.ObiwarpAdv.factorGap
37 localAlignment $methods.ObiwarpAdv.localAlignmentCond.localAlignment
38 initPenalty $methods.ObiwarpAdv.localAlignmentCond.initPenalty
39 #end if
40
41 @COMMAND_FILE_LOAD@
42
43 @COMMAND_LOG_EXIT@
44 ]]></command>
45
46 <inputs>
47 <param name="image" type="data" format="rdata.xcms.findchrompeaks,rdata.xcms.group,rdata" label="@INPUT_IMAGE_LABEL@" help="@INPUT_IMAGE_HELP@ from: findChromPeaks, groupChromPeaks" />
48 <conditional name="methods">
49 <param name="method" type="select" label="Method to use for retention time correction" help="See the help section below" >
50 <option value="PeakGroups" selected="true">PeakGroups - retention time correction based on aligment of features (peak groups) present in most/all samples.</option>
51 <option value="Obiwarp">Obiwarp - alignment based on the complete mz-rt data.</option>
52 </param>
53 <when value="PeakGroups">
54 <param argument="minFraction" type="float" value="0.9" min="0" max="1" label="Minimum required fraction of samples in which peaks for the peak group were identified" help="(previously missing)"/>
55 <param argument="extraPeaks" type="integer" value="1" label="Maximal number of additional peaks for all samples to be assigned to a peak group for retention time correction" help="For a data set with 6 samples, ‘extraPeaks = 1’ uses all peak groups with a total peak count lower or equal to ‘6 + 1’. The total peak count is the total number of peaks being assigned to a peak group and considers also multiple peaks within a sample being assigned to the group. (previously extra)" />
56 <conditional name="smooth_cond">
57 <param argument="smooth" type="select" label="Smooth method" >
58 <option value="loess" selected="true">loess - non-linear alignment</option>
59 <option value="linear">linear - linear alignment</option>
60 </param>
61 <when value="loess">
62 <section name="PeakGroupsSmoothLoessAdv" title="Advanced Options" expanded="False">
63 <param argument="span" type="float" value="0.2" label="Degree of smoothing for the loess fitting" />
64 <param argument="family" type="select" label="Family" help="if gaussian fitting is by least-squares with no outlier removal, and if symmetric a re descending M estimator is used with Tukey's biweight function, allowing outlier removal">
65 <option value="gaussian" selected="true">gaussian</option>
66 <option value="symmetric">symmetric</option>
67 </param>
68 </section>
69 </when>
70 <when value="linear" />
71 </conditional>
72 </when>
73 <when value="Obiwarp">
74 <param argument="binSize" type="float" value="1" label="Bin size (in mz dimension) to be used for the profile matrix generation" help="See ‘step’ parameter in ‘profile-matrix’ documentation for more details. (previously profStep)" />
75 <section name="ObiwarpAdv" title="Advanced Options" expanded="False">
76 <param argument="centerSample" type="integer" value="" optional="true" label="Index of the center sample in the experiment" help="It defaults to ‘floor(median(1:length(fileNames(object))))’" />
77 <param argument="response" type="integer" value="1" label="Defining the responsiveness of warping" help="with ‘response = 0’ giving linear warping on start and end points and ‘response = 100’ warping using all bijective anchors." />
78 <conditional name="distFunCond">
79 <param argument="distFun" type="select" label="Distance function to be used">
80 <option value="cor_opt" selected="true">cor_opt - calculate only 10% diagonal band of distance matrix; better runtime</option>
81 <option value="cor">cor - Pearson's correlation</option>
82 <option value="cov">cov - covariance</option>
83 <option value="prd">prd - product</option>
84 <option value="euc">euc - Euclidian distance</option>
85 </param>
86 <when value="cor_opt">
87 <param argument="gapInit" type="float" value="0.3" label="Penalty for gap opening" />
88 <param argument="gapExtend" type="float" value="2.4" label="Penalty for gap enlargement" />
89 </when>
90 <when value="cor">
91 <param argument="gapInit" type="float" value="0.3" label="Penalty for gap opening" />
92 <param argument="gapExtend" type="float" value="2.4" label="Penalty for gap enlargement" />
93 </when>
94 <when value="cov">
95 <param argument="gapInit" type="float" value="0.0" label="Penalty for gap opening" />
96 <param argument="gapExtend" type="float" value="11.7" label="Penalty for gap enlargement" />
97 </when>
98 <when value="prd">
99 <param argument="gapInit" type="float" value="0.0" label="Penalty for gap opening" />
100 <param argument="gapExtend" type="float" value="7.8" label="Penalty for gap enlargement" />
101 </when>
102 <when value="euc">
103 <param argument="gapInit" type="float" value="0.9" label="Penalty for gap opening" />
104 <param argument="gapExtend" type="float" value="1.8" label="Penalty for gap enlargement" />
105 </when>
106 </conditional>
107 <param argument="factorDiag" type="float" value="2" label="Local weight applied to diagonal moves in the alignment" />
108 <param argument="factorGap" type="float" value="1" label="local weight for gap moves in the alignment" />
109 <conditional name="localAlignmentCond">
110 <param argument="localAlignment" type="select" label="Whether a local alignment should be performed instead of the default global alignment">
111 <option value="FALSE" selected="true">FALSE</option>
112 <option value="TRUE">TRUE</option>
113 </param>
114 <when value="FALSE">
115 <param argument="initPenalty" type="hidden" value="0" label="Penalty for initiating an alignment" />
116 </when>
117 <when value="TRUE">
118 <param argument="initPenalty" type="float" value="0" label="Penalty for initiating an alignment" />
119 </when>
120 </conditional>
121 </section>
122 </when>
123 </conditional>
124
125 <expand macro="input_file_load"/>
126
127 </inputs>
128
129 <outputs>
130 <data name="xsetRData" format="rdata.xcms.retcor" label="${image.name[:-6]}.adjustRtime.RData" from_work_dir="retcor.RData" />
131 <data name="rawVSadjustedPdf" format="pdf" label="${image.name[:-6]}_rawVSadjusted.adjustRtime.Rplots.pdf" from_work_dir="raw_vs_adjusted_rt.pdf" />
132 </outputs>
133
134 <tests>
135 <test>
136 <param name="image" value="faahKO-single-class.xset.merged.group.RData" ftype="rdata"/>
137 <conditional name="methods">
138 <param name="method" value="PeakGroups"/>
139 <param name="extraPeaks" value="1"/>
140 <param name="minFraction" value="1"/>
141 <conditional name="smooth_cond">
142 <param name="smooth" value="loess"/>
143 <section name="PeakGroupsSmoothLoessAdv">
144 <param name="span" value="0.2"/>
145 <param name="family" value="gaussian"/>
146 </section>
147 </conditional>
148 </conditional>
149 <expand macro="test_file_load_single"/>
150 <assert_stdout>
151 <has_text text="extraPeaks: 1" />
152 <has_text text="minFraction: 1" />
153 <has_text text="span: 0.2" />
154 <has_text text="object with 4 samples" />
155 <has_text text="Time range: 2509.2-4480.3 seconds (41.8-74.7 minutes)" />
156 <has_text text="Mass range: 200.1-600 m/z" />
157 <has_text text="Peaks: 9251 (about 2313 per sample)" />
158 <has_text text="Peak Groups: 0" />
159 <has_text text="Sample classes: KO, WT" />
160 </assert_stdout>
161 </test>
162 <!-- DISABLE FOR TRAVIS : Zip
163 <test>
164 <param name="image" value="faahKO.xset.group.RData" ftype="rdata"/>
165 <conditional name="methods">
166 <param name="method" value="PeakGroups"/>
167 <param name="extraPeaks" value="1"/>
168 <param name="minFraction" value="1"/>
169 <conditional name="smooth_cond">
170 <param name="smooth" value="loess"/>
171 <section name="PeakGroupsSmoothLoessAdv">
172 <param name="span" value="0.2"/>
173 <param name="family" value="gaussian"/>
174 </section>
175 </conditional>
176 </conditional>
177 <expand macro="test_file_load_zip"/>
178 <assert_stdout>
179 <has_text text="object with 4 samples" />
180 <has_text text="Time range: 2509.2-4480.3 seconds (41.8-74.7 minutes)" />
181 <has_text text="Mass range: 200.1-600 m/z" />
182 <has_text text="Peaks: 9251 (about 2313 per sample)" />
183 <has_text text="Peak Groups: 0" />
184 <has_text text="Sample classes: KO, WT" />
185 </assert_stdout>
186 </test>
187 -->
188 <!-- DISABLE FOR TRAVIS
189 Test to test the different methods parameters
190 <test>
191 <param name="image" value="faahKO-single-class.xset.group.RData" ftype="rdata"/>
192 <conditional name="methods">
193 <param name="method" value="Obiwarp"/>
194 <section name="ObiwarpAdv">
195 <param name="centerSample" value="1"/>
196 <param name="response" value="0"/>
197 <conditional name="distFunCond">
198 <param name="distFun" value="cov"/>
199 <param name="gapInit" value="0.1" />
200 </conditional>
201 </section>
202 </conditional>
203 <expand macro="test_file_load_single"/>
204 <assert_stdout>
205 <has_text text="centerSample: 1" />
206 <has_text text="response: 0" />
207 <has_text text="distFun: cov" />
208 <has_text text="gapInit: 0.1" />
209 <has_text text="gapExtend: 11.7" />
210 </assert_stdout>
211 </test>
212 -->
213 </tests>
214
215 <help><![CDATA[
216
217 @HELP_AUTHORS@
218
219 ================
220 xcms adjustRtime
221 ================
222
223 -----------
224 Description
225 -----------
226
227 After matching peaks into groups, xcms can use those groups to identify and correct
228 correlated drifts in retention time from run to run. The aligned peaks can then be
229 used for a second pass of peak grouping which will be more accurate than the first.
230 The whole process can be repeated in an iterative fashion. Not all peak groups will be helpful
231 for identifying retention time drifts. Some groups may be missing peaks from a large
232 fraction of samples and thus provide an incomplete picture of the drift at that time point.
233 Still others may contain multiple peaks from the same sample, which is a sign of impropper grouping.
234
235 .. class:: warningmark
236
237 **After an adjustRtime step, it is mandatory to do a groupChromPeaks step, otherwise the rest of the workflow will not work with the RData file. (the initial peak grouping becomes invalid and is
238 discarded)**
239
240
241
242 -----------------
243 Workflow position
244 -----------------
245
246
247 **Upstream tools**
248
249 ========================= ============================ ==============================
250 Name Output file Format
251 ========================= ============================ ==============================
252 xcms.findChromPeaks raw.xset.RData rdata.xcms.findchrompeaks
253 ------------------------- ---------------------------- ------------------------------
254 xcms.groupChromPeaks ``*``.groupChromPeaks.RData rdata.xcms.group
255 ========================= ============================ ==============================
256
257
258 **Downstream tools**
259
260 =========================== ============================ ================
261 Name Output file Format
262 =========================== ============================ ================
263 xcms.groupChromPeaks ``*``.groupChromPeaks.RData rdata.xcms.group
264 =========================== ============================ ================
265
266
267 **General schema of the metabolomic workflow**
268
269 .. image:: xcms_retcor_workflow.png
270
271 ---------------------------------------------------
272
273 ----------
274 Parameters
275 ----------
276
277 Method
278 ------
279
280 **PeakGroups**
281
282 | This method performs retention time adjustment based on the alignment of chromatographic peak groups present in all/most samples (hence corresponding to house keeping compounds). First the retention time deviation of these peak groups is described by fitting either a polynomial (‘smooth = "loess"’) or a linear ( ‘smooth = "linear"’) model to the data points. These models are subsequently used to adjust the retention time of each spectrum in each sample.
283 | See the PeakGroups_manual_
284
285 **Obiwarp**
286
287 | This method performs retention time adjustment using the Obiwarp method [Prince 2006]. It is based on the code at http://obi-warp.sourceforge.net but supports alignment of multiple samples by aligning each against a _center_ sample. The alignment is performed directly on the ‘profile-matrix’ and can hence be performed independently of the peak detection or peak grouping.
288 | See the Obiwarp_manual_
289
290 .. _PeakGroups_manual: https://rdrr.io/bioc/xcms/man/adjustRtime-peakGroups.html#heading-2
291 .. _Obiwarp_manual: https://rdrr.io/bioc/xcms/man/adjustRtime-obiwarp.html
292
293 WARNING: if a retention time ajustment have already been applied to your data.
294 The function applyAdjustedRtime will replace raw retention times with adjusted retention times and so alloww to cumulate the ajustments.
295
296 @HELP_XCMS_MANUAL@
297
298 ------------
299 Output files
300 ------------
301
302 xset.groupChromPeaks.adjustRtime.RData: rdata.xcms.retcor format
303
304 | Rdata file that will be necessary in the **xcms.groupChromPeaks** step of the workflow.
305
306
307 ---------------------------------------------------
308
309 Changelog/News
310 --------------
311
312 @HELP_XCMS_NEWVERSION_31200@
313
314 **Version 3.6.1+galaxy1 - 13/02/2020**
315
316 - NEW: if a retention time ajustment have already been applied to your data. The function applyAdjustedRtime will replace raw retention times with adjusted retention times and so alloww to cumulate the ajustments.
317
318 @HELP_XCMS_NEWVERSION_3610@
319
320 **Version 3.4.4.1 - 30/04/2019**
321
322 - BUGFIX: remove the pre-compute of the chromatograms which was memory consuming. Now, only xcms plot chromatogram will generate the Chromatograms.
323
324 @HELP_XCMS_NEWVERSION_3440@
325
326 **Version 3.0.0.0 - 08/03/2018**
327
328 - UPGRADE: upgrade the xcms version from 1.46.0 to 3.0.0. So refactoring of a lot of underlying codes and methods. Some parameters may have been renamed.
329
330 - NEW: a bunch of new options: Obiwarp.(centerSample, response, distFun, gapInit, gapExtend, factorDiag, factorGap, localAlignment, initPenalty)
331
332 - IMPROVEMENT: the advanced options are now in sections. It will allow you to access to all the parameters and to know their default values.
333
334 - CHANGE: removing of the TIC and BPC plots. You can now use the dedicated tool "xcms plot chromatogram"
335
336
337 **Version 2.1.1 - 29/11/2017**
338
339 - BUGFIX: To avoid issues with accented letter in the parentFile tag of the mzXML files, we changed a hidden mechanim to LC_ALL=C
340
341
342 **Version 2.1.0 - 03/02/2017**
343
344 - IMPROVEMENT: xcms.retcor can deal with merged individual data
345
346
347 **Version 2.0.8 - 22/12/2016**
348
349 - BUGFIX: when having only one group (i.e. one folder of raw data) the BPC and TIC pdf files do not contain any graph
350
351
352 @HELP_XCMS_NEWVERSION_2090@
353
354
355 **Version 2.0.6 - 04/04/2016**
356
357 - TEST: refactoring to pass planemo test using conda dependencies
358
359
360 **Version 2.0.5 - 10/02/2016**
361
362 - BUGFIX: better management of errors. Datasets remained green although the process failed
363
364 - BUGFIX: some pdf remained empty even when the process succeed
365
366 - UPDATE: refactoring of internal management of inputs/outputs
367
368 - UPDATE: refactoring to feed the new report tool
369
370
371 **Version 2.0.2 - 02/06/2015**
372
373 - IMPROVEMENT: new datatype/dataset formats (rdata.xcms.raw, rdata.xcms.group, rdata.xcms.retcor ...) will facilitate the sequence of tools and so avoid incompatibility errors.
374
375 - IMPROVEMENT: parameter labels have changed to facilitate their reading.
376
377
378 ]]></help>
379
380
381 <expand macro="citation" />
382
383 </tool>