view biom_convert.xml @ 0:501c21cce614 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/biom_format commit 01bf97e10e5491ec878cca24495d8125449dfc1e
author iuc
date Tue, 07 Jun 2016 17:26:00 -0400
parents
children 0de92f0b96ef
line wrap: on
line source

<tool id="biom_convert" name="Convert BIOM" version="@VERSION@.0">
    <description>formats</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <expand macro="version_command" />
    <command>
        <![CDATA[
            biom convert -i "${input_type.input_table}" -o "${output_table}"
            #if str( $input_type.input_type_selector ) == "tsv": 
                #if $input_type.process_obs_metadata:
                    --process-obs-metadata "${input_type.process_obs_metadata}"
                #end if
            #end if

            #if str( $output_type.output_type_selector ) == "tsv": 
                --to-tsv
                #if $output_type.header_key:
                    --header-key "${output_type.header_key}"
                    #if $output_type.output_metadata_id:
                        --output-metadata-id "${output_type.output_metadata_id}"
                    #end if
                    --tsv-metadata-formatter "${output_type.tsv_metadata_formatter}"
                #end if
            #else:
                --table-type "${output_type.table_type}"
                #if str( $output_type.biom_type.biom_type_selector ) == 'hdf5':
                    --to-hdf5
                    ${output_type.biom_type.collapsed_samples}
                    ${output_type.biom_type.collapsed_observations}
                #else:
                    --to-json
                #end if
                #if $output_type.sample_metadata_fp:
                    --sample-metadata-fp "${output_type.sample_metadata_fp}"
                #end if
                #if $output_type.observation_metadata_fp:
                    --observation-metadata-fp "${output_type.observation_metadata_fp}"
                #end if
            #end if   
        ]]>
    </command>
    <inputs>
        <conditional name="input_type">
            <param name="input_type_selector" type="select" label="Choose the source BIOM format">
                <option value="tsv" selected="True">Tabular File</option>
                <option value="biom">BIOM File</option>
            </param>
            <when value="tsv">
                <param name="input_table" type="data" format="tabular" label="Tabular File" argument="--input-fp"/>
                <param name="process_obs_metadata" type="select" label="Process metadata associated with observations when converting" argument="--process-obs-metadata">
                    <option value="" selected="True">Do Not process metadata</option>
                    <option value="taxonomy">taxonomy</option>
                    <option value="naive">naive</option>
                    <option value="sc_separated">sc_separated</option>
                </param>
            </when>
            <when value="biom">
                <param name="input_table" type="data" format="biom1" label="Tabular File" argument="--input-fp"/>
            </when>
        </conditional>
        <conditional name="output_type">
            <param name="output_type_selector" type="select" label="Choose the output type" argument="--to-tsv">
                <option value="tsv">TSV-formatted (classic) table</option>
                <option value="biom" selected="True">BIOM</option>
            </param>
            <when value="tsv">
                <param name="header_key" type="text" value="" label="observation metadata to include" help="Leave empty to ignore" argument="--header-key"/>
                <param name="output_metadata_id" type="text" value="" label="name to be given to the observation metadata column" help="Leave empty to ignore" argument="--output-metadata-id"/>
                <param name="tsv_metadata_formatter" type="select" label="Method for formatting the observation metadata" argumet="--tsv-metadata-formatter">
                    <option value="naive" selected="True">naive</option>
                    <option value="sc_separated">Semi-colon separated</option>
                </param>
            </when>
            <when value="biom">
                <param name="table_type" type="select" label="Table Type" argument="--table-type">
                    <option value="OTU table">OTU table</option>
                    <option value="Pathway table">Pathway table</option>
                    <option value="Function table">Function table</option>
                    <option value="Ortholog table">Ortholog table</option>
                    <option value="Gene table">Gene table</option>
                    <option value="Metabolite table">Metabolite table</option>
                    <option value="Taxon table">Taxon table</option>
                    <option value="Table" selected="True">Table</option>
                </param>
                <conditional name="biom_type">
                    <param name="biom_type_selector" type="select" label="BIOM format type" argument="--to-json / --to-hdf5">
                        <option value="json" selected="True">JSON-formatted table (BIOM1)</option>
                        <option value="hdf5">HDF5-formatted table (BIOM2)</option>
                    </param>
                    <when value="json">
                    </when>
                    <when value="hdf5">
                        <param name="collapsed_samples" type="boolean" truevalue="" falsevalue="--collapsed-samples" checked="False" label="Use collapsed samples" argument="--collapsed-observations"/>
                        <param name="collapsed_observations" type="boolean" truevalue="" falsevalue="--collapsed-samples" checked="False" label="Use collapsed observations"/>
                    </when>
                </conditional>
                <param name="sample_metadata_fp" type="data" format="tabular" optional="True" label="Add sample metadata from metadata mapping file" argument="--sample-metadata-fp"/>
                <param name="observation_metadata_fp" type="data" format="tabular" optional="True" label="Add observation metadata from mapping file" argument="--observation-metadata-fp"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="biom1" name="output_table">
            <change_format>
                <when input="output_type.output_type_selector" value="tsv" format="tabular" />
                <when input="output_type.biom_type" value="hdf5" format="biom2" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <conditional name="input_type">
                <param name="input_type_selector" value="tsv"/>
                <param name="input_table" value="input_abundance_taxonomy_1.tabular" ftype="tabular"/>
                <param name="process_obs_metadata" value="taxonomy"/>
            </conditional>
            <conditional name="output_type">
                <param name="output_type_selector" value="biom"/>
                <param name="table_type" value="OTU table"/>
                <conditional name="biom_type">
                    <param name="biom_type_selector" value="json"/>
                </conditional>
                <param name="sample_metadata_fp"/>
                <param name="observation_metadata_fp"/>
            </conditional>
            <output name="output_table" file="output_taxonomy_1.biom1.re" ftype="biom1" compare="re_match"/>
        </test>
        <test>
            <conditional name="input_type">
                <param name="input_type_selector" value="tsv"/>
                <param name="input_table" value="input_abundance_1.tabular" ftype="tabular"/>
                <param name="process_obs_metadata" value=""/>
            </conditional>
            <conditional name="output_type">
                <param name="output_type_selector" value="biom"/>
                <param name="table_type" value="OTU table"/>
                <conditional name="biom_type">
                    <param name="biom_type_selector" value="json"/>
                </conditional>
                <param name="sample_metadata_fp"/>
                <param name="observation_metadata_fp"/>
            </conditional>
            <output name="output_table" file="output_1.biom1.re" ftype="biom1" compare="re_match"/>
        </test>
    </tests>
    <help><![CDATA[

Usage: biom convert [OPTIONS]::

  Convert to/from the BIOM table format.

  Convert between BIOM table formats. See examples here: http://biom-format.org/documentation/biom_conversion.html

  Example usage:

  Convert a "classic" BIOM file (tab-separated text) to an HDF5 BIOM formatted OTU table:

  $ biom convert -i table.txt -o table.biom --to-hdf5


Options:
  -i, --input-fp PATH             The input BIOM table  [required]
  -o, --output-fp PATH            The output BIOM table  [required]
  -m, --sample-metadata-fp PATH   The sample metadata mapping file (will add sample metadata to the input BIOM table, if provided).
  --observation-metadata-fp PATH  The observation metadata mapping file (will add observation metadata to the input BIOM table, if provided).
  --to-json                       Output as JSON-formatted table.
  --to-hdf5                       Output as HDF5-formatted table.
  --to-tsv                        Output as TSV-formatted (classic) table. table is a BIOM table with collapsed samples, this will update the sample metadata of the table to the supported HDF5 collapsed format.
  --collapsed-observations        If --to_hdf5 is passed and the original table is a BIOM table with collapsed observations, this will update the  supported HDF5 collapsed format.
  --header-key TEXT               The observation metadata to include from the input BIOM table file when creating a tsv table file. By default no observation metadata will be included.
  --output-metadata-id TEXT       The name to be given to the observation metadata column when creating a tsv table file if the column should be renamed.
  --table-type                    OTU table,Pathway table,Function table,Ortholog table,Gene table,Metabolite table,Taxon table,Table The type of the table.
  --process-obs-metadata          taxonomy,naive,sc_separated Process metadata associated with observations when converting from a classic table.
  --tsv-metadata-formatter        naive,sc_separated Method for formatting the observation 
  --help                          Show this message and exit.

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