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

Mothur #436

Merged
merged 5 commits into from Nov 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/mothur/tools/mothur/macros.xml
@@ -0,0 +1,7 @@
<macros>
<xml name="requirements">
<requirements>
<requirement type="package" version="1.33">mothur</requirement>
</requirements>
</xml>
</macros>
116 changes: 55 additions & 61 deletions tools/mothur/tools/mothur/merge.files.xml
@@ -1,64 +1,55 @@
<tool id="mothur_merge_files" name="Merge.files" version="1.20.0">
<description>Merge data</description>
<command interpreter="python">
mothur_wrapper.py
--cmd='merge.files'
--result='^mothur.\S+\.logfile$:'$logfile,'mergefile:'$output
--outputdir='$logfile.extra_files_path'
--input=${merge.input}#for i in $merge.inputs#,${i.input}#end for#
--output='mergefile'
</command>
<inputs>
<conditional name="merge">
<param name="type" type="select" format="fasta,qual,groups,names,accnos" label="Merge">
<option value="fasta">fasta</option>
<option value="qual">qual</option>
<option value="groups">groups</option>
<option value="names">names</option>
<option value="accnos">accnos</option>
</param>
<when value="fasta">
<param name="input" type="data" format="fasta" label="input - fasta"/>
<repeat name="inputs" title="And fasta">
<param name="input" type="data" format="fasta" label="input - fasta"/>
</repeat>
</when> <!-- fasta -->
<when value="qual">
<param name="input" type="data" format="qual" label="input - qual"/>
<repeat name="inputs" title="And qual">
<param name="input" type="data" format="qual" label="input - qual"/>
</repeat>
</when> <!-- qual -->
<when value="groups">
<param name="input" type="data" format="groups" label="input - groups"/>
<repeat name="inputs" title="And group">
<param name="input" type="data" format="groups" label="input - groups"/>
</repeat>
</when> <!-- groups -->
<when value="names">
<param name="input" type="data" format="names" label="input - names"/>
<repeat name="inputs" title="And name">
<param name="input" type="data" format="names" label="input - names"/>
</repeat>
</when> <!-- names -->
<when value="accnos">
<param name="input" type="data" format="accnos" label="input - accnos"/>
<repeat name="inputs" title="And accno">
<param name="input" type="data" format="accnos" label="input - accnos"/>
</repeat>
</when> <!-- fasta -->
</conditional> <!-- merge -->
</inputs>
<outputs>
<data format="html" name="logfile" label="${tool.name} on ${on_string}: logfile" />
<data format="input" name="output" label="${tool.name} on ${on_string}: ${merge.type}"/>
</outputs>
<requirements>
<requirement type="package" version="1.33">mothur</requirement>
</requirements>
<tests>
</tests>
<help>
<description>Merge data</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements" />
<command interpreter="python"><![CDATA[
mothur_wrapper.py
--cmd='merge.files'
--result='^mothur.\S+\.logfile$:'$logfile,'mergefile:'$output
--outputdir='$logfile.extra_files_path'
--input=${merge.inputs}
--output='mergefile'
]]></command>
<inputs>
<conditional name="merge">
<param name="type" type="select" format="fasta,qual,groups,names,accnos" label="Merge">
<option value="fasta">fasta</option>
<option value="qual">qual</option>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shiltemann I guess we can replace this entirely by:

<param name="inputs" type="data" format="fasta,qual,groups,names,accnos" multiple="true" label="inputs - fasta"/>

Do we need the select box for datatype?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be fine by me, I just don't know how much users want/need/like the filtering on their inputs to ensure they select all files of the same and intended datatype.. maybe some of the others can weigh in on this too..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all files must be of the same type, then I'm in favour of @shiltemann's approach here. If mixed are a allowed I lean towards @bgruening's.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only makes sense if the files are all of the same type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand it (but I'm no mothur expert), you would only ever do a merge on files of the same data type. If we can add a validator to the param to check all files are same format that would probably work too, but I don't know if that's possible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably easier to write than a validator and clearer to the users about the expectations.

<option value="groups">groups</option>
<option value="names">names</option>
<option value="accnos">accnos</option>
</param>
<when value="fasta">
<param name="inputs" type="data" format="fasta" multiple="true" label="inputs - fasta"/>
</when> <!-- fasta -->
<when value="qual">
<param name="inputs" type="data" format="qual" multiple="true" label="inputs - qual"/>
</when> <!-- qual -->
<when value="groups">
<param name="inputs" type="data" format="groups" multiple="true" label="inputs - groups"/>
</when> <!-- groups -->
<when value="names">
<param name="inputs" type="data" format="names" multiple="true" label="inputs - names"/>
</when> <!-- names -->
<when value="accnos">
<param name="inputs" type="data" format="accnos" multiple="true" label="inputs - accnos"/>
</when> <!-- fasta -->
</conditional> <!-- merge -->
</inputs>
<outputs>
<data format="html" name="logfile" label="${tool.name} on ${on_string}: logfile" />
<data format_source="inputs" name="output" label="${tool.name} on ${on_string}: ${merge.type}"/>
</outputs>
<tests>
<test>
<param name="type" value="fasta" />
<param name="inputs" value="sample1.fa,sample2.fa,sample3.fa"/>
<output name="output" file="output.fa" ftype="fasta"/>
</test>
</tests>
<help>
**Mothur Overview**

Mothur_, initiated by Dr. Patrick Schloss and his software development team
Expand All @@ -74,5 +65,8 @@ The merge.files_ command merge inputs into a single output.
.. _merge.files: http://www.mothur.org/wiki/Merge.files


</help>
</help>
<citations>
<citation type="doi">10.1128/AEM.01541-09</citation>
</citations>
</tool>
12 changes: 12 additions & 0 deletions tools/mothur/tools/mothur/test-data/output.fa
@@ -0,0 +1,12 @@
> seq1 This is the description of my first sequence in sample 1.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
> seq2 This is a description of my second sequence in sample 1.
CGATCGATCGTACGTCGACTGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG
> seq1 This is the description of my first and only sequence in sample 2.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
> seq1 This is the description of my first sequence in sample 3.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
> seq2 This is a description of my second sequence in sample 3.
CGATCGATCGTACGTCGACTGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG
> seq3 This is a description of my third sequence in sample 3.
CGATCGATCGTACGTCGACTAGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGCGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG
4 changes: 4 additions & 0 deletions tools/mothur/tools/mothur/test-data/sample1.fa
@@ -0,0 +1,4 @@
> seq1 This is the description of my first sequence in sample 1.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
> seq2 This is a description of my second sequence in sample 1.
CGATCGATCGTACGTCGACTGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG
2 changes: 2 additions & 0 deletions tools/mothur/tools/mothur/test-data/sample2.fa
@@ -0,0 +1,2 @@
> seq1 This is the description of my first and only sequence in sample 2.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
6 changes: 6 additions & 0 deletions tools/mothur/tools/mothur/test-data/sample3.fa
@@ -0,0 +1,6 @@
> seq1 This is the description of my first sequence in sample 3.
AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC
> seq2 This is a description of my second sequence in sample 3.
CGATCGATCGTACGTCGACTGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG
> seq3 This is a description of my third sequence in sample 3.
CGATCGATCGTACGTCGACTAGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGCGATCGTAGCTACGTCGTACGTAGCATCGTCAGTTACTGCATGCTCG