Skip to content

Commit

Permalink
Output restruction for fastk tool
Browse files Browse the repository at this point in the history
  • Loading branch information
SaimMomin12 committed Dec 3, 2024
1 parent 4145612 commit fa7d4d5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
38 changes: 17 additions & 21 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/ktabfiles &&
mkdir -p ktabfiles &&
#if $infile.is_of_type("fastq"):
#set INPUTFILE="input.fastq"
#elif $infile.is_of_type("fastq.gz"):
Expand All @@ -21,17 +21,17 @@
#elif $sorted_table.sorted_table_option == 'yes_with_custom':
-t$sorted_table_cutoff
#end if
-T\${GALAXY_SLOTS:-8} -Noutfiles/output -Poutfiles/ktabfiles
-T\${GALAXY_SLOTS:-8} -Noutput -Pktabfiles
#if $sorted_table.sorted_table_option == 'yes_with_default':
&& Tabex outfiles/output.ktab -t${sorted_table.tabex_threshold_for_default} LIST > '$tabex_hist'
&& cp outfiles/.*.ktab* outfiles/ktabfiles
&& cp outfiles/*.ktab outfiles/ktabfiles
&& Tabex output.ktab -t${sorted_table.tabex_threshold_for_default} LIST > '$tabex_hist'
&& cp .*.ktab* ktabfiles/
&& cp *.ktab ktabfiles/
#elif $sorted_table.sorted_table_option == 'yes_with_custom':
&& Tabex outfiles/output.ktab -t${sorted_table.tabex_threshold_for_custom} LIST > '$tabex_hist'
&& cp outfiles/.*.ktab* outfiles/ktabfiles
&& cp outfiles/*.ktab outfiles/ktabfiles
&& Tabex output.ktab -t${sorted_table.tabex_threshold_for_custom} LIST > '$tabex_hist'
&& cp *.ktab* ktabfiles/
&& cp *.ktab ktabfiles/
#end if
&& tar -c -f fastk.tar ./outfiles/
&& tar -cf fastk.tar ktabfiles/
]]></command>
<inputs>
<param name="infile" type="data" format="fasta,fasta.gz,fastq,fastq.gz,cram,unsorted.bam,sam" label="Input file"/>
Expand All @@ -54,8 +54,8 @@
</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_ktab_out" format="fastk_ktab" from_work_dir="outfiles/ktabfiles/output.ktab" label="${tool.name} on ${on_string}: FastK ktab">
<data name="fastk_hist_out" format="fastk_hist" from_work_dir="output.hist" label="${tool.name} on ${on_string}: FastK hist"/>
<data name="fastk_ktab_out" format="fastk_ktab" from_work_dir="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">
Expand All @@ -66,22 +66,19 @@
<!-- TEST 1 -->
<test expect_num_outputs="2">
<param name="infile" value="input01.fasta.gz"/>
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
</assert_contents>
</output>
<param name="kmer_size" value="40"/>
<output name="fastk_hist_out" file="test01.hist" ftype="fastk_hist"/>
</test>
<!-- TEST 2 -->
<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_hist_out" file="test02.hist" ftype="fastk_hist"/>
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
<has_archive_member path="./outfiles/ktabfiles/output.ktab"/>
<has_archive_member path="ktabfiles/output.ktab"/>
</assert_contents>
</output>
<output name="tabex_hist" file="test02.tabex.txt"/>
Expand All @@ -93,10 +90,10 @@
<param name="sorted_table_option" value="yes_with_custom"/>
<param name="sorted_table_cutoff" value="5"/>
</conditional>
<output name="fastk_hist_out" file="test03.hist" ftype="fastk_hist"/>
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
<has_archive_member path="./outfiles/ktabfiles/output.ktab"/>
<has_archive_member path="ktabfiles/output.ktab"/>
</assert_contents>
</output>
<output name="tabex_hist" file="test03.tabex.txt"/>
Expand All @@ -115,7 +112,6 @@
3. A tar file comprising of hidden .ktab files that can be used for downstream FASTK tools.
]]></help>
<expand macro="citations"/>
</tool>
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.1.0</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<xrefs>
<xref type="bio.tools">fastk</xref>
</xrefs>
Expand Down
Binary file added tools/fastk/test-data/test01.hist
Binary file not shown.
Binary file added tools/fastk/test-data/test02.hist
Binary file not shown.
Binary file added tools/fastk/test-data/test03.hist
Binary file not shown.

0 comments on commit fa7d4d5

Please sign in to comment.