Skip to content

Commit

Permalink
Reduced database, possibility of having the 2 types of report
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolefeuvre committed Nov 19, 2024
1 parent 65c07c3 commit 3efd6ab
Show file tree
Hide file tree
Showing 17 changed files with 8,136 additions and 12,546 deletions.
103 changes: 74 additions & 29 deletions tools/mmseqs2/mmseqs2_taxonomy_assignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,32 @@ mmseqs createtsv
##--compressed INT Write compressed output [0]
##-v INT Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]
##--db-output BOOL Return a result DB instead of a text file [0]
#if str($kraken_report.keep_report) == "Yes"
&&
mmseqs taxonomyreport
'$createtaxdb.database_type.mmseqs2_db_select.fields.path'
'output_taxonomy'
#if str($output_mode.report_mode) == "Kraken"
mmseqs taxonomyreport
'$createtaxdb.database_type.mmseqs2_db_select.fields.path'
'output_taxonomy'
'taxo_result.txt'
--report-mode 0
#elif str($output_mode.report_mode) == "Krona"
--threads "\${GALAXY_SLOTS:-1}"
#end if
#if str($krona_report.keep_report) == "Yes"
&&
mmseqs taxonomyreport
'$createtaxdb.database_type.mmseqs2_db_select.fields.path'
'output_taxonomy'
'taxo_result.html'
--report-mode 1
#end if
--threads "\${GALAXY_SLOTS:-1}"
--threads "\${GALAXY_SLOTS:-1}"
#end if
##-v INT Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]
]]></command>
<inputs>
<section name="createdb" title="Convert FASTA/Q file(s) to MMseqs sequence DB format" expanded="true">
<param name="input_fasta" type="data" format="fasta,fasta.gz" label="Input fasta file" help="" />
<param argument="--dbtype" type="select" label="Database type" help="" >
<param argument="--dbtype" type="select" label="Input type" help="" >
<option value="0" selected="true">Auto</option>
<option value="1">Amino acid</option>
<option value="2">Nucleotides</option>
Expand Down Expand Up @@ -262,7 +269,7 @@ mmseqs taxonomyreport
</when>
</conditional>
</section>
<section name="taxonomy" title="Taxonomy assignment by computing the lowest common ancestor of homologs" expanded="true">
<section name="taxonomy" title="Taxonomy assignment by computing the lowest common ancestor of homologs">
<conditional name="alph_type">
<param name="type" type="select" label="Alphabet type" help="" >
<option value="amino_acid" selected="true">Amino acid</option>
Expand Down Expand Up @@ -496,22 +503,30 @@ mmseqs taxonomyreport
<option value="2">Input sequences</option>
</param>
</section>
<conditional name="output_mode">
<param name="report_mode" type="select" label="Report mode" help="" >
<option value="Kraken" selected="true">Kraken</option>
<option value="Krona">Krona</option>
<conditional name="kraken_report">
<param name="keep_report" type="select" label="Do you want a Kraken style report" help="" >
<option value="Yes" selected="true">Yes</option>
<option value="No">No</option>
</param>
<when value="Kraken"/>
<when value="Krona"/>
<when value="Yes"/>
<when value="No"/>
</conditional>
<conditional name="krona_report">
<param name="keep_report" type="select" label="Do you want a Krona style report" help="" >
<option value="Yes" selected="true">Yes</option>
<option value="No">No</option>
</param>
<when value="Yes"/>
<when value="No"/>
</conditional>
</inputs>
<outputs>
<data name="output_taxonomy_tsv" format="tabular" from_work_dir="taxo_result.tsv" label="${tool.name} on ${on_string}: Taxonomy Report"/>
<data name="output_taxonomy_kraken" format="txt" from_work_dir="taxo_result.txt" label="${tool.name} on ${on_string}: Kraken Report">
<filter>output_mode['report_mode'] == "Kraken"</filter>
<filter>kraken_report['keep_report'] == "Yes"</filter>
</data>
<data name="output_taxonomy_krona" format="html" from_work_dir="taxo_result.html" label="${tool.name} on ${on_string}: Krona Report">
<filter>output_mode['report_mode'] == "Krona"</filter>
<filter>krona_report['keep_report'] == "Yes"</filter>
</data>
</outputs>
<tests>
Expand All @@ -526,21 +541,23 @@ mmseqs taxonomyreport
<param name="mmseqs2_db_select" value="UniProtKB/Swiss-Prot-15.6f452-15112024" />
</conditional>
</section>
<conditional name="krona_report">
<param name="keep_report" value="No"/>
</conditional>
<output name="output_taxonomy_tsv" ftype="tabular">
<assert_contents>
<has_line line="MYSTERY.40&#009;48736&#009;genus&#009;Ralstonia&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.245&#009;1236&#009;class&#009;Gammaproteobacteria&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.222&#009;1236&#009;class&#009;Gammaproteobacteria&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.64&#009;119060&#009;family&#009;Burkholderiaceae&#009;1&#009;1&#009;1&#009;1.000"/>
<has_n_columns n="8"/>
</assert_contents>
</output>
<output name="output_taxonomy_kraken" ftype="txt">
<assert_contents>
<has_text text="92.4453"/>
<has_text text="13.7177"/>
<has_text text="93.3333"/>
<has_text text="33.3333"/>
</assert_contents>
</output>
</test>
<!-- Test with Krona report -->
<test expect_num_outputs="2">
<section name="createdb">
<param name="input_fasta" value="light_mystery_reads.fasta" ftype="fasta"/>
Expand All @@ -551,13 +568,36 @@ mmseqs taxonomyreport
<param name="mmseqs2_db_select" value="UniProtKB/Swiss-Prot-15.6f452-15112024" />
</conditional>
</section>
<conditional name="output_mode">
<param name="report_mode" value="Krona"/>
<conditional name="kraken_report">
<param name="keep_report" value="No"/>
</conditional>
<output name="output_taxonomy_tsv" ftype="tabular">
<assert_contents>
<has_line line="MYSTERY.40&#009;48736&#009;genus&#009;Ralstonia&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.245&#009;1236&#009;class&#009;Gammaproteobacteria&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.222&#009;1236&#009;class&#009;Gammaproteobacteria&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.64&#009;119060&#009;family&#009;Burkholderiaceae&#009;1&#009;1&#009;1&#009;1.000"/>
<has_n_columns n="8"/>
</assert_contents>
</output>
<output name="output_taxonomy_krona" ftype="html">
<assert_contents>
<has_line line="// Krona is a flexible tool for exploring the relative proportions of"/>
</assert_contents>
</output>
</test>
<test expect_num_outputs="3">
<section name="createdb">
<param name="input_fasta" value="light_mystery_reads.fasta" ftype="fasta"/>
</section>
<section name="createtaxdb">
<conditional name="database_type">
<param name="type" value="amino_acid"/>
<param name="mmseqs2_db_select" value="UniProtKB/Swiss-Prot-15.6f452-15112024" />
</conditional>
</section>
<output name="output_taxonomy_tsv" ftype="tabular">
<assert_contents>
<has_line line="MYSTERY.222&#009;1236&#009;class&#009;Gammaproteobacteria&#009;1&#009;1&#009;1&#009;1.000"/>
<has_line line="MYSTERY.64&#009;119060&#009;family&#009;Burkholderiaceae&#009;1&#009;1&#009;1&#009;1.000"/>
<has_n_columns n="8"/>
</assert_contents>
</output>
Expand All @@ -566,8 +606,14 @@ mmseqs taxonomyreport
<has_line line="// Krona is a flexible tool for exploring the relative proportions of"/>
</assert_contents>
</output>
<output name="output_taxonomy_kraken" ftype="txt">
<assert_contents>
<has_text text="93.3333"/>
<has_text text="33.3333"/>
</assert_contents>
</output>
</test>
<!-- Test with Kraken report - SILVA DB -->
<!--
<test expect_num_outputs="2">
<section name="createdb">
<param name="input_fasta" value="light_mystery_reads.fasta" ftype="fasta"/>
Expand All @@ -592,7 +638,6 @@ mmseqs taxonomyreport
</assert_contents>
</output>
</test>
<!-- Test with Krona report - SILVA DB -->
<test expect_num_outputs="2">
<section name="createdb">
<param name="input_fasta" value="light_mystery_reads.fasta" ftype="fasta"/>
Expand All @@ -618,7 +663,7 @@ mmseqs taxonomyreport
<has_line line="// Krona is a flexible tool for exploring the relative proportions of"/>
</assert_contents>
</output>
</test>
</test>-->
</tests>
<help><![CDATA[
**MMseqs2: ultra fast and sensitive sequence search and clustering suite**
Expand Down
Binary file added tools/mmseqs2/test-data/Swiss-Prot
Binary file not shown.
Binary file added tools/mmseqs2/test-data/Swiss-Prot.dbtype
Binary file not shown.
Loading

0 comments on commit 3efd6ab

Please sign in to comment.