view MS2snoop.xml @ 4:856001213966 draft

planemo upload commit 53543b5d911fc1f2d204f314a4d2aaf93a8c7715
author workflow4metabolomics
date Wed, 06 Jul 2022 10:38:39 +0000
parents c68c94865667
children 78d5a12406c2
line wrap: on
line source

<tool id="ms2snoop" name="MS2 Snoop" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
    <description>
        MS1/MS2 spectra and associated adducts extraction and cleaning
    </description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <edam_topics>
        <edam_topic>topic_0091</edam_topic>
        <edam_topic>topic_3370</edam_topic>
    </edam_topics>
    <edam_operations>
        <edam_operation>operation_3803</edam_operation>
        <edam_operation>operation_3860</edam_operation>
    </edam_operations>
    <requirements>
        <requirement type="package" version="4.1.3">r-base</requirement>
        <requirement type="package" version="1.7.1">r-optparse</requirement>
    </requirements>
    <stdio>
        <exit_code range="1" level="fatal" description="Missing parameter error" />
        <exit_code range="2" level="fatal" description="Bad parameter's value" />
        <exit_code range="3" level="fatal" description="Missing input file" />
        <exit_code range="4:254" level="fatal" description="Unknown error" />
        <exit_code range="255" level="fatal" description="No any result to output" />
        <regex match="Error in\s+.*:\s+.*" />
    </stdio>
    <version_command>
        Rscript '$__tool_directory__/MS2snoop.R' --version | head -n 1
    </version_command>
    <command>
        <![CDATA[
Rscript '$__tool_directory__/MS2snoop.R'
    --output '$frag_result_txt'
    --compounds '$compound_txt'
    --fragments '$peaklist_frag_tsv'
    --precursors '$peaklist_preco_tsv'
    --tolmz '$tolmz'
    --tolrt '$tolrt'
    --seuil_ra '$seuil_ra'
    --mzdecimal '$mzdecimal'
    --r_threshold '$r_threshold'
    --min_number_scan '$min_number_scan'
    $advenced.debug
    $advenced.verbose
        ]]>
    </command>
    <inputs>
        <param
            argument="--compound_txt"
            type="data"
            format="tabular,csv,tsv"
            label="list of compounds"
            help="The table must fit the format: col1=Name of molecule, col2=m/z, col3=retention time"
        />
        <param
            argument="--peaklist_frag_tsv"
            type="data"
            format="tabular,csv,tsv"
            label="MSpurity fragments file"
        />
        <param
            argument="--peaklist_preco_tsv"
            type="data"
            format="tabular,csv,tsv"
            label="MSpurity precursors file"
        />
        <param
            argument="--tolmz"
            type="float"
            min="0.0001"
            max="10"
            value="0.01"
            label="MZ Tolerence"
        />
        <param
            argument="--tolrt"
            type="integer"
            min="0"
            max="30"
            value="20"
            label="RT Tolerence"
        />
        <param
            argument="--seuil_ra"
            type="float"
            min="0"
            max="1"
            value="0.05"
            label="r pearson correlation threshold between precursor and fragment absolute intensity"
        />
        <param
            argument="--mzdecimal"
            type="integer"
            min="0"
            max="5"
            value="0"
            label="nb decimal for mz"
        />
        <param
            argument="--r_threshold"
            type="float"
            min="0"
            value="0.85"
            label="fragment absolute intensity"
        />
        <param
            argument="--min_number_scan"
            type="integer"
            min="0"
            max="25"
            value="8"
            label="Present in at least X scan"
            help="fragments are kept if they are found in a minimum number of scans"
        />
        <section title="Advenced Options" name="advenced">
            <param
                argument="--verbose"
                type="boolean"
                value=""
                optional="true"
                label="Verbose logs"
                help="The tool will print more logs"
                truevalue="--verbose"
                falsevalue=""
            />
            <param
                argument="--debug"
                type="boolean"
                value=""
                optional="true"
                label="Debug statements"
                help="The tool will print debug statements"
                truevalue="--debug"
                falsevalue=""
            />
        </section>
    </inputs>
    <outputs>
        <data
            name="frag_result_txt"
            format="tabular"
            label="compound_fragments_result.txt"
        />
    </outputs>
    <tests>
        <test>
            <param name="compound_txt" value="compounds_pos.txt" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.tsv" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_regular_stdout"/>
                <expand macro="has_not_verbose_stdout"/>
                <expand macro="has_not_debug_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.txt" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.tsv" />
            <param name="verbose" value="--verbose" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_regular_stdout"/>
                <expand macro="has_verbose_stdout"/>
                <expand macro="has_not_debug_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.txt" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.tsv" />
            <param name="debug" value="--debug" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_smol_stdout"/>
                <expand macro="has_debug_stdout"/>
                <expand macro="has_not_verbose_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.txt" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.tsv" />
            <param name="debug" value="--debug" />
            <param name="verbose" value="--verbose" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_smol_stdout"/>
                <expand macro="has_debug_stdout"/>
                <expand macro="has_smol_verbose_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.csv" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.csv" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_regular_stdout"/>
                <expand macro="has_not_verbose_stdout"/>
                <expand macro="has_not_debug_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.csv" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.csv" />
            <param name="verbose" value="--verbose" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_regular_stdout"/>
                <expand macro="has_verbose_stdout"/>
                <expand macro="has_not_debug_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.csv" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.csv" />
            <param name="debug" value="--debug" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_smol_stdout"/>
                <expand macro="has_debug_stdout"/>
                <expand macro="has_not_verbose_stdout"/>
            </assert_stdout>
        </test>
        <test>
            <param name="compound_txt" value="compounds_pos.csv" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.csv" />
            <param name="debug" value="--debug" />
            <param name="verbose" value="--verbose" />
            <output name="frag_result_txt" file="compound_fragments_result.txt" />
            <assert_stdout>
                <expand macro="has_smol_stdout"/>
                <expand macro="has_debug_stdout"/>
                <expand macro="has_smol_verbose_stdout"/>
            </assert_stdout>
        </test>
        <test expect_exit_code="2" expect_failure="true">
            <param name="compound_txt" value="compounds_pos_old_format.txt" />
            <param name="peaklist_frag_tsv" value="peaklist_fragments.tsv" />
            <param name="peaklist_preco_tsv" value="peaklist_precursors.csv" />
            <assert_stderr>
                <has_line line="Error: Some columns are missing: compound_name, rtsec, inchikey" />
            </assert_stderr>
        </test>
    </tests>
    <help><![CDATA[

@AUTHORS@

==============
MS2 validation
==============

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

MS2snoop use results of msPurity to find spectra of standards listed in
a compounds file. Check the fragments and precursor using correlation of
among the different scans of fragments 

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

--------------
Upstream tools
--------------

+-------------------------+-----------------+--------+------------+
| Name                    |  output file    | format |  parameter |
+=========================+=================+========+============+
| msPurity.purityA        |       NA        |   TSV  |    NA      |
+-------------------------+-----------------+--------+------------+
| msPurity.frag4feature   |       NA        |   TSV  |    NA      |
+-------------------------+-----------------+--------+------------+

----------------
Downstream tools
----------------

+-------------------------+-----------------+--------+------------+
| Name                    |  output file    | format |  parameter |
+=========================+=================+========+============+
| NA                      |       NA        |   NA   |    NA      |
+-------------------------+-----------------+--------+------------+


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

+----------------------------------------------+------------+
| Parameter : num + label                      |   Format   |
+===========================+==================+============+
| Input from msPurity Precursor                |   TSV,CSV  |
+----------------------------------------------+------------+
| Input from msPurity fragment                 |   TSV,CSV  |
| Input compounds file to search in precursor  |            |
+----------------------------------------------+------------+
| and fragment (Name + m/z + ret Time)         |   TSV,CSV  |
+----------------------------------------------+------------+


@PARAMETERS@


@OUTPUTS@


@CHANGELOG@

   ]]></help>
</tool>