view nmr_alignement/NmrAlignment_xml.xml @ 4:265ee538e120 draft default tip

Uploaded
author marie-tremblay-metatoul
date Wed, 09 Aug 2017 06:28:10 -0400
parents f3ec6799c435
children
line wrap: on
line source

<tool id="NmrAlignment" name="NMR spectra alignment" version="2.0.4">
    <description>based on the Cluster-based Peak Alignment (CluPA) algorithm</description>
     <requirements>
        <requirement type="package" version="1.1_4">r-batch</requirement>
        <requirement type="package" version="1.2.1">r-speaq</requirement>
      </requirements>
    <stdio>
        <exit_code range="1:" level="fatal" />
    </stdio>
    <command>
        ## Wrapper
        Rscript '$__tool_directory__/NmrAlignment_wrapper.R'

        ## File input
        #if $inputs.input == "tsv_file":
            tsvfile $inputs.tsv_file
        #elif $inputs.input == "zip_file":
            zipfile '$inputs.zip_file'
        #end if

        ## Spectra borders
        left_border $left_border
        right_border $right_border

        ## Exclusion zone
        zone_exclusion_choices.choice ${zone_exclusion_choices.choice}
        #if str($zone_exclusion_choices.choice) == 'yes':
            #for $i in $zone_exclusion_choices.conditions:
                zone_exclusion_left ${i.zone_exclusion_left}
                zone_exclusion_right ${i.zone_exclusion_right}
            #end for
        #end if

        ## Reference spectrum
        reference $reference

        ## Segment size
        nDivRange $nDivRange

        ## Intensity threshold
        baselineThresh $baselineThresh

		## Graphical zone
        zone_graphical_choices.choice ${zone_graphical_choices.choice}
        #if str($zone_graphical_choices.choice) == 'yes':
            #for $i in $zone_graphical_choices.conditions:
                zone_graphical_left ${i.zone_graphical_left}
                zone_graphical_right ${i.zone_graphical_right}
            #end for
        #end if

        ## Outputs
        logOut '$logOut'
        alignedSpectra '$alignedSpectra'
        graphOut '$graphOut'
    </command>
    <inputs>
        <conditional name="inputs">
            <param name="input" type="select" label="Choose your inputs method" >
                <option value="zip_file" selected="true">Zip file from your history containing your Bruker directories</option>
                <option value="tsv_file">Tsv file containing preprocessed spectra (from your history)</option>
            </param>
            <when value="zip_file">
                <param name="zip_file" type="data" format="no_unzip.zip" label="Zip file" />
            </when>
            <when value="tsv_file">
                <param name="tsv_file" type="data" format="tabular" label="Tsv file" />
            </when>
        </conditional>

        <param name="left_border" label="Left Border" type="float" value="10.0" size="10" help="Default value is 10 ppm"/>
        <param name="right_border" label="Right Border" type="float" value="0.5" size="10" help="Default value is 0.5 ppm"/>

        <conditional name="zone_exclusion_choices">
            <param name="choice" type="select" label="Exclusion zone(s)" help="Choose if you want to exclude particular zone(s)" >
                <option value="yes" > yes </option>
                <option value="no" selected="true"> no </option>
            </param>
            <when value="yes">
                <repeat name="conditions" title="exclusion zones">
                    <param name="zone_exclusion_left" label="Left exclusion zone border" type="float" value="10.0" />
                    <param name="zone_exclusion_right" label="Right exclusion zone border" type="float" value="10.0" />
                </repeat>
            </when>
            <when value="no" />
        </conditional>
		
        <param name="reference" type="integer" value="0" help="Number of the reference spectrum. Default value is 0: automatic determination of the reference spectrum" />
        <param name="nDivRange" type="integer" value="64" help="Size of a single small segment after division of spectra. Default value is 64" />
        <param name="baselineThresh" type="integer" value="1" help="Threshold to remove all peaks with intensity lower this value. Default value is 1" />
		
		<conditional name="zone_graphical_choices">
            <param name="choice" type="select" label="Graphical zone(s)" help="Choose if you want to display particular zone(s)" >
                <option value="yes" > yes </option>
                <option value="no" selected="true"> no </option>
            </param>
            <when value="yes">
                <repeat name="conditions" title="grapical zones">
                    <param name="zone_graphical_left" label="Left graphical zone border" type="float" value="10.0" />
                    <param name="zone_graphical_right" label="Right graphical zone border" type="float" value="10.0" />
                </repeat>
            </when>
            <when value="no" />
        </conditional>
    </inputs>

    <outputs>
        <data format="txt" name="logOut" label="${tool.name}_log" />
        <data format="tabular" name="alignedSpectra" label="${tool.name}_alignedSpectra" />
        <data format="pdf" name="graphOut" label="${tool.name}_graph" />
    </outputs>

    <tests>
        <test>
            <conditional name="inputs">
                <param name="input" value="zip_file" />
                <param name="zip_file" value="MTBLS1.zip" ftype="zip" />
            </conditional>
            <param name="left_border" value="9.3" />
            <param name="right_border" value="0.2" />
            <conditional name="zone_exclusion_choices">
                <param name="choice" value="yes" />
                <param name="conditions_0|zone_exclusion_left" value="6.0" />
                <param name="conditions_0|zone_exclusion_right" value="4.24" />
                <param name="conditions_1|zone_exclusion_left" value="4.0" />
                <param name="conditions_1|zone_exclusion_right" value="3.2" />
            </conditional>
            <param name="reference" value="0" />
            <param name="nDivRange" value="64" />
            <param name="baselineThresh" value="0" />
            <conditional name="zone_graphical_choices">
                <param name="choice" value="yes" />
                <param name="conditions_0|zone_graphical_left" value="4.2" />
                <param name="conditions_0|zone_graphical_right" value="4.0" />
                <param name="conditions_1|zone_graphical_left" value="2.8" />
                <param name="conditions_1|zone_graphical_right" value="2.4" />
            </conditional>       
            <output name="alignedSpectra" value="MTBLS1_alignedSpectra.tabular" />
        </test>
    </tests>

    <help>

.. class:: infomark

**Authors** Marie Tremblay-Franco (marie.tremblay-franco@toulouse.inra.fr)

.. class:: infomark

**Please cite**

T.N. Vu, D. Valkenborg, K. Smets, K.A. Verwaest, R. Dommisse, F. Lemière, A. Verschoren, B. Goethals and K. Laukens. An integrated workflow for robust alignment and simplified quantitative analysis of NMR spectrometry data. BMC Bioinformatics 2011, 12:405. DOI: 10.1186/1471-2105-12-405

T.N. Vu, K. Laukens and D. Valkenborg. A practical experiment of using speaq package. 2015 (https://cran.r-project.org/web/packages/speaq/vignettes/speaq.pdf)

=============
NMR Alignment
=============

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

Nuclear Magnetic Resonance Spectrum Alignment based on the Cluster-based Peak Alignment (CluPA) algorithm from the R 'speak' package

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

**Upstream tools**

========================= ================= =======
Name                      output file       format
========================= ================= =======
NA                        NA                NA
========================= ================= =======


**Downstream tools**

+---------------------------+----------------------+--------+
| Name                      | Output file          | Format |
+===========================+======================+========+
|NmrBucketing               | dataMatrix.tsv       | Tabular|
+---------------------------+----------------------+--------+
|                           | sampleMetadata.tsv   | Tabular|
+---------------------------+----------------------+--------+
|                           | variableMetadata.tsv | Tabular|
+---------------------------+----------------------+--------+
|NmrNormalization           | dataMatrix.tsv       | Tabular|
+---------------------------+----------------------+--------+
|                           | sampleMetadata.tsv   | Tabular|
+---------------------------+----------------------+--------+
|                           | variableMetadata.tsv | Tabular|
+---------------------------+----------------------+--------+
|Univariate                 | variableMetadata.tsv | Tabular|
+---------------------------+----------------------+--------+
|Multivariate               | sampleMetadata.tsv   | Tabular|
+---------------------------+----------------------+--------+
|                           | variableMetadata.tsv | Tabular|
+---------------------------+----------------------+--------+


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

+---------------------------+------------+
| Parameter : num + label   |   Format   |
+===========================+============+
| 1 : Choose your inputs    |   zip      |
+---------------------------+------------+

**Choose your inputs**

    | Zip file (recommended): You can put a zip file containing your inputs: myinputs.zip (containing all your conditions as sub-directories).


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

Bucket width
    | size of windows
    |

Left limit
    | Upper boundary: values greater than this value are not used in the bucketing. Default value is 10.0 ppm
    |

Right limit
    | Lower boundary: values lower than this value are not used in the bucketing. Default value is 0.5 ppm
    |

Exclusion zone(s)
    | Spectral regions to exclude, water, solvents, ... resonance
    | If YES: parameters **Lower exclusion zone** and **Upper exclusion zone** are visible,
    | If NO: no zone to exclude
    | Default value is NO
    |

Left exclusion zone
    | Upper boundary of exclusion zone
    |

Right exclusion zone
    | Lower boundary of exclusion zone

| *Notes:*
| - these parameters can be used several times using the "Add new exclusion zones" button
|

Reference spectrum
    | spectrum to which other spectra are aligned
    | Default value is 0: heuristic strategy to find the optimal template developped in the speaq package
    |

Segment size
    | Size of a single small segment after division of spectra
    | Default value: 64 (minimal value adviced)
    |

Intensity threshold
    | All peaks with an intensity below this threshold are removed
    | Default value: 1
    |

Graphical zone(s)
    | Spectral regions to display
    | If YES: parameters **Lower graphical zone** and **Upper graphical zone** are visible,
    | If NO: no zone to display
    | Default value is NO
    |


------------
Output files
------------

alignedSpectra.tsv
    | tabular output
    | Data matrix with p rows (ppm) and n columns (samples) containing the aligned intensities
    |

graphOut.pdf
    | pdf output
    | Graphical chart of raw and aligned data: whole spectral width, "zoomed" zones depending on the exclusion zones, spectral zone between 2.8 and 2.4ppm corresponding to the citric acid


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

---------------
Example
---------------


.. image:: ./static/images/NmrAlignment.png
        :width: 500

   </help>
   <citations>
       <citation type="doi">10.1093/bioinformatics/btu813</citation>
   </citations>
</tool>