Skip to content

Commit

Permalink
Merge pull request #6608 from SaimMomin12/fastk_update
Browse files Browse the repository at this point in the history
Update to fastk tool: Output restructuring
  • Loading branch information
bgruening authored Dec 6, 2024
2 parents abbc840 + 77633d0 commit 9412d51
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
39 changes: 20 additions & 19 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,21 +54,23 @@
</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">
<filter> sorted_table['sorted_table_option'] != 'no' </filter>
</data>
</outputs>
<tests>
<!-- TEST 1 -->
<!-- TEST 1 -->
<test expect_num_outputs="2">
<param name="infile" value="input01.fasta.gz"/>
<param name="kmer_size" value="40"/>
<output name="fastk_hist_out" file="test01.hist" ftype="fastk_hist"/>
<output name="fastk_out" ftype="tar">
<assert_contents>
<has_archive_member path="./outfiles/output.hist"/>
<has_archive_member path="ktabfiles"/>
</assert_contents>
</output>
</test>
Expand All @@ -78,10 +80,10 @@
<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 +95,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 +117,6 @@
3. A tar file comprising of hidden .ktab files that can be used for downstream FASTK tools.
]]></help>
<expand macro="citations"/>
</tool>
</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 9412d51

Please sign in to comment.