Skip to content

Commit

Permalink
FastK: Added ktab files to output and minor changes (galaxyproject#6007)
Browse files Browse the repository at this point in the history
* Added ktab files to output and minor changes

* version bump
  • Loading branch information
SaimMomin12 authored May 14, 2024
1 parent 8dc7b89 commit dbdc7c7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
27 changes: 17 additions & 10 deletions tools/fastk/fastk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</macros>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
mkdir -p outfiles/tmpfiles &&
mkdir -p outfiles/ktabfiles &&
#if $infile.is_of_type("fastq"):
#set INPUTFILE="input.fastq"
#elif $infile.is_of_type("fastq.gz"):
Expand All @@ -21,17 +21,21 @@
#elif $sorted_table.sorted_table_option == 'yes_with_custom':
-t$sorted_table_cutoff
#end if
-T\${GALAXY_SLOTS:-8} -Noutfiles/output -Poutfiles/tmpfiles
-T\${GALAXY_SLOTS:-8} -Noutfiles/output -Poutfiles/ktabfiles
#if $sorted_table.sorted_table_option == 'yes_with_default':
&& Tabex outfiles/output.ktab -t${sorted_table.tabex_threshold_for_default} LIST > '$tabex_hist'
&& mv outfiles/.*.ktab* outfiles/ktabfiles
&& mv outfiles/*.ktab outfiles/ktabfiles
#elif $sorted_table.sorted_table_option == 'yes_with_custom':
&& Tabex outfiles/output.ktab -t${sorted_table.tabex_threshold_for_custom} LIST > '$tabex_hist'
&& mv outfiles/.*.ktab* outfiles/ktabfiles
&& mv outfiles/*.ktab outfiles/ktabfiles
#end if
&& tar -c -f fastk.tar ./outfiles/
]]></command>
<inputs>
<param name="infile" type="data" format="fasta,fasta.gz,fastq,fastq.gz,cram,unsorted.bam,sam" label="Input file"/>
<param name="kmer_size" argument="-k" type="integer" min="5" max="50" value="40" label="Enter desired k-mer size" help="Default: 40" />
<param name="kmer_size" argument="-k" type="integer" min="5" max="50" value="40" label="Enter desired k-mer size" help="Default: 40"/>
<conditional name="sorted_table">
<param name="sorted_table_option" type="select" label="Sort table" help="Do you want a sorted table of all canonical k-mers and their counts? The sorted table is sorted lexicographically on the k-mer where a &lt; c &lt; g &lt; t.">
<option value="no">No</option>
Expand All @@ -50,7 +54,10 @@
</inputs>
<outputs>
<data name="fastk_out" format="tar" from_work_dir="fastk.tar" label="${tool.name} on ${on_string}: FastK files"/>
<data name="fastk_hist_out" format="fastk_hist" from_work_dir="outfiles/output.hist" label="${tool.name} on ${on_string}: FastK hist" />
<data name="fastk_hist_out" format="fastk_hist" from_work_dir="outfiles/output.hist" label="${tool.name} on ${on_string}: FastK hist"/>
<data name="fastk_ktab_out" format="fastk_ktab" from_work_dir="outfiles/ktabfiles/output.ktab" label="${tool.name} on ${on_string}: FastK ktab">
<filter> sorted_table['sorted_table_option'] != 'no' </filter>
</data>
<data name="tabex_hist" format="txt" label="${tool.name} on ${on_string}: Tabex output">
<filter> sorted_table['sorted_table_option'] != 'no' </filter>
</data>
Expand All @@ -66,21 +73,21 @@
</output>
</test>
<!-- TEST 2 -->
<test expect_num_outputs="3">
<test expect_num_outputs="4">
<param name="infile" value="input01.fasta.gz"/>
<conditional name="sorted_table">
<param name="sorted_table_option" value="yes_with_default"/>
</conditional>
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
<has_archive_member path="./outfiles/output.ktab"/>
<has_archive_member path="./outfiles/ktabfiles/output.ktab"/>
</assert_contents>
</output>
<output name="tabex_hist" value="test02.tabex.txt"/>
<output name="tabex_hist" file="test02.tabex.txt"/>
</test>
<!-- TEST 3 -->
<test expect_num_outputs="3">
<test expect_num_outputs="4">
<param name="infile" value="input01.fasta.gz"/>
<conditional name="sorted_table">
<param name="sorted_table_option" value="yes_with_custom"/>
Expand All @@ -89,10 +96,10 @@
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
<has_archive_member path="./outfiles/output.ktab"/>
<has_archive_member path="./outfiles/ktabfiles/output.ktab"/>
</assert_contents>
</output>
<output name="tabex_hist" value="test03.tabex.txt"/>
<output name="tabex_hist" file="test03.tabex.txt"/>
</test>
</tests>
<help><![CDATA[
Expand Down
2 changes: 1 addition & 1 deletion tools/fastk/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">1.0.0</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">fastk</requirement>
Expand Down

0 comments on commit dbdc7c7

Please sign in to comment.