view hdf5_to_txt.xml @ 1:ea439d85b6c5 draft

"planemo upload for repository https://github.com/computational-metabolomics/dimspy-galaxy commit 680116d0cf6a6d7246cba655452dea43269aeba4"
author computational-metabolomics
date Tue, 28 Apr 2020 17:14:29 -0400
parents 5c545e1f0fa2
children
line wrap: on
line source

<tool id="dimspy_hdf5_to_txt" name="Convert DIMSpy-based HDF5 to tsv" version="@TOOL_VERSION@+galaxy@GALAXY_TOOL_VERSION@">
    <description></description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code">
    <![CDATA[
        #if $input.object_type == 'peak_lists'
            dimspy hdf5-pls-to-txt
            --input '$input.hdf5_file_in'
            --output .
            --delimiter $delimiter
        #elif $input.object_type == 'peak_matrix'
            #if $input.matrix_format == 'standard' or $input.matrix_format == 'standard_comprehensive'
                dimspy hdf5-pm-to-txt
                --input '$input.hdf5_file_in'
                --output '$matrix_file_out'
                --delimiter $delimiter
                --attribute_name $input.matrix_attr
                --representation-samples $input.representation_samples
            #end if
            #if $input.matrix_format == "standard_comprehensive"
                &&
            #end if
            #if $input.matrix_format == 'comprehensive' or $input.matrix_format == 'standard_comprehensive'
                dimspy hdf5-pm-to-txt
                --input '$input.hdf5_file_in'
                --output '$matrix_comprehensive_file_out'
                --delimiter $delimiter
                --comprehensive
                --attribute_name '$input.matrix_attr'
                --representation-samples $input.representation_samples
            #end if
        #end if
    ]]>
    </command>
    <inputs>
        <param name="delimiter" argument="--delimiter" type="hidden" value="tab" />
        <conditional name="input">
            <param name="object_type" type="select" label="Content HDF5 file" help="">
                <option value="peak_matrix" selected="true">Peak Intensity Matrix</option>
                <option value="peak_lists">Peak list(s)</option>
            </param>
            <when value="peak_lists">
                <param name="hdf5_file_in" argument="--input" type="data" format="h5" label="Peaklist(s) (HDF5 file)" help="" />
            </when>
            <when value="peak_matrix">
                <param name="hdf5_file_in" argument="--input" type="data" format="h5" label="Peak intensity matrix (HDF5 file)" help="" />
                <param name="matrix_format" type="select" label="Select format(s) tsv formatted peak instensity matrix" help="">
                    <option value="standard" selected="true">Standard Peak Matrix (i.e. m/z and intensity).</option>
                    <option value="comprehensive">Comprehensive Peak Matrix (e.g. m/z and intensity, rsd, missing values).</option>
                    <option value="standard_comprehensive">Standard and comprehensive</option>
                </param>
                <param name="representation_samples" type="select" label="Should the rows or columns represent the samples?" help="">
                    <option value="rows" selected="true">Rows</option>
                    <option value="columns">Columns</option>
                </param>
                <param name="matrix_attr" type="select" label="The Peak Matrix should contain ... values" help="">
                    <option value="intensity" selected="true">Intensity</option>
                    <option value="mz">m/z</option>
                    <option value="snr">Signal-to-noise ratio (SNR)</option>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <collection name="peaklists_txt" type="list" label="${tool.name} on ${on_string}: Peaklists">
            <filter>input["object_type"] == "peak_lists"</filter>
            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.txt" format="tsv" directory="." visible="false" />
        </collection>
        <data name="matrix_file_out" format="tsv" label="${tool.name} on ${on_string}: Peak Matrix">
            <filter>input["object_type"] == "peak_matrix" and (input["matrix_format"] == "standard" or input["matrix_format"] == "standard_comprehensive")</filter>
        </data>
        <data name="matrix_comprehensive_file_out" format="tsv" label="${tool.name} on ${on_string}: Peak Matrix (comprehensive)" >
            <filter>input["object_type"] == "peak_matrix" and (input["matrix_format"] == "comprehensive" or input["matrix_format"] == "standard_comprehensive")</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <conditional name="input">
                <param name="object_type" value="peak_lists"/>
                <param name="hdf5_file_in" value="pls.h5" ftype="h5"/>
            </conditional>
            <output_collection name="peaklists_txt" type="list">
                <element name="batch04_QC17_rep01_262" file="batch04_QC17_rep01_262.txt" ftype="tsv"/>
                <element name="batch04_QC17_rep02_263" file="batch04_QC17_rep02_263.txt" ftype="tsv"/>
                <element name="batch04_QC17_rep03_264" file="batch04_QC17_rep03_264.txt" ftype="tsv"/>
            </output_collection>
        </test>
        <test>
            <conditional name="input">
                <param name="object_type" value="peak_matrix"/>
                <param name="hdf5_file_in" value="pm_as_bf_sf.h5" ftype="h5"/>
                <param name="matrix_format" value="comprehensive"/>
                <param name="representation_samples" value="columns"/>
                <param name="matrix_attr" value="intensity"/>
            </conditional>
            <output name="matrix_comprehensive_file_out" file="peak_matrix_hdf5_to_txt_intensity.txt" ftype="tsv"/>
        </test>
        <test>
            <conditional name="input">
                <param name="object_type" value="peak_matrix"/>
                <param name="hdf5_file_in" value="pm_as_bf_sf.h5" ftype="h5"/>
                <param name="matrix_format" value="standard"/>
                <param name="representation_samples" value="rows"/>
                <param name="matrix_attr" value="mz"/>
            </conditional>
            <output name="matrix_file_out" file="peak_matrix_hdf5_to_txt_mz.txt" ftype="tsv"/>
        </test>
        <test>
            <conditional name="input">
                <param name="object_type" value="peak_matrix"/>
                <param name="hdf5_file_in" value="pm_as_bf_sf.h5" ftype="h5"/>
                <param name="matrix_format" value="standard_comprehensive"/>
                <param name="representation_samples" value="rows"/>
                <param name="matrix_attr" value="snr"/>
            </conditional>
            <output name="matrix_file_out" file="peak_matrix_hdf5_to_txt_snr.txt" ftype="tsv"/>
            <output name="matrix_comprehensive_file_out" file="peak_matrix_hdf5_to_txt_comprehensive_snr.txt" ftype="tsv"/>
        </test>
    </tests>
    <help>
--------------------------------
Convert DIMSpy-based HDF5 to tsv
--------------------------------

..

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

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

This tool converts a .hdf5 file, containing either peaklist(s) or a peak intensity matrix, to user-friendly .tsv file(s).

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

Parameters
----------

**Contents of hdf5 file** (REQUIRED; default = **peak intensity matrix**) - selection menu in which the user defines whether the input .hdf5 file contains:

- **a peak intensity matrix**

- **peaklist(s)**

|

**Peak intensity matrix or peaklists (HDF5 file)** (REQUIRED) - selection menu in which the user chooses the .hdf5 file (from the active Galaxy history) to be converted to .tsv formatted output(s). 

|

**Select format(s) tsv formatted peak intensity matrix** (REQUIRED; default = **Standard Peak Matrix**) - selection menu in which the user chooses from the following export options:
 
@help_options_addtional_output@

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

Output file(s)
--------------

**Important** - the metric recorded output peak matrix/matrices is adjusted using the "The peak matrix should contain intensity | m/z | SNR values" parameter. By default, samples are presented row-wise and peak mass-to-charge ratio values are presented column-wise in each peak matrix, though this may be adjusted using the "Should rows or columns represent samples" parameter toggle. 

@help_outputs_matrix@

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

@github_developers_contributors@
@license@
    </help>
    <expand macro="citations" />
</tool>