view dimsPredictPuritySingle.xml @ 6:090775983be7 draft

"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
author computational-metabolomics
date Thu, 04 Mar 2021 12:24:27 +0000
parents e96082a25ff0
children 2ce66d2f6a24
line wrap: on
line source

<tool id="mspurity_dimspredictpuritysingle" name="msPurity.dimsPredictPuritySingle" version="@TOOL_VERSION@+galaxy@GALAXY_TOOL_VERSION@">
    <description>Calculate the anticipated precursor ion purity from a DIMS dataset.</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        Rscript '$__tool_directory__/dimsPredictPuritySingle.R'
            #if $mzML_data.format == 'mzML_file'
                --mzML_file '$mzML_data.source'
            #elif $mzML_data.format == 'library'
                --mzML_file '$__app__.config.user_library_import_dir/$__user_email__/$mzML_data.source'
            #elif $mzML_data.format == 'mzML_data_collection'
                --mzML_files='
                #for $i in $mzML_data.source
                    $i,
                #end for
                '
                --galaxy_names='
                #for $i in $mzML_data.source
                    $i.name,
                #end for
                '
                --mzML_filename=' $mzML_data.mzML_filename'

            #end if
            --peaks_file='$peaks_file'
            --out_dir='.'
            --minoffset=$minoffset
            --maxoffset=$maxoffset
            --ppm=$ppm
            --iwNorm=$iw_norm
            --ilim=$ilim
            #if $sim
                --sim
            #end if
            #if $remove_NAs
                --remove_nas
            #end if
            #if $dimspy_usage.usage == "dimspy"
                --dimspy
                --file_num_dimspy $dimspy_usage.file_num_dimspy
            #end if
            #if $isotopes.isotopes == "exclude_default":
                --exclude_isotopes
            #elif $isotopes.isotopes == "user"
                --exclude_isotopes
                --isotope_matrix = '$isotopes.im'
            #end if
    ]]></command>
    <inputs>

        <param argument="--peaks_file"  type="data" format="tsv, tabular"
                help="tsv or tabular file with one column containing the mz values (column header should be either
                      mz)"/>

        <conditional name="mzML_data">
            <param name="format" type="select" label="Choose the source for the dataset" >
                <option value="mzML_file" selected="true">A single .mzML files to check purity from</option>
                <option value="library">Library directory name (to be used with dimspy workflows) or path to
                                        to an individual .mzML file</option>
                <option value="mzML_data_collection" selected="true">A data collection of .mzML files</option>
            </param>
            <when value="mzML_file">
                <param argument="--mzML_file" name="source" type="data" format="mzml" label="Single *.mzML"  >
                    <validator type="empty_field" />
                </param>
            </when>
            <when value="mzML_data_collection">
                <param argument="--mzML_files" name="source" type="data_collection" 
                label="Data collection containing *.mzml files" >
                    <validator type="empty_field" />
                </param>
                <param argument="--mzML_filename" type="text" label="Name of file to to calculate purity from" help=""/>
            </when>

            <when value="library">
                <param  argument="--mzML_file" name="source" type="text"
                       size="40" label="Library directory containing *.mzml files (dimspy input only)
                                                                 or path to an individual .mzML file">
                    <validator type="empty_field" />
                </param>
            </when>

        </conditional>

        <expand macro="general_params" />
        <expand macro="offsets" />

        <param argument="--ppm" type="float" label="ppm" min="0" value="10"
                    help="ppm tolerance to compare between mz values"/>
        <param argument="--remove_NAs" type="boolean" label="Remove rows where mz value is NA or NaN?" help=""/>
        <param argument="--sim" type="boolean" label="SIM-Stitch experiment?" help=""/>
        <conditional name="dimspy_usage">
            <param name="usage" type="select" label="dimspy peak matrix text file usage?">
                <option value="no_dimspy" selected="true">dimspy not used to prepare the mz text file</option>
                <option value="dimspy">dimspy used to prepare mz file</option>
            </param>
            <when value="no_dimspy">
            </when>
            <when value="dimspy">
                <param argument="--file_num_dimspy" type="integer" label="File number" min="0" value="1"
                    help="Choose the file number from the dimspy matrix to use to calculate the precursor ion
                          purity metric (order based on column order). This file will then be looked for in the
                          library folder to calculate the metric.
                         "/>
            </when>
        </conditional>

    </inputs>
    <outputs>
	    <data name="dimsPredictPuritySingle_output"  format="tsv" label="${tool.name} on ${on_string}"
              from_work_dir="dimsPredictPuritySingle_output.tsv" />
    </outputs>
    <tests>
        <test>
            <param name="mzML_data|format" value="mzML_file"   />
            <param name="mzML_data|source" value="dimsPredictPuritySingle_full_scan.mzML" />
            <param name="remove_NAs" value="True" />
            <param name="dimspy_usage|usage" value="dimspy" />
            <param name="dimspy_usage|file_num_dimspy" value="1" />
            <param name="peaks_file" value="dimsPredictPuritySingle_input_dimspy_peakmatrix.tsv" />
            <output name="dimsPredictPuritySingle_output" value="dimsPredictPuritySingle_output.tsv" />
        </test>
    </tests>



    <help><![CDATA[

=============================================================
Calculate anticipated precursor ion purity from DI-MS dataset
=============================================================
-----------
Description
-----------

Tool to calculate the anticipated precursor ion purity of selected precursor based on a prior DI-MS dataset. The dataset
can either be in the form of multiple 'full scans' or a SIM-Stitch dataset. See the Bioconductor documentation for more
details, function msPurity::dimsPredictPurity()

--------------
Output example
--------------
Output consists of the mz column (along with any other columns that were in the original mz file). The median and
mean calculated purity. The standard deviation (sdPurity), coefficient of variation (relative standard deviation)
cvPurity, the standard error of the purity (sdePurity) and the median number of peaks within the isolation window
(medianPeakNum)

============= ============= ============= ================ ================ ================ ================
mz            medianPurity  meanPurity    sdPurity         cvPurity	        sdePurity        medianPeakNum
============= ============= ============= ================ ================ ================ ================
50.20428      0.39          0.39          0.0007           0.19             0.0005           3
------------- ------------- ------------- ---------------- ---------------- ---------------- ----------------
56.91206      0.01          0.01          0.0002           4.53             0.0001           12
------------- ------------- ------------- ---------------- ---------------- ---------------- ----------------
62.02906      0.14          0.13          0.0014           22.63            0.0009           7
------------- ------------- ------------- ---------------- ---------------- ---------------- ----------------
75.07431      0.93          0.94          0.019            37.87            0.0134           3
============= ============= ============= ================ ================ ================ ================

    ]]></help>
    <expand macro="citations" />
</tool>