Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new tool] ETE treeview #6614

Merged
merged 26 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tools/ete-toolkit/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: ete-toolkit
bgruening marked this conversation as resolved.
Show resolved Hide resolved
owner: iuc
categories:
- Phylogenetics
description: A toolkit for the analysis and visualization of trees.
long_description: |
The Environment for Tree Exploration (ETE) is a computational framework that simplifies the
reconstruction, analysis, and visualization of phylogenetic trees and multiple sequence alignments.
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/ete-toolkit
homepage_url: http://etetoolkit.org
type: unrestricted
132 changes: 132 additions & 0 deletions tools/ete-toolkit/ete-treeviewer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<tool id="ete_treeviewer" name="ETE tree viewer" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01" license="MIT">
<description>visualize a phylogenetic tree</description>
<macros>
<token name="@TOOL_VERSION@">3.1.3</token>
<token name="@VERSION_SUFFIX@">0</token>
</macros>
<edam_topics>
<edam_topic>topic_3293</edam_topic> <!-- phylogenetics -->
</edam_topics>
<edam_operations>
<edam_operation>operation_0567</edam_operation> <!-- phylogenetic tree visualisation -->
</edam_operations>
<xrefs>
<xref type="bio.tools">ete</xref>
</xrefs>
<requirements>
<!--<requirement type="package" version="@TOOL_VERSION@">ete3</requirement>-->
<requirement type="package" version="8.10.1">curl</requirement>
<requirement type="package" version="2.13.5">libxml2</requirement>
<requirement type="package" version="7.1.1_41">imagemagick</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[

curl http://etetoolkit.org/get_svg/
-X POST
--retry 10
#if $align.align_choice == 'yes'
-d "tree=\$(cat '$input_tree');fasta=\$(cat '$align.input_alignment');alg_type=$align.alg_type;$ncbitaxa" | xmllint --format - > tree.svg
#else
-d "tree=\$(cat '$input_tree');$ncbitaxa" | xmllint --format - > tree.svg
#end if

#if $output_format == 'png'
&& convert tree.svg tree.png
&& cp tree.png '$output_tree_image'
shiltemann marked this conversation as resolved.
Show resolved Hide resolved
shiltemann marked this conversation as resolved.
Show resolved Hide resolved
#else
&& cp tree.svg '$output_tree_image'
shiltemann marked this conversation as resolved.
Show resolved Hide resolved
#end if

]]></command>
<inputs>
<param name="input_tree" type="data" format="newick" label="Newick Tree to visualise" />
<conditional name="align">
<param name="align_choice" type="select" label="Add alignment information to image?" help="Will display alignments in the tree view">
<option value="yes">yes</option>
<option value="no" selected="true">no</option>
</param>
<when value="yes">
<param name="input_alignment" type="data" format="fasta" optional="true" label="Multiple Alignment FASTA file" help="If provided, will add alignment visualisation to tree image" />
<param name="alg_type" type="select" multiple="false" label="Alignment display style" help="Will be ignored if no alignment file provided.">
<option value="block">Aligned blocks</option>
<option value="condensed" selected="true">Condensed format</option>
</param>
</when>
<when value="no"/>
</conditional>

<param name="ncbitaxa" type="boolean" checked="true" truevalue="ncbitaxa=true;" falsevalue="" label="Resolve Taxonomic IDs?" help="Use NCBI numeric taxids as leaf names (or in the format TaxID.sequenceName) in your tree." />
<param name="output_format" type="select" multiple="false" label="Format of the output image." help="SVG or PNG">
<option value="svg" selected="true">SVG</option>
<option value="png">PNG</option>
</param>
</inputs>
<outputs>
<data name="output_tree_image" format="svg" label="${tool.name} on ${on_string}: Tree Image">
<change_format>
<when input="output_format" value="png" format="png"/>
</change_format>
</data>
</outputs>
<tests>
<test expect_num_outputs="1"><!-- test 1: with NCBI TaxIDs -->
<param name="input_tree" value="quicktree_alignment_VARL_NCBI.tre" ftype="newick"/>
<output name="output_tree_image" file="quicktree_VARL_NCBI.svg" ftype="svg" lines_diff="500" />
</test>
<test expect_num_outputs="1"><!-- test 2: with alignment file -->
<param name="input_tree" value="example-tree-ncbi.tree" ftype="newick"/>
<param name="align_choice" value="yes" />
<param name="input_alignment" value="example-alignment.fa" ftype="fasta"/>
<output name="output_tree_image" file="example-treeview.svg" ftype="svg" lines_diff="1500"/>
</test>
<test expect_num_outputs="1"><!-- test 3: with aligment style set -->
<param name="input_tree" value="example-tree-ncbi.tree" ftype="newick"/>
<param name="align_choice" value="yes" />
<param name="input_alignment" value="example-alignment.fa" ftype="fasta"/>
<param name="alg_type" value="block"/>
<output name="output_tree_image" file="example-treeview-block.svg" ftype="svg" lines_diff="1500"/>
</test>
<test expect_num_outputs="1"><!-- test 4: minimal tree, no taxonomy, no alignment -->
<param name="input_tree" value="quicktree_alignment_VARL.tre" ftype="newick"/>
<param name="align_choice" value="no" />
<output name="output_tree_image" file="minimal-tree-out.svg" ftype="svg" lines_diff="0"/>
</test>
<test expect_num_outputs="1"><!-- test 5: png output -->
<param name="input_tree" value="quicktree_alignment_VARL.tre" ftype="newick"/>
<param name="output_format" value="png" />
<output name="output_tree_image" file="minimal-tree-out.png" ftype="png" compare="sim_size"/>
</test>
</tests>
<help><![CDATA[

.. class:: infomark

**What it does**

This is a tool for phylogenetic tree view (newick format) that allows multiple sequence alignments to be shown together with the trees (fasta format). It uses the tree drawing engine implemented in the ETE toolkit, and offers transparent integration with the NCBI taxonomy database. Currently, alignments can be displayed in condensed or block-based format.

**Input**

Input trees should be in Newick format. Optionally a fasta alignment may also be provided. Leaf names in the newick tree should match those in the fasta alignment.

Tip: Use NCBI numeric taxids as leaf names (or in the format TaxID.sequenceName) to get on-the-fly translation of species names and lineages.

For example::

((6669.DappuP312785:1.24473,(((7739.JGI126010:4.02e-06,7739.JGI126021:0.168081)0.99985:0.848895, [..]

where 66969 and 7739 are NCBI TaXIDs.

**Output**

The tool will output a tree image in SVG or PNG format.

.. image:: $PATH_TO_IMAGES/example-treeview.png
:width: 50%
:alt: example tree image

]]></help>
<citations>
<citation type="doi">10.1093/molbev/msw046</citation>
</citations>
</tool>
shiltemann marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading