view proteomiqon_mzmltomzlite.xml @ 0:529b61ba3d64 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/proteomIQon_MzMLToMzLite commit adc8b0dc45ba060c7c82ab3df028141339956475"
author galaxyp
date Wed, 30 Jun 2021 16:31:24 +0000
parents
children acb8aba959ed
line wrap: on
line source

<tool id="proteomiqon_mzmltomzlite" name="ProteomIQon MzMLToMzLite" version="@VERSION@" python_template_version="20.05">
	<description>
		converts mzML files to mzLite files.
	</description>
	<macros>
		<token name="@VERSION@">0.0.5</token>
	</macros>
    <requirements>
        <requirement type="package" version="@VERSION@">proteomiqon-mzmltomzlite</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        #import re
        #set basename = $re.sub(r'[^\w ,.\-+]','_',$instrumentOutput.element_identifier)
        #if $outputParamfile:
            cat '$paramfile' >> '$out_paramfile' &&
        #end if
        ln -s $instrumentOutput '${basename}.mzML' &&
        ln -s $out_mzlite '${basename}.mzlite' &&
        proteomiqon-mzmltomzlite -i './${basename}.mzML' -p $paramfile -o ./
    ]]>
    </command>
    <configfiles>
        <configfile name="paramfile">
            <![CDATA[
            {
                "Compress":${BinaryDataCompressionType},
            #if $StartRetentionTime
                "StartRetentionTime":
                {
                    "Case" : "Some",
                    "Fields" : [
                        ${StartRetentionTime}
                    ],
                },

            #else
                "StartRetentionTime":null,
            #end if
            #if $EndRetentionTime
                "EndRetentionTime":
                {
                    "Case" : "Some",
                    "Fields" : [
                        ${EndRetentionTime}
                    ],
                },
            #else
                "EndRetentionTime":null,
            #end if
                "MS1PeakPicking": {
                    "Case": "${Ms1PeakPickingCond.Ms1PeakPicking}",
                #if $Ms1PeakPickingCond.Ms1PeakPicking == "Centroid"
                    "Fields" : 
                    [ 
                        {
                            "Case" : "${Ms1PeakPickingCond.CentroidModeCond.CentroidMode}",
                        #if $Ms1PeakPickingCond.CentroidModeCond.CentroidMode == "Wavelet"
                            "Fields" : 
                            [
                                {
                                    "NumberOfScales" : ${Ms1PeakPickingCond.CentroidModeCond.NumberOfScales},
                                    "YThreshold" : 
                                    {
                                        "Case" : "${Ms1PeakPickingCond.CentroidModeCond.YThresholdCond.YThreshold}",
                                    #if $Ms1PeakPickingCond.CentroidModeCond.YThresholdCond.YThreshold == "Fixed"
                                        "Fields": 
                                        [
                                            ${Ms1PeakPickingCond.CentroidModeCond.YThresholdCond.Ms1YThreshold},
                                        ]
                                    #end if 
                                    },
                                    "Centroid_MzTolerance" : ${Ms1PeakPickingCond.CentroidModeCond.Centroid_MzTolerance},
                                    "SNRS_Percentile" : ${Ms1PeakPickingCond.CentroidModeCond.SNRS_Percentile},
                                    "MinSNR" : ${Ms1PeakPickingCond.CentroidModeCond.MinSNR},
                                    "RefineMZ" : ${Ms1PeakPickingCond.CentroidModeCond.RefineMZ},
                                    "SumIntensities" : ${Ms1PeakPickingCond.CentroidModeCond.SumIntensities},
                                #if $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.usePaddingparams == "yes"
                                    "PaddingParams" : 
                                    {
                                        "Case" : "Some",
                                        "Fields" :
                                        [
                                            {
                                            #if $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.MaximumPaddingPointsCond.specifyMaximumPaddingPoints == "yes"
                                                "MaximumPaddingPoints" : {
                                                    "Case" : "Some",
                                                    "Fields" : [
                                                        $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.MaximumPaddingPointsCond.MaximumPaddingPoints
                                                    ]
                                                },
                                            #else
                                                "MaximumPaddingPoints" : null,
                                            #end if
                                                "Padding_MzTolerance" : $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.Padding_MzTolerance,
                                                "WindowSize" : $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.WindowSize,
                                                "SpacingPerc" : $Ms1PeakPickingCond.CentroidModeCond.PaddingParamsCond.SpacingPerc
                                            }
                                        ]

                                    }
                                #else
                                    "PaddingParams" : null
                                #end if
                                }
                               
                            ]
                        #end if
                        }
                    ]
                #end if
                },
                "MS2PeakPicking": {
                    "Case": "${Ms2PeakPickingCond.Ms2PeakPicking}",
                #if $Ms2PeakPickingCond.Ms2PeakPicking == "Centroid"
                    "Fields" : 
                    [ 
                        {
                            "Case" : "${Ms2PeakPickingCond.CentroidModeCond.CentroidMode}",
                        #if $Ms2PeakPickingCond.CentroidModeCond.CentroidMode == "Wavelet"
                            "Fields" : 
                            [
                                {
                                    "NumberOfScales" : ${Ms2PeakPickingCond.CentroidModeCond.NumberOfScales},
                                    "YThreshold" : 
                                    {
                                        "Case" : "${Ms2PeakPickingCond.CentroidModeCond.YThresholdCond.YThreshold}",
                                    #if $Ms2PeakPickingCond.CentroidModeCond.YThresholdCond.YThreshold == "Fixed"
                                        "Fields": 
                                        [
                                            ${Ms2PeakPickingCond.CentroidModeCond.YThresholdCond.Ms2YThreshold},
                                        ]
                                    #end if 
                                    },
                                    "Centroid_MzTolerance" : ${Ms2PeakPickingCond.CentroidModeCond.Centroid_MzTolerance},
                                    "SNRS_Percentile" : ${Ms2PeakPickingCond.CentroidModeCond.SNRS_Percentile},
                                    "MinSNR" : ${Ms2PeakPickingCond.CentroidModeCond.MinSNR},
                                    "RefineMZ" : ${Ms2PeakPickingCond.CentroidModeCond.RefineMZ},
                                    "SumIntensities" : ${Ms2PeakPickingCond.CentroidModeCond.SumIntensities},
                                #if $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.usePaddingparams == "yes"
                                    "PaddingParams" : 
                                    {
                                        "Case" : "Some",
                                        "Fields" :
                                        [
                                            {
                                            #if $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.MaximumPaddingPointsCond.specifyMaximumPaddingPoints == "yes"
                                                "MaximumPaddingPoints" : {
                                                    "Case" : "Some",
                                                    "Fields" : [
                                                        $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.MaximumPaddingPointsCond.MaximumPaddingPoints
                                                    ]
                                                },
                                            #else
                                                "MaximumPaddingPoints" : null,
                                            #end if
                                                "Padding_MzTolerance" : $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.Padding_MzTolerance,
                                                "WindowSize" : $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.WindowSize,
                                                "SpacingPerc" : $Ms2PeakPickingCond.CentroidModeCond.PaddingParamsCond.SpacingPerc
                                            }
                                        ]

                                    }
                                #else
                                    "PaddingParams" : null
                                #end if
                                }
                               
                            ]
                        #end if
                        }
                    ]
                #end if
                }
            }
            ]]>
        </configfile>
    </configfiles>
    <inputs>
        <param name="instrumentOutput" type="data" format="mzml" label="Instrument output" help="Please specify the .mzML file you want to convert"/>
        <param name="BinaryDataCompressionType" type="select" label="Binary data compression type">
            <option value="0" selected="true">No compression</option>
            <option value="1">ZLib</option>
            <option value="2">Num press</option>
            <option value="3">Num press ZLib</option>
            <option value="4">Num press Pic</option>
            <option value="5">Num press Lin</option>
        </param>
        <param name="StartRetentionTime" type="float" optional="true" label="Start retention time" help="You can optionally specify a minimum scan time. MS scans measured earlier will not be copied."/>
        <param name="EndRetentionTime" type="float" optional="true" label="End retention time" help="You can optionally specify a maximum scan time. MS scans measured at a later scan time will not be copied."/>
        <conditional name="Ms1PeakPickingCond">
            <param name="Ms1PeakPicking" type="select" label="MS1 peak picking">
                <option value="ProfilePeaks" selected="true">Profile peaks</option>
                <option value="Centroid">Centroid</option>
            </param>
            <when value="Centroid">
                <conditional name="CentroidModeCond">
                    <param name="CentroidMode" type="select" label="Centroidization mode">
                        <option value="Manufacturer">Manufacturer</option>
                        <option value="Wavelet">Wavelet</option>
                    </param>
                    <when value="Wavelet">
                        <param name="NumberOfScales" type="integer" value="0" label="Number of scales"/>
                        <conditional name="YThresholdCond">
                            <param name="YThreshold" type="select" label="Y threshold">
                                <option value="Fixed" selected="true">Fixed</option>
                                <option value="MinSpectrumIntensity">Min spectrum intensity</option>
                            </param>
                            <when value="Fixed">
                                <param name="Ms1YThreshold" type="float" value="0" label="Value"/>
                            </when>
                        </conditional>
                        <param name="Centroid_MzTolerance" type="float" value="0" label="Centroid MZ tolerance"/>
                        <param name="SNRS_Percentile" type="float" value="0" label="SNRS percentile"/>
                        <param name="MinSNR" type="float" value="0" label="Min SNR"/>
                        <param name="RefineMZ" type="boolean" value="false" label="Refine MZ"/>
                        <param name="SumIntensities" type="boolean" value="false" label="Sum intensities"/>
                        <conditional name="PaddingParamsCond">
                            <param name="usePaddingparams" type="select" checked="false" label="Specify padding parameters">
                                <option value="yes">Yes</option>
                                <option value="no">No</option>
                            </param>           
                            <when value="yes">
                                <conditional name="MaximumPaddingPointsCond">
                                    <param name="specifyMaximumPaddingPoints" type="select" label="Speficy maximum padding points">
                                        <option value="yes">Yes</option>
                                        <option value="no">No</option>
                                    </param>
                                    <when value="yes">
                                        <param name="MaximumPaddingPoints" type="integer" value="0" label="Maximum padding points"/>
                                    </when>        
                                </conditional>
                                <param name="Padding_MzTolerance" type="float" value="0" label="Padding MZ tolerance"/>
                                <param name="WindowSize" type="integer" value="0" label="Window size"/>
                                <param name="SpacingPerc" type="float" value="0" label="Spacing perc"/>
                            </when>
                        </conditional>
                    </when>
                </conditional>
            </when>
        </conditional>
        <conditional name="Ms2PeakPickingCond">
            <param name="Ms2PeakPicking" type="select" label="MS2 peak picking">
                <option value="ProfilePeaks" selected="true">Profile peaks</option>
                <option value="Centroid">Centroid</option>
            </param>
            <when value="Centroid">
                <conditional name="CentroidModeCond">
                    <param name="CentroidMode" type="select" label="Centroidization mode">
                        <option value="Manufacturer">Manufacturer</option>
                        <option value="Wavelet">Wavelet</option>
                    </param>
                    <when value="Wavelet">
                        <param name="NumberOfScales" type="integer" value="0" label="Number of scales"/>
                        <conditional name="YThresholdCond">
                            <param name="YThreshold" type="select" label="Y threshold">
                                <option value="Fixed" selected="true">Fixed</option>
                                <option value="MinSpectrumIntensity">Min spectrum intensity</option>
                            </param>
                            <when value="Fixed">
                                <param name="Ms2YThreshold" type="float" value="0" label="Value"/>
                            </when>
                        </conditional>
                        <param name="Centroid_MzTolerance" type="float" value="0" label="Centroid MZ tolerance"/>
                        <param name="SNRS_Percentile" type="float" value="0" label="SNRS percentile"/>
                        <param name="MinSNR" type="float" value="0" label="Min SNR"/>
                        <param name="RefineMZ" type="boolean" value="false" label="Refine MZ"/>
                        <param name="SumIntensities" type="boolean" value="false" label="Sum intensities"/>
                        <conditional name="PaddingParamsCond">
                            <param name="usePaddingparams" type="select" label="Specify padding parameters">
                                <option value="yes">Yes</option>
                                <option value="no">No</option>
                            </param>    
                            <when value="yes">
                                <conditional name="MaximumPaddingPointsCond">
                                    <param name="specifyMaximumPaddingPoints" type="select" label="Speficy maximum padding points">
                                        <option value="yes">Yes</option>
                                        <option value="no">No</option>
                                    </param>
                                    <when value="yes">
                                        <param name="MaximumPaddingPoints" type="integer" value="0" label="Maximum padding points"/>
                                    </when>        
                                </conditional>
                                <param name="Padding_MzTolerance" type="float" value="0" label="Padding MZ tolerance"/>
                                <param name="WindowSize" type="integer" value="0" label="Window size"/>
                                <param name="SpacingPerc" type="float" value="0" label="Spacing perc"/>
                            </when>
                        </conditional>
                    </when>
                </conditional>
            </when>
        </conditional>
        <param name="outputParamfile" type="boolean" value="false" label="Output parameter file"/>
    </inputs>
    <outputs>
        <data format="sqlite" name="out_mzlite" />
        <data format="json" name="out_paramfile">
            <filter>outputParamfile</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <param name="instrumentOutput" value="sample.mzml"/>
            <param name="BinaryDataCompressionType" value="0"/>
            <param name="StartRetentionTime" value=""/>
            <param name="EndRetentionTime" value=""/>
            <conditional name="Ms1PeakPickingCond">
                <param name="Ms1PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <conditional name="Ms2PeakPickingCond">
                <param name="Ms2PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <param name="outputParamfile" value="true"/>
            <output name="out_paramfile" file="result_1.json"/>
        </test>
        <test expect_num_outputs="2">
            <param name="instrumentOutput" value="sample.mzml"/>
            <param name="BinaryDataCompressionType" value="0"/>
            <param name="StartRetentionTime" value=""/>
            <param name="EndRetentionTime" value=""/>
            <conditional name="Ms1PeakPickingCond">
                <param name="Ms1PeakPicking" value="Centroid"/>
                <conditional name="CentroidModeCond">
                    <param name="CentroidMode" value="Wavelet"/>
                    <param name="NumberOfScales" value="3"/>
                    <conditional name="YThresholdCond">
                        <param name="YThreshold" value="Fixed"/>
                        <param name="Ms1YThreshold" value="1"/>
                    </conditional>
                    <param name="Centroid_MzTolerance" value="0.1"/>
                    <param name="SNRS_Percentile" value="95.0"/>
                    <param name="MinSNR" value="1.0"/>
                    <param name="RefineMZ" value="false"/>
                    <param name="SumIntensities" value="false"/>
                    <conditional name="PaddingParamsCond">
                        <param name="usePaddingparams" value="no"/>
                    </conditional>
                </conditional>
            </conditional>
            <conditional name="Ms2PeakPickingCond">
                <param name="Ms2PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <param name="outputParamfile" value="true"/>
            <output name="out_paramfile" file="result_2.json"/>
        </test>
        <test expect_num_outputs="2">
            <param name="instrumentOutput" value="sample.mzml"/>
            <param name="BinaryDataCompressionType" value="0"/>
            <param name="StartRetentionTime" value=""/>
            <param name="EndRetentionTime" value=""/>
            <conditional name="Ms1PeakPickingCond">
                <param name="Ms1PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <conditional name="Ms2PeakPickingCond">
                <param name="Ms2PeakPicking" value="Centroid"/>
                <conditional name="CentroidModeCond">
                    <param name="CentroidMode" value="Wavelet"/>
                    <param name="NumberOfScales" value="10"/>
                    <conditional name="YThresholdCond">
                        <param name="YThreshold" value="MinSpectrumIntensity"/>
                    </conditional>
                    <param name="Centroid_MzTolerance" value="0.1"/>
                    <param name="SNRS_Percentile" value="95.0"/>
                    <param name="MinSNR" value="1.0"/>
                    <param name="RefineMZ" value="false"/>
                    <param name="SumIntensities" value="false"/>
                    <conditional name="PaddingParamsCond">
                        <param name="usePaddingparams" value="yes"/>
                        <conditional name="MaximumPaddingPointsCond">
                            <param name="specifyMaximumPaddingPoints" value="yes" />
                            <param name="MaximumPaddingPoints" value="7" />
                        </conditional>
                        <param name="Padding_MzTolerance" value="0.005" />
                        <param name="WindowSize" value="150"/>
                        <param name="SpacingPerc" value="95"/>
                    </conditional>
                </conditional>
            </conditional>
            <param name="outputParamfile" value="true"/>
            <output name="out_paramfile" file="result_3.json"/>
        </test>
        <test expect_num_outputs="2">
            <param name="instrumentOutput" value="sample.mzml"/>
            <param name="BinaryDataCompressionType" value="0"/>
            <param name="StartRetentionTime" value="6.75"/>
            <param name="EndRetentionTime" value="6.75"/>
            <conditional name="Ms1PeakPickingCond">
                <param name="Ms1PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <conditional name="Ms2PeakPickingCond">
                <param name="Ms2PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <param name="outputParamfile" value="true"/>
            <output name="out_paramfile" file="result_4.json"/>
        </test>
         <test expect_num_outputs="1">
            <param name="instrumentOutput" value="sample.mzml"/>
            <param name="BinaryDataCompressionType" value="0"/>
            <param name="StartRetentionTime" value="6.75"/>
            <param name="EndRetentionTime" value="6.75"/>
            <conditional name="Ms1PeakPickingCond">
                <param name="Ms1PeakPicking" value="ProfilePeaks"/>
            </conditional>
            <conditional name="Ms2PeakPickingCond">
                <param name="Ms2PeakPicking" value="ProfilePeaks"/>
            </conditional>
        </test>
    </tests>
    <help>
    <![CDATA[
Introduction
------------
The success of modern proteomics was made possible by constant progression in the field of mass spectrometry. 
Over the course of the past years quite a few manufacturers of mass spectrometers have managed to establish themselfes in the field of biological research. 
Since aquisition and accession of mass spectra are performance critical processes, various performance optimized, but vendor specific and closed source formats have been developed to store raw MS data. 
This comes to the disadvantage for toolchain developers which want to provide tools for every scientist regardless of the format of their raw data.

In a effort to provide an open format for the storage of MS data the format mzML was developed. While this XML based format is straight forward to implement it falls behind in performance critical scenarios. 
To be competitive in performance and to comply to the FAIR principles we chose to use mzLite, an open and SQLite based implementation of mzML, within our toolchain.

What It Does
------------
The tool mzMLToMzLite allows to convert mzML files to mzLite files. Additionally, it allows the user to perform peak picking or filtering of mass spectra.
We recommend the use of `_msconvert <https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/galaxyp/msconvert/msconvert/3.0.20287.2>`_ to convert your raw data into .mzML. 

Further Reading
---------------
Additional information about the tool can be found in the `_documentation <https://csbiology.github.io/ProteomIQon/tools/MzMLToMzLite.html>`_.
    ]]>
    </help>
</tool>