view createMSP.xml @ 4:196f363638ca draft

"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cbbd708ea1e93b1b1643f6bf6da72af65ffd9950"
author computational-metabolomics
date Mon, 10 Aug 2020 08:43:03 -0400
parents 2e8e367c4937
children
line wrap: on
line source

<tool id="mspurity_createmsp" name="msPurity.createMSP" version="@TOOL_VERSION@+galaxy@GALAXY_TOOL_VERSION@">
    <description>Create MSP files from msPurity processed data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements">
    </expand>
    <command detect_errors="exit_code"><![CDATA[
    Rscript '$__tool_directory__/createMSP.R'
    --rdata_input '$rdata_input'
    --method '$method'

    #if $metadata_cond.metadata_select == "true"
        --metadata '$metadata_cond.metadata'
        --metadata_cols '$metadata_cond.metadata_cols'
        --metadata_cols_filter '$metadata_cond.metadata_cols_filter'

    #end if

    #if $xcms_group_cond.xcms_group_select == "true"
        --xcms_groupids '$xcms_group_cond.xcms_groupids'
    #end if

    $filter
    $adduct_split

    --msp_schema $msp_schema
    --intensity_ra $intensity_ra
    --include_adducts $include_adducts
    #if $include_adducts_custom
    	--include_adducts_custom "$include_adducts_custom"
    #end if

    --out_dir '.'
    ]]></command>
    <inputs>
        <param argument="--rdata_input" type="data" format="rdata" label="msPurity purityA dataset"
        help="RData file containing the purityA object following frag4feature and/or averageFragmentation"/>
        <param argument="--method" type="select" label="How to choose fragmentation spectra (if precursor was fragmented in >1 scans per XCMS group feature)"
        help="'Average all' will use the averaged MS/MS spectra of the XCMS grouped feature, ignoring inter and intra file relationships,
             'Average' (intra)' will use the intra file (within file) averaged MS/MS spectra of the XCMS grouped feature,
             'Average (inter)' will use the inter file (across file) MS/MS averaged spectra,
             'All scans' will export all matching MS/MS spectra to XCMS grouped features,
             'Max intensity' will choose the most MS/MS spectra with the most intense precursor ion for each XCMS grouped feature"
             >
            <option value="av_all" selected="true">Average (all)</option>
            <option value="av_intra">Average (intra)</option>
            <option value="av_inter">Average (inter)</option>
            <option value="all">All scans</option>
            <option value="max" >Max intensity</option>
        </param>

        <conditional name="metadata_cond">
            <param name="metadata_select" type="boolean" label="Use additional metadata?" />
	    <when value="true">
                <param argument="--metadata" type="data" label="Metadata for each feature" format="tsv,tabular"
                help="Metadata for each grouped XCMS feature, e.g. could be the adduct calculated from CAMERA "/>

                <param argument="--metadata_cols_filter" type="text" label="Metadata columns to use" value=""
                help="Comma separated string of column names where the corresponding values in the metadata will be used"/>

                <param argument="--metadata_cols" type="text" label="Metadata columns for MSP spectra name" value=""
                help="Comma separated string of column names where the corresponding values in the metadata will be used
                      for MSP spectra name"/>

                </when>
            <when value="false">
            </when>
        </conditional>

        <conditional name="xcms_group_cond">
            <param name="xcms_group_select" type="boolean" label="Select XCMS groups?" help="if set to no, all XCMS group features will be used" />
            <when value="true">
                <param argument="--xcms_groupids" type="text" label="XCMS peak group ids" value=""
                help="Comma separated string of XCMS group ids to export MSP spectra for. If blank all XCMS peak groups will be used"/>
            </when>
            <when value="false">
            </when>
        </conditional>

        <param argument="--intensity_ra" type="select" label="Include intensity, relative abundanace or both in the MSP file">
            <option value="intensity_ra" selected="true">Both intensity and relative abundance</option>
            <option value="intensity">Intensity only</option>
            <option value="ra">Relative abundance only</option>
        </param>

        <param argument="--msp_schema" type="select" label="MSP schema to use for files">
            <option value="massbank" selected="true">MassBank (Europe)</option>
            <option value="mona">MoNA</option>

        </param>

        <param argument="--filter" type="boolean" checked="true" truevalue="--filter" falsevalue=""
        label="Filter peaks that have been flagged in prior processing steps"   help="" />


       <param argument="--include_adducts" type="select" label="Always include the following adduct descriptions in the MSP file"
        help="Additional adducts to include, can be useful for downstream processing" multiple="true">
            <option value="[M+H]+">[M+H]+</option>
            <option value="[M+Na]+">[M+Na]+</option>
            <option value="[M+NH4]+">[M+NH4]+</option>
            <option value="[M+K]+" >[M+K]+</option>
            <option value="[M+CH3OH+H]+">[M+CH3OH+H]+</option>
            <option value="[M+ACN+H]+">[M+ACN+H]+</option>
            <option value="[M+ACN+Na]+">[M+ACN+Na]+</option>
            <option value="[M+2ACN+H]+">[M+2ACN+H]+</option>
            <option value="[M-H]-">[M-H]-</option>
            <option value="[M+HCOO]-" >[M+HCOO]-</option>
            <option value="[M+CH3COO]-" >[M+CH3COO]-</option>
            <option value="[M-H+CH3COOH]-" >[M-H+CH3COOH]-</option>
        </param>
        <param argument="--include_adducts_custom" type="text" label="Always include the following custom adducts"
		help="Additional custom adducts to include, should be comma separated"  optional="true">
               <expand macro="text-adduct-regex-validator"/>
        </param>
	    
        <param argument="--adduct_split" type="boolean" checked="true" label="Create MSP spectra for each adduct?"
		help="Useful if the MSP file will be used for further annotation" truevalue="--adduct_split" falsevalue=""/>

    </inputs>
    <outputs>
        <data name="createMSP_output" format="msp" from_work_dir="lcmsms_spectra.msp" label="${tool.name} on ${on_string}: msp"/>
    </outputs>
    <tests>

        <test>
            <!-- Test all average with metadata -->
            <param name="method" value="av_all"/>
            <param name="rdata_input" value="averageFragSpectra_output_all.RData"/>
            <param name="metadata_cond|metadata_select" value="true"/>
            <param name="metadata_cond|metadata" value="createMSP_input_metadata.tsv"/>
            <param name="xcms_group_cond|xcms_group_select" value="true"/>
            <param name="xcms_group_cond|xcms_groupids" value="8,12"/>
            <param name="metadata_cond|adduct_split" value="true"/>
            <output name="createMSP_output" file="createMSP_output_av_all_metadata.msp"/>
        </test>

        <test>
            <!-- Test custom adducts average with metadata -->
            <param name="method" value="av_all"/>
            <param name="rdata_input" value="averageFragSpectra_output_all.RData"/>
            <param name="metadata_cond|metadata_select" value="true"/>
            <param name="metadata_cond|metadata" value="createMSP_input_metadata.tsv"/>
            <param name="xcms_group_cond|xcms_group_select" value="true"/>
            <param name="xcms_group_cond|xcms_groupids" value="8,12"/>
	    <param name="metadata_cond|adduct_split" value="true"/>
	    <param name="include_adducts_custom" value="[M+]+,[M-H]-,[M+TEST SPACE+]+"/>
            <output name="createMSP_output" file="createMSP_output_av_all_metadata_custom_adducts.msp"/>
        </test>



    </tests>
	<help><![CDATA[
------------------------------
Create MSP Files from msPurity
------------------------------

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

| This tool will extract the MSMS spectra data from an msPurity-frag4feature object into a file with MSP data format.




Developers and contributors
---------------------------

- **Jordi Capellades (j.capellades.to@gmail.com) - Universitat Rovira i Virgili (SP)**
- **Andris Jankevics (a.jankevics@bham.ac.uk) - University of Birmingham (UK)**
- **Thomas N. Lawson (t.n.lawson@bham.ac.uk) - University of Birmingham (UK)**
- **Ralf Weber (r.j.weber@bham.ac.uk) - University of Birmingham (UK)**

	]]></help>

<expand macro="citations" />

</tool>