view format_tree_and_trait_table.xml @ 0:61c60e3c8768 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/picrust commit d4a07fbb603c57131af9cd2223579148a3887baf
author iuc
date Sat, 20 Jan 2018 03:40:36 -0500
parents
children 21999f3aeb04
line wrap: on
line source

<tool id="picrust_format_tree_and_trait_table" name="Format" version="@WRAPPER_VERSION@.0">
    <description>tree and trait tables</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="aggressive"><![CDATA[
        format_tree_and_trait_table.py
            -i '$input_trait_table'
            -t '$input_tree'
            -o ./formatted/
            --input_table_delimiter $advanced.input_table_delimiter
            --output_table_delimiter $advanced.output_table_delimiter

            #if $advanced.input_tree_to_trait
                --tree_to_trait_mapping '$advanced.input_tree_to_trait'
            #end if

            #if $advanced.input_limit_otus
                --limit_tree_to_otus_fp '$advanced.input_limit_otus'
            #end if

            $advanced.suppress_bifurcating
            $advanced.convert_to_nexus
            $advanced.convert_values_to_ints
            $advanced.no_minimum_branch_length
            $advanced.supress_tree_filter
            $advanced.supress_table_filter
            $advanced.add_branch_length_to_root
    ]]></command>
    <inputs>
        <param name="input_trait_table" type="data" format="tabular,txt,csv" label="Input trait table"
               help="Input trait table in QIIME OTU table format"/>
        <param name="input_tree" type="data" format="nhx" label="Input tree" help="Input tree in Newick format"/>
        <section name="advanced" title="Advanced options" expanded="False">
            <param argument="--input_table_delimiter" type="select" label="Input table delimiter"
                   help="The character delimiting fields in the input trait table">
                <option value="tab" selected="true">Tab</option>
                <option value="space">Space</option>
                <option value="comma">Comma</option>
            </param>
            <param argument="--output_table_delimiter" type="select" label="Output table delimiter"
                   help="The character delimiting fields in the output trait table">
                <option value="tab" selected="true">Tab</option>
                <option value="space">Space</option>
                <option value="comma">Comma</option>
            </param>
            <param name="input_tree_to_trait" type="data" format="tabular" optional="true" label="Tree to trait mapping"
                   help="An optional two-column, tab-delimited text file mapping identifiers in the tree (column 1) to identifiers in the trait table (column 2). If supplied, the identifiers in the trait table will be converted to match the identifiers in the tree. (This mapping does not need to be supplied if the tree and trait table already use a common set of identifiers.)"/>
            <param name="input_limit_otus" type="data" format="tabular,txt,csv" optional="true" label="Limit trees"
                   help="Prune the reference tree to contain only those tips that are within the given OTU table"/>
            <param argument="--suppress_bifurcating" type="boolean" truevalue="--suppress_bifurcating" falsevalue="" checked="false"
                   label="Suppress bifurcating" help="If set, don’t ensure that tree is fully bifurcating"/>
            <param argument="--convert_to_nexus" type="boolean" truevalue="--convert_to_nexus" falsevalue="" checked="false"
                   label="Convert to NEXUS format" help="Convert tree to NEXUS format, including a translate block mapping tip names to numbers"/>
            <param argument="--convert_values_to_ints" type="boolean" truevalue="--convert_values_to_ints" falsevalue="" checked="false"
                   label="Convert character state to integers" help="Convert the values for each character state to integers"/>
            <param argument="--no_minimum_branch_length" type="boolean" truevalue="--no_minimum_branch_length" falsevalue="" checked="false"
                   label="No minimum branch length" help="If set, don’t ensure all branches have at least a small but non-zero branch length"/>
            <param argument="--supress_tree_filter" type="boolean" truevalue="--supress_tree_filter" falsevalue="" checked="false"
                   label="Supress tree filter" help="If set, don’t filter out tree tips that aren’t listed in the trait table"/>
            <param argument="--supress_table_filter" type="boolean" truevalue="--supress_table_filter" falsevalue="" checked="false"
                   label="Supress table filter" help="If set, don’t filter out trait table entries that aren’t listed in the tree"/>
            <param argument="--add_branch_length_to_root" type="boolean" truevalue="--add_branch_length_to_root" falsevalue="" checked="false"
                   label="Add branch to root" help="Add a short branch to the root node (this is required by some phylogeny programs). The length of the branch is determined by the min_branch_length option"/>
        </section>
    </inputs>
    <outputs>
        <data name="reference_tree" label="${tool.name} on ${on_string}: Reference tree" format="nhx"
              from_work_dir="formatted/reference_tree.newick"/>
        <data name="pruned_tree" label="${tool.name} on ${on_string}: Pruned tree" format="nhx"
              from_work_dir="formatted/pruned_tree.newick">
            <change_format>
                <when input="advanced.convert_to_nexus" value="--convert_to_nexus" format="nex"/>
            </change_format>
        </data>
        <data name="trait_table" label="${tool.name} on ${on_string}: Trait table" format="tabular"
              from_work_dir="formatted/trait_table.tab">
            <change_format>
                <when input="advanced.output_table_delimiter" value="space" format="txt"/>
                <when input="advanced.output_table_delimiter" value="comma" format="csv"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input_trait_table" value="format_tree_and_trait_table/input_traits.tab"/>
            <param name="input_tree" value="format_tree_and_trait_table/input_tree.nwk"/>
            <output name="reference_tree" ftype="nhx" file="format_tree_and_trait_table/reference_tree.newick"/>
            <output name="pruned_tree" ftype="nhx" file="format_tree_and_trait_table/pruned_tree.newick"/>
            <output name="trait_table" ftype="tabular" file="format_tree_and_trait_table/trait_table.tab"/>
        </test>
    </tests>
    <help>
<![CDATA[
@PICRUST_OVERVIEW@

**Command Documenation**

This module does numerous formatting and checks to the reference tree and the trait tables. The following steps are done for both the marker gene copy number table and functional trait copy number table:

1. All internal nodes in the reference tree are checked for problematic characters and unlabelled internal nodes are given labels.
2. A pruned tree is created that contains only tips that have copy number predictions from sequenced genomes.
3. Any traits in the trait table that are not in the reference tree are removed.

Optional fixes include:

- Add short (epsilon) branch lengths in place of 0 length branches
- Filter out taxa that don't match between tree and trait table
- Output tree in NEXUS format
- Ensure tree is bifurcating (remove polytomies using very short branches)
- Convert floating point trait values to integers
- Add a short branch length to the root branch (required by BayesTraits)
- Remove internal node names (required by BayesTraits)

Three output files are produced:

- a reference tree Newick file
- a pruned tree Newick file
- a trait table file

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