changeset 1:46c5d7a0393b draft

planemo upload for repository https://github.com/katholt/srst2 commit 2e3867763a28e217bf5f44558a3f56e7efe041c5
author iuc
date Tue, 06 Sep 2022 14:18:05 +0000
parents f9a0855c792d
children 81cea47ec685
files macros.xml srst2.xml
diffstat 2 files changed, 58 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Mon Aug 22 19:13:16 2022 +0000
+++ b/macros.xml	Tue Sep 06 14:18:05 2022 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <macros>
     <token name="@TOOL_VERSION@">0.2.0</token>
-    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@VERSION_SUFFIX@">1</token>
     <token name="@PROFILE@">20.01</token>
     <xml name="requirements">
         <requirements>
--- a/srst2.xml	Mon Aug 22 19:13:16 2022 +0000
+++ b/srst2.xml	Tue Sep 06 14:18:05 2022 +0000
@@ -21,11 +21,13 @@
         ln -s $s './$i-prev_output.txt' &&
     #end if
 #end for
-#for $i, $s in enumerate($use_gene_db.gene_db)
-    #if $s
-        ln -s $s './$i-gene_db.fasta' &&
-    #end if
-#end for
+#if $use_gene_db.selector == "yes" 
+    #for $i, $s in enumerate($use_gene_db.gene_db)
+        #if $s
+            ln -s $s './$i-gene_db.fasta' &&
+        #end if
+    #end for
+#end if
 #if $use_mlst_db.selector == "yes"
 #set ext_3=$use_mlst_db.mlst_definitions.datatype.file_ext
     ln -s $use_mlst_db.mlst_db './mlst_db.fasta' &&
@@ -96,18 +98,19 @@
 #if 'keep_interim_alignment' in str($output_files_selector)
     --keep_interim_alignment
 #end if
+## |true here is added in order not to search for a file that is not produced at all, such that if the user provided no gene/MLST databases or there are no outputs found, the tool will run successfully and only notify the user that no outputs are found
 #if 'report_new_consensus' in str($output_files_selector) and $use_gene_db.selector == "yes" and $use_mlst_db.selector == "yes"
-&& mkdir -p allelesOutput/ && cp *.output__input.*.pileup allelesOutput
+&& mkdir -p allelesOutput/ && cp *.output__input.*.pileup allelesOutput | true
 #end if
 #if $use_gene_db.selector == "yes" and  $use_gene_db.no_gene_details
-&& mkdir -p geneTypingOutput/ && cp output__genes__*__results.txt geneTypingOutput && cp output__fullgenes__*__results.txt geneTypingOutput
+&& mkdir -p geneTypingOutput/ && cp output__genes__*__results.txt geneTypingOutput | true && cp output__fullgenes__*__results.txt geneTypingOutput | true
 #end if
 #if 'save_scores' in str($output_files_selector)
-    && mkdir -p scoresOutput/ && cp *.scores scoresOutput
+    && mkdir -p scoresOutput/ && cp *.scores scoresOutput | true
 #end if
 #if $input.selector == "single" or $input.selector == "paired"
-&& mkdir -p bowtie2Alignments/ && cp *.sorted.bam bowtie2Alignments
-&& mkdir -p samtoolsPileup/ && cp output__input.*.pileup samtoolsPileup
+&& mkdir -p bowtie2Alignments/ && cp *.sorted.bam bowtie2Alignments | true
+&& mkdir -p samtoolsPileup/ && cp output__input.*.pileup samtoolsPileup | true
 #end if
     ]]></command>
     <inputs>
@@ -315,6 +318,50 @@
             </assert_contents>
         </output>
     </test>
+    <test expect_num_outputs="7">
+        <param name="prob_err" value="0.01"/>
+        <param name="max_unaligned_overlap" value="10"/>
+        <param name="mapq" value="1"/>
+        <param name="baseq" value="20"/>
+        <param name="output_files_selector" value="log,save_scores,report_new_consensus,report_all_consensus"/>
+        <conditional name="input">
+            <param name="selector" value="paired"/>
+            <param name="paired_input1" value="ERR024070_1_reduced_forward_reads.fastqsanger.gz"/>
+            <param name="paired_input2" value="ERR024070_2_reduced_reverse_reads.fastqsanger.gz"/>
+            <param name="merge_paired" value="false"/>
+            <param name="read_type" value="q"/>
+        </conditional>
+        <conditional name="use_mlst_db">
+            <param name="selector" value="no"/>
+        </conditional>
+        <conditional name="use_gene_db">
+            <param name="selector" value="no"/>
+        </conditional>
+        <output name="Compiled_gene_and_mlst_output">
+            <assert_contents>
+                <has_n_lines n="0"/>
+            </assert_contents>
+        </output>
+        <output name="all_consensus">
+            <assert_contents>
+                <has_size value="0" delta="0"/>
+            </assert_contents>
+        </output>
+        <output_collection name="new_consensus" type="list">
+        </output_collection>
+        <output_collection name="samtools_pileup_alignment" type="list">
+        </output_collection>
+        <output_collection name="bowtie2_alignment_output" type="list">
+        </output_collection>
+        <output_collection name="scores_ofEachAllele" type="list">
+        </output_collection>
+        <output name="log_output">
+            <assert_contents>
+                <has_text text="Total paired readsets found:1"/>
+                <has_n_lines n="4"/>
+            </assert_contents>
+        </output>
+    </test>
     </tests>
     <help><![CDATA[
 SRST2