view taxonomy_krona_chart.xml @ 9:1334cb4c6b68 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/taxonomy_krona_chart commit 0be1842634941540d5e313b1ad9cb5eb81fd7305"
author iuc
date Sat, 30 Nov 2019 13:05:03 -0500
parents c9f8fef1df74
children e9005d1f3cfd
line wrap: on
line source

<tool id="taxonomy_krona_chart" name="Krona pie chart" version="2.7.1">
  <description>from taxonomic profile</description>
  <requirements>
    <requirement type="package" version="2.7.1">krona</requirement>
  </requirements>
  <version_command>ktImportText | sed -n 's/.*\(KronaTools [[:digit:].]\{1,\}\).*/\1/p'</version_command>
  <command detect_errors="exit_code"><![CDATA[
    #import re

    #if $type_of_data.input[0].is_of_type('taxonomy'):
        ktImportGalaxy
        -d '${type_of_data.max_rank}'
        -n '${root_name}'
        -o '${output}'
        ${combine_inputs}
        #for $input_count, $input_dataset in enumerate( $type_of_data.input ):
            '${input_dataset},${input_count}'
        #end for
    #else:
        ktImportText
        -n '${root_name}'
        -o '${output}'
        ${combine_inputs}
        #for $input_dataset in $type_of_data.input:
             #set $identifier=re.sub('[^\w\-\s]', '_', str($input_dataset.element_identifier))
            '${input_dataset},${identifier}'
        #end for
    #end if
    &&
    if [ -d '${output}.files' ] ; then mkdir '${output.extra_files_path}' && mv '${output}.files' '${output.extra_files_path}' ; fi
  ]]></command>
  <inputs>
    <conditional name="type_of_data">
      <param name="type_of_data_selector" type="select" label="What is the type of your input data" help="Choose between Galaxy Taxonomy and generic table format (e.g. from MetaPhlAn or mothur)">
        <option value="taxonomy" selected="True">Taxonomy</option>
        <option value="text">Tabular</option>
      </param>
      <when value="taxonomy">
        <param name="input" type="data" format="taxonomy" multiple="True" label="Input file" help="Select a taxonomy dataset" />
        <param name="max_rank" type="select" label="show ranks from root to" help="-d; Show all level from root up to this point">
            <option value="8">Class</option>
            <option value="0">Show entire tree</option>
            <option value="1">Superkingdom</option>
            <option value="2">Kingdom</option>
            <option value="3">Subkingdom</option>
            <option value="4">Superphylum</option>
            <option value="5">Phylum</option>
            <option value="6">Subphylum</option>
            <option value="7">Superclass</option>
            <option value="9">Subclass</option>
            <option value="10">Superorder</option>
            <option value="11">Order</option>
            <option value="12">Suborder</option>
            <option value="13">Superfamily</option>
            <option value="14">Family</option>
            <option value="15">Subfamily</option>
            <option value="16">Tribe</option>
            <option value="17">Subtribe</option>
            <option value="18">Genus</option>
            <option value="19">Subgenus</option>
            <option value="20">Species</option>
            <option value="21">Subspecies</option>
        </param>
      </when>
      <when value="text">
        <param name="input" type="data" format="tabular" multiple="True" label="Input file" help="Select a MetaPhlAn dataset" />
      </when>
    </conditional>
    <param name="root_name" type="text" value="Root" label="Provide a name for the basal rank" help="-n; Otherwise it will simply be called &quot;Root&quot;"/>
    <param name="combine_inputs" type="boolean" truevalue="-c" falsevalue="" checked="False" label="Combine data from multiple datasets?" help="-c; Combine data from each dataset, rather than creating separate datasets within the chart"/>
  </inputs>
  <outputs>
    <data format="html" name="output" label="${tool.name} on ${on_string}: HTML"/>
  </outputs>
  <tests>
    <test>
      <param name="type_of_data_selector" value="taxonomy"/>
      <param name="input" value="taxonomy_data.tax" ftype="taxonomy" />
      <param name="max_rank" value="Genus"/>
      <param name="root_name" value="Root"/>
      <param name="combine_inputs" value="False"/>
      <output name="output" file="krona_test1.html" ftype="html" lines_diff="102"/>
    </test>
    <test><!-- test with tabular inputs and multiple datasets -->
      <param name="type_of_data_selector" value="text"/>
      <param name="input" value="pampa-small.tsv,anguil-small.tsv" ftype="tabular" />
      <param name="max_rank" value="Genus"/>
      <param name="root_name" value="Root"/>
      <param name="combine_inputs" value="False"/>
      <output name="output" ftype="html">
        <assert_contents>
          <has_text text="KRONA"/>
          <has_text text="pampa-small"/>
          <has_text text="anguil-small"/>
          <has_text text="Proteobacteria"/>
          </assert_contents>
      </output>
    </test>
  </tests>
  <help>
**What it does**

This tool renders results of a metagenomic profiling as a zoomable pie chart using Krona_.


------

**Krona options**

The Galaxy version supports the following options::

  -n   Name of the highest level.
  -c   Combine data from each file, rather than creating separate datasets within the chart.
  -d   Maximum depth of wedges to include in the chart.

-----

**Input format**

*Tabular* input format should be a tab-delimited file with the first column containing a count
and the remaining columns describing the hierarchy. For example::

    2 Fats Saturated fat
    3 Fats Unsaturated fat Monounsaturated fat
    3 Fats Unsaturated fat Polyunsaturated fat
    13 Carbohydrates Sugars
    4 Carbohydrates Dietary fiber
    21 Carbohydrates
    5 Protein
    4

which would yield this `Krona plot`_.

.. _Krona plot: https://marbl.github.io/Krona/examples/xml.krona.html

-----

**License and citation**

This Galaxy tool is Copyright © 2013-2014 `CRS4 Srl.`_ and is released under the `MIT license`_.

.. _CRS4 Srl.: http://www.crs4.it/
.. _MIT license: https://opensource.org/licenses/MIT

You can use this tool only if you agree to the license terms of: `Krona`_.

.. _Krona: https://github.com/marbl/Krona/wiki
  </help>
  <citations>
        <citation type="doi">10.1186/1471-2105-12-385</citation>
        <citation type="doi">10.1093/bioinformatics/btu135</citation>
    </citations>
</tool>