-
Notifications
You must be signed in to change notification settings - Fork 441
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
Add Quicktree tool #6583
Merged
Merged
Add Quicktree tool #6583
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c51137e
add tool and basic test
shiltemann f47a837
add input type conditional
shiltemann 55252e5
add tests for multiple input alignment formats
shiltemann b2ca5da
add parameters, clean up help, set output format
shiltemann 18cb93b
phylip in Galaxy means alignment phylip
shiltemann 89a8d65
phylip in Galaxy means alignment phylip
shiltemann 66e4f50
Update tools/quicktree/quicktree.xml
bgruening 7319518
implement output format choice
shiltemann 7e460c2
test with square distance matrix
shiltemann e4cf2b8
add more help about formats
shiltemann eaef75b
fix formats
shiltemann 91d660b
fix formats
shiltemann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
categories: | ||
- Phylogenetics | ||
description: neighbour-joining phylogenetic inference | ||
long_description: | | ||
QuickTree is an efficient implementation of the Neighbor-Joining | ||
algorithm, capable of reconstructing phylogenies from huge alignments | ||
homepage_url: https://github.com/khowe/quicktree | ||
name: quicktree | ||
owner: iuc | ||
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/quicktree | ||
type: unrestricted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
<tool id="quicktree" name="Quicktree" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01"> | ||
<description></description> | ||
<macros> | ||
<token name="@TOOL_VERSION@">2.5</token> | ||
<token name="@VERSION_SUFFIX@">0</token> | ||
</macros> | ||
<edam_topics> | ||
<edam_topic>topic_3293</edam_topic> <!-- phylogenetics --> | ||
</edam_topics> | ||
<edam_operations> | ||
<edam_operation>operation_0540</edam_operation> <!-- Phylogenetic inference (from molecular sequences) --> | ||
</edam_operations> | ||
<requirements> | ||
<requirement type="package" version="@TOOL_VERSION@">quicktree</requirement> | ||
<requirement type="package" version="3.4">hmmer</requirement> <!-- for file conversion with esl-reformat--> | ||
</requirements> | ||
<version_command>quicktree -v</version_command> | ||
<command detect_errors="exit_code"><![CDATA[ | ||
|
||
## convert alignment to stockholm before quicktree if needed | ||
#if $input_type.format == "align" | ||
esl-reformat -o input.quicktree stockholm '$input_file' ##--informat a2m | ||
#else | ||
ln -s '$input_file' input.quicktree | ||
#end if | ||
|
||
&& | ||
|
||
quicktree | ||
#if $input_type.format =="align" | ||
-in a | ||
#else | ||
-in m | ||
#end if | ||
#if $output_type == 'tree_out' | ||
-out t | ||
#else | ||
-out m | ||
#end if | ||
$upgma | ||
$kimura | ||
#if $boot | ||
-boot $boot | ||
#end if | ||
input.quicktree | ||
> '$output_file' | ||
|
||
]]></command> | ||
<inputs> | ||
<conditional name="input_type"> | ||
<param name="format" type="select" label="Provide an alignment file or a distance matrix?"> | ||
<option value="align">Alignment File</option> | ||
<option value="dist">Distance Matrix</option> | ||
</param> | ||
<when value="align"> | ||
<param name="input_file" type="data" format="fasta,stockholm,phylip,txt" label="Alignment file" /> | ||
</when> | ||
<when value="dist"> | ||
<param name="input_file" type="data" format="mothur.dist,mothur.lower.dist,mothur.square.dixt,txt" label="Distance Matrix" help="A distance matrix in phylip format (see help below for details). Can be a square distance matrix or a lower triangle distance matrix." /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I answer this myself: No :) |
||
</when> | ||
</conditional> | ||
<param argument="-upgma" type="boolean" truevalue="-upgma" falsevalue="" checked="false" label="Use the UPGMA method to construct the tree" help="ignored for distance matrix outputs"/> | ||
<param argument="-kimura" type="boolean" truevalue="-kimura" falsevalue="" checked="false" label="Use the kimura translation for pairwise distances" help="ignored for distance matrix outputs"/> | ||
<param argument="-boot" type="integer" optional="true" min="0" label="Calcuate bootstrap values with n iterations" help="ignored for distance matrix outputs"/> | ||
<param name="output_type" type="select" multiple="false" label="Choose output format"> | ||
<option value="dist_out">Distance Matrix (Phylip format)</option> | ||
<option value="tree_out" selected="true">Tree (Newick format)</option> | ||
</param> | ||
</inputs> | ||
<outputs> | ||
<data name="output_file" format="newick" label="${tool.name} on ${on_string}: stockholm format"> | ||
<change_format> | ||
<when input="output_type" value="dist_out" format="mothur.dist" /> | ||
</change_format> | ||
</data> | ||
</outputs> | ||
<tests> | ||
<test expect_num_outputs="1"><!-- test 1: with fasta input (with reformat) --> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.009.AA.fasta" ftype="fasta"/> | ||
<output name="output_file" file="example.009.AA.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 2: with stockholm input (no reformat)--> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.009.AA.stockholm" ftype="stockholm"/> | ||
<output name="output_file" file="example.009.AA.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 3: with clustalw input --> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.011.AA.clw" ftype="txt"/> | ||
<output name="output_file" file="example.011.AA.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 4: with phylip distance matrix input (lower triangle distance matrix) --> | ||
<param name="format" value="dist"/> | ||
<param name="input_file" value="example.001.AA.dist.lt.phy" ftype="mothur.dist"/> | ||
<output name="output_file" file="example.001.AA.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 5: with phylip distance matrix input (square distance matrix) --> | ||
<param name="format" value="dist"/> | ||
<param name="input_file" value="example_dist_square_phylip.dist" ftype="mothur.dist"/> | ||
<output name="output_file" file="example_dist_square_phylip.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 6: with phylip alignment input --> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.011.AA.phy" ftype="phylip"/> | ||
<output name="output_file" file="example.011.AA.align.newick" ftype="newick"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 7: with distance matrix output --> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.009.AA.fasta" ftype="fasta"/> | ||
<param name="output_type" value="dist_out"/> | ||
<output name="output_file" file="example.009.AA.dist" ftype="mothur.dist"/> | ||
</test> | ||
<test expect_num_outputs="1"><!-- test 8: test with all parameters set --> | ||
<param name="format" value="align"/> | ||
<param name="input_file" value="example.011.AA.phy" ftype="phylip"/> | ||
<param name="upgma" value="-upgma"/> | ||
<param name="kimura" value="-kimura"/> | ||
<param name="boot" value="100"/> | ||
<output name="output_file" file="example.011.AA.align.params.newick" ftype="newick"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
|
||
.. class:: infomark | ||
|
||
**What it does** | ||
|
||
QuickTree is an efficient implementation of the Neighbor-Joining algorithm, capable of reconstructing phylogenies | ||
from huge alignments in time less than the age of the universe. | ||
|
||
|
||
**Input** | ||
|
||
QuickTree accepts both distance matrix and multiple-sequence-aligment inputs. The former should be in PHYLIP format. The latter should be in Stockholm format, which is the native alignment format for the Pfam database. | ||
|
||
Alignments can be supplied in various other formats (fasta, phylip, clustalw, pfam, psiblast, selex) and will be converted to Stockholm format with the esl-reformat program, | ||
which is part of the HMMer package (hmmer.org). | ||
|
||
**Output** | ||
|
||
Quicktree will output either a distance matrix (in PHYLIP format, square distance matrix) or a Newick tree. | ||
|
||
|
||
**File Formats** | ||
|
||
The **distance matrix** input should be in phylip format, it can be a square matrix or a lower triangle matrix. | ||
The distance matrix output by quicktree will be a square matrix. | ||
|
||
Example square distance matrix in phylip format:: | ||
|
||
5 | ||
Alpha 0.000 1.000 2.000 3.000 3.000 | ||
Beta 1.000 0.000 2.000 3.000 3.000 | ||
Gamma 2.000 2.000 0.000 3.000 3.000 | ||
Delta 3.000 3.000 3.000 0.000 1.000 | ||
Epsilon 3.000 3.000 3.000 1.000 0.000 | ||
|
||
Example of a lower triangle matrix:: | ||
|
||
7 | ||
Mouse | ||
Bovine 1.7043 | ||
Lemur 2.0235 1.1901 | ||
Orang 2.0593 1.2005 1.5356 | ||
Gorilla 1.6664 1.3460 1.4577 1.5935 | ||
Chimp 1.7320 1.3757 1.7803 1.7119 1.0635 | ||
Human 1.7101 1.3956 1.6661 1.7599 1.0557 0.6933 | ||
|
||
|
||
* For more details about the PHYLIP distance matrix format, see https://phylipweb.github.io/phylip/doc/distance.html | ||
* For more details about the Newick output format, see https://phylipweb.github.io/phylip/newicktree.html | ||
|
||
]]></help> | ||
<citations> | ||
<citation type="doi">10.1093/oxfordjournals.molbev.a040454</citation> | ||
</citations> | ||
</tool> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also do this if/else dance based on the filetype
$input_type.ext
and avoid the conditional. But maybe explicit is better than implicit here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I did it this way because "phylip" format can unhelpfully refer to either a distance matrix format or an alignment format in this tool so I figured I would make it explicit for the user which they are supplying. But I will check if Galaxy has a sniffer for phylip and which format it assumes when a file is marked as phylip and see if I can streamline that part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, looks like Galaxy's definition of phylip is the alignment version, but that still leaves the issue that distance matrices and some of the supported alignment file types will both be 'txt' in Galaxy currently so I think the conditional is still good here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Ship it if your like I will make sure its installed on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Independent of this PR,
esl-reformat
might be cool as extra tool.