view ipo4xcmsSet.xml @ 2:8e5f667359cb draft default tip

planemo upload for repository https://github.com/rietho/IPO commit d25c744220e416cce158161fa7dc3b0f153a5c11
author workflow4metabolomics
date Mon, 11 Sep 2023 22:37:32 +0000
parents ae8de756dfcf
children
line wrap: on
line source

<tool id="ipo4xcmsSet" name="IPO for xcmsSet" version="@TOOL_VERSION@+galaxy1">

    <description>IPO optimization process for xcms.findChromPeaks</description>

    <macros>
        <import>macros.xml</import>
    </macros>

    <expand macro="requirements"/>

    <command detect_errors="exit_code"><![CDATA[
        LANG=C Rscript '$__tool_directory__/ipo4xcmsSet.r'

        singlefile_galaxyPath '$input' singlefile_sampleName '$input.element_identifier'

        samplebyclass $samplebyclass

        ## profmethod $profmethod
        @COMMAND_NSLAVES@
        method $methods.method
        #if $methods.method == "centWave":
            ppm "c($methods.section_centwave_optiomizable.ppm)"
            min_peakwidth "c($methods.section_centwave_optiomizable.min_peakwidth)"
            max_peakwidth "c($methods.section_centwave_optiomizable.max_peakwidth)"
            mzdiff "c($methods.section_centwave_optiomizable.mzdiff)"

            snthresh $methods.section_centwave_non_optiomizable.snthresh
            integrate $methods.section_centwave_non_optiomizable.integrate
            noise $methods.section_centwave_non_optiomizable.noise
            prefilter "c($methods.section_centwave_non_optiomizable.prefilter)"

        #elif $methods.method == "matchedFilter":
            fwhm "c($methods.section_matchedfilter_optiomizable.fwhm)"
            mzdiff "c($methods.section_matchedfilter_optiomizable.mzdiff)"

            step $methods.section_matchedfilter_non_optimizable.step
            steps $methods.section_matchedfilter_non_optimizable.steps
            max $methods.section_matchedfilter_non_optimizable.max
            snthresh $methods.section_matchedfilter_non_optimizable.snthresh
        #end if
    ]]></command>

    <inputs>

        <param name="input" type="data" format="mzxml,mzml,mzdata,netcdf" label="File(s) from your history containing your chromatograms" help="Single file mode for the format: mzxml, mzml, mzdata and netcdf. See the help section below." />

        <param name="samplebyclass" type="integer" value="2" label="Number of samples used per class to estimate the best parameters" help="Set to 0 to use the whole dataset. To save time, reduce this number" />

        <conditional name="methods">
            <param argument="method" type="select" label="Extraction method for peaks detection (findChromPeaks)" help="See the help section below">
                <option value="centWave" >centWave</option>
                <option value="matchedFilter" selected="true">matchedFilter</option>
            </param>

            <!-- centWave Filter options -->
            <when value="centWave">
                <section name="section_centwave_optiomizable"  title="Optimizable parameters" expanded="True">
                    <param argument="ppm" type="text" value="17,32" label="Range or a fixed value for Max tolerated ppm m/z deviation in consecutive scans in ppm" optional="false" help="(ex: 25 or 17,32)">
                        <expand macro="input_validator_range_integer"/>
                    </param>
                    <param argument="min_peakwidth" type="text" value="12,18" label="Range or a fixed value for Min peak width range in seconds" optional="true" help="(ex: 12,18)">
                        <expand macro="input_validator_range_float"/>
                    </param>
                    <param argument="max_peakwidth" type="text" value="35,65" label="Range or a fixed value  for Max peak width range in seconds" optional="true" help="(ex: 35,65)">
                        <expand macro="input_validator_range_float"/>
                    </param>
                    <param argument="mzdiff" type="text" value="-0.001,0.010" label="Range or a fixed value  for Minimum difference in m/z for peaks with overlapping retention times" help="Can be negative to allow overlap (ex: -0.001,0.010)">
                        <expand macro="input_validator_range_float_neg"/>
                    </param>
                </section>

                <section name="section_centwave_non_optiomizable"  title="Non optimizable parameters" expanded="True">
                    <param argument="snthresh" type="integer" value="10" label="Signal/Noise threshold" help="Signal to noise ratio cutoff" />
                    <param argument="integrate" type="select" label="Peak limits method" >
                        <option value="1">peak limits based on smoothed 2nd derivative (less precise)</option>
                        <option value="2">peak limits based on real data (more sensitive to noise)</option>
                    </param>
                    <param argument="prefilter" type="text" value="3,100" label="Prefilter step for the first phase" help="Separate by coma k,I. Mass traces are only retained if they contain at least ‘k’ peaks with intensity >= ‘I’"/>
                    <param argument="noise" type="integer" value="0" label="Noise filter" help="optional argument which is useful for data that was centroided without any intensity threshold, centroids with intensity smaller than ‘noise’ are omitted from ROI detection"/>
                </section>
            </when>

            <!-- matched Filter options -->
            <when value="matchedFilter">
                <section name="section_matchedfilter_optiomizable"  title="Optimizable parameters" expanded="True">
                    <param argument="fwhm" type="text" value="25,35" label="Range or a fixed value for Full width at half maximum of matched filtration gaussian model peak" optional="true" help="Only used to calculate the actual sigma (ex: 25,35)">
                        <expand macro="input_validator_range_integer"/>
                    </param>
                    <param argument="mzdiff" type="text" value="0.4,0.7" label="Range or a fixed value for Minimum difference in m/z for peaks with overlapping Retention Times" help="By default: 0.8-step*steps (ex: 0.4,0.7)">
                        <expand macro="input_validator_range_float_neg"/>
                    </param>
                </section>

                <section name="section_matchedfilter_non_optimizable" title="Non optimizable parameters"  expanded="True">
                    <param argument="step" type="float" value="0.1" label="Step size to use for profile generation" help="The peak detection algorithm creates extracted ion base peak chromatograms (EIBPC) on a fixed step size" />
                    <param argument="steps" type="integer" value="2" label="Number of steps to merge prior to filtration" help="The peak identification algorithm combines a given number of EIBPCs prior to filtration and peak detection, as defined by the steps argument" />
                    <param argument="max" type="integer" value="5" label="Maximum number of peaks per extracted ion chromatogram" />
                    <param argument="snthresh" type="integer" value="10" label="Signal to noise ratio cutoff" />
                </section>
            </when>
        </conditional>


    </inputs>

    <outputs>
        <data name="xsetRData" format="rdata.xcms.raw" label="ipo4xcmsSet.RData"  from_work_dir="ipo4xcmsSet.RData" />
        <data name="parametersOutput" format="tabular" label="IPO_parameters4xcmsSet.tsv"  from_work_dir="IPO_parameters4xcmsSet.tsv" />
    </outputs>

    <tests>
        <test>
            <param name="input" value="MM14.mzML"  ftype="mzxml" />
            <param name="samplebyclass" value="0" />
            <conditional name="methods">
                <param name="method" value="centWave" />
                <section name="section_centwave_optiomizable" >
                    <param name="min_peakwidth" value="3,9.5" />
                    <param name="max_peakwidth" value="10,20" />
                    <param name="ppm" value="56" />
                    <param name="mzdiff" value="-0.001" />
                </section>
            </conditional>
            <output name="parametersOutput" file="MM14_IPO_parameters4xcmsSet_peakwidth.tsv" />
        </test>
        <test>
            <param name="input" value="MM14.mzML"  ftype="mzxml" />
            <param name="samplebyclass" value="0" />
            <conditional name="methods">
                <param name="method" value="centWave" />
                <section name="section_centwave_optiomizable" >
                    <param name="ppm" value="50,60" />
                    <param name="min_peakwidth" value="3.325" />
                    <param name="max_peakwidth" value="11.0" />
                    <param name="mzdiff" value="-0.001" />
                </section>
            </conditional>
            <output name="parametersOutput">
                <assert_contents>
                    <!-- &#009; is XML escape code for tab -->
                    <has_line line="ppm&#009;60" />
                    <has_line line="min_peakwidth&#009;3.325" />
                    <has_line line="max_peakwidth&#009;11" />
                    <has_line line="mzdiff&#009;-0.001" />
                    <has_line line="prefilter&#009;3" />
                    <has_line line="snthresh&#009;10" />
                    <has_line line="integrate&#009;1" />
                    <has_line line="noise&#009;0" />
                    <has_line line="value_of_prefilter&#009;100" />
                    <has_line line="mzCenterFun&#009;wMean" />
                    <has_line line="fitgauss&#009;FALSE" />
                </assert_contents>
            </output>
        </test>
    </tests>

    <help><![CDATA[

@HELP_AUTHORS@

===============
IPO.ipo4xcmsSet
===============

-----------
Description
-----------

A Tool for automated Optimization of XCMS Parameters


-----------------
Workflow position
-----------------

**Upstream tools**

========================= ========================
Name                      Format
========================= ========================
Upload File               mzxml,mzml,mzdata,netcdf
========================= ========================

The easier way to process is to create a Dataset Collection of the type List


**Downstream tools**

+---------------------------+----------------------+-----------------+
| Name                      | Output file          | Format          |
+===========================+======================+=================+
|xcms.xcmsSet               | parametersOutput.tsv | Tabular         |
+---------------------------+--------------------+-------------------+



-----------
Input files
-----------

Advices for converting your files for the XCMS input
----------------------------------------------------

We recommend you to convert your raw files to **mzXML** in centroid mode (smaller files) and the files will be compatible with the xmcs centWave method.

**We recommend you the following parameters:**

Use Filtering: **True**

Use Peak Picking: **True**

Peak Peaking -Apply to MS Levels: **All Levels (1-)** : Centroid Mode

Use zlib: **64**

Binary Encoding: **64**

m/z Encoding: **64**

Intensity Encoding: **64**


----------
Parameters
----------

Extraction method for findChromPeaks
-------------------------------------

**MatchedFilter**

    | The matchedFilter algorithm identifies peaks in the chromatographic time domain as described in [Smith 2006]. The intensity values are binned by cutting The LC/MS data into slices (bins) of a mass unit (‘binSize’ m/z) wide. Within each bin the maximal intensity is selected. The chromatographic peak detection is then performed in each bin by extending it based on the ‘steps’ parameter to generate slices comprising bins ‘current_bin - steps +1’ to ‘current_bin + steps - 1’. Each of these slices is then filtered with matched filtration using a second-derative Gaussian as the model peak shape. After filtration peaks are detected using a signal-to-ratio cut-off. For more details and illustrations see [Smith 2006].
    | See the MatchedFilter_manual_

**CentWave**

    | The centWave algorithm perform peak density and wavelet based chromatographic peak detection for high resolution LC/MS data in centroid mode [Tautenhahn 2008].
    | Due to the fact that peak centroids are used, a binning step is not necessary.
    | The method is capable of detecting close-by-peaks and also overlapping peaks. Some efforts are made to detect the exact peak boundaries to get precise peak integrals.
    | See the CentWave_manual_

.. _MatchedFilter_manual: https://rdrr.io/bioc/xcms/man/findChromPeaks-matchedFilter.html#heading-2
.. _CentWave_manual: https://rdrr.io/bioc/xcms/man/findChromPeaks-centWave.html#heading-2

---------------------------------------------------

Changelog/News
--------------

@HELP_NEWVERSION_1_10_0_0@

    ]]></help>

    <expand macro="citation" />
</tool>