diff stacks_procrad.xml @ 2:bd5ff77e2036 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit f55e2407891a3c1f73f14a77b7ddadcd6f5eb1f8"
author iuc
date Wed, 15 Jul 2020 17:33:16 -0400
parents ca7aa77c7f57
children b4bab607eb05
line wrap: on
line diff
--- a/stacks_procrad.xml	Mon Sep 30 14:20:50 2019 -0400
+++ b/stacks_procrad.xml	Wed Jul 15 17:33:16 2020 -0400
@@ -8,6 +8,9 @@
     <expand macro="version_cmd"/>
     <command detect_errors="aggressive"><![CDATA[
 @FASTQ_INPUT_FUNCTIONS@
+
+python '$__tool_directory__'/check_bcfile.py '$barcode' &&
+
 mkdir stacks_inputs stacks_outputs &&
 
 #if $output_log
@@ -69,8 +72,8 @@
 
         <section name="options_advanced" title="advanced options" expanded="False">
             <expand macro="common_advanced"/>
-            <param argument="--bestrad" type="boolean" checked="false" truevalue="--bestrad" falsevalue="" label="Library was generated using BestRAD, check for restriction enzyme on either read and potentially tranpose reads" />
-            <param argument="--disable_rad_check" type="boolean" checked="false" truevalue="--disable_rad_check" falsevalue="" label="Disable checking if the RAD site is intact" />
+            <param argument="--bestrad" type="boolean" checked="false" truevalue="--bestrad" falsevalue="" label="Library was generated using BestRAD, check for restriction enzyme on either read and potentially tranpose reads"/>
+            <param argument="--disable_rad_check" type="boolean" checked="false" truevalue="--disable_rad_check" falsevalue="" label="Disable checking if the RAD site is intact"/>
             <expand macro="rescue_barcode"/>
             <expand macro="process_adapter"/>
         </section>
@@ -86,22 +89,22 @@
     </outputs>
     <tests>
         <!-- single single ended input, no filtering (hence no capturing) + log -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="single"/>
             <param name="input_type|fqinputs" ftype="fastqsanger" value="procrad/R1.fq"/>
             <param name="input_type|barcode_encoding" value="--inline_null"/>
             <param name="barcode" value="procrad/barcodes"/>
             <param name="options_enzyme|options_enzyme_selector" value="1"/>
             <param name="options_enzyme|enzyme" value="ecoRI"/>
-            <param name="add_log" value="yes" />
+            <param name="add_log" value="yes"/>
             <output name="output_log" file="procrad/process_radtags.out" lines_diff="4"/>
             <output_collection name="demultiplexed" count="40">
-                <element name="PopA_01" file="demultiplexed/PopA_01.fq" ftype="fastqsanger" />
+                <element name="PopA_01" file="demultiplexed/PopA_01.fq" ftype="fastqsanger"/>
             </output_collection>
         </test>
         <!-- multiple (zipped) single end input (misusing R2 as add single end read file),
              discarding by quality and capturing them -->
-        <test>
+        <test expect_num_outputs="3">
             <param name="input_type|input_type_select" value="single"/>
             <param name="input_type|fqinputs" ftype="fastqsanger.gz" value="procrad/R1.fq.gzip,procrad/R2.fq.gzip"/>
             <param name="input_type|barcode_encoding" value="--inline_null"/>
@@ -110,19 +113,19 @@
             <param name="options_enzyme|enzyme" value="ecoRI"/>
             <param name="filter_cond|filter_select" value="yes"/>
             <param name="filter_cond|discard" value="-q"/>
-            <param name="filter_cond|sliding" value="0.1" />
-            <param name="filter_cond|score" value="11" />
-            <param name="filter_cond|remove" value="-c" />
+            <param name="filter_cond|sliding" value="0.1"/>
+            <param name="filter_cond|score" value="11"/>
+            <param name="filter_cond|remove" value="-c"/>
             <param name="capture" value="-D"/>
             <param name="outype" value="gzfastq"/>
-            <param name="add_log" value="yes" />
+            <param name="add_log" value="yes"/>
             <output name="output_log" file="procrad/process_radtags2.out" lines_diff="4"/>
             <assert_command>
-                <has_text text="-q" />
-                <has_text text="-w 0.1" />
-                <has_text text="-s 11" />
-                <has_text text="-c" />
-                <has_text text="-D" />
+                <has_text text="-q"/>
+                <has_text text="-w 0.1"/>
+                <has_text text="-s 11"/>
+                <has_text text="-c"/>
+                <has_text text="-D"/>
             </assert_command>
             <output_collection name="demultiplexed" count="40">
                 <element name="PopA_01" ftype="fastqsanger.gz"  md5="c7250f50138cbca747b85223aaae9565"/>
@@ -133,13 +136,13 @@
             </output_collection>
         </test>
         <!-- paired input, no quality but length filter, gzfasta output -->
-        <test>
+        <test expect_num_outputs="4">
             <param name="input_type|input_type_select" value="paired"/>
             <param name="input_type|fqinputs">
                 <collection type="list:paired">
                     <element name="reads">
                         <collection type="paired">
-                            <element name="forward" value="procrad/R1.fq" ftype="fastqsanger" />
+                            <element name="forward" value="procrad/R1.fq" ftype="fastqsanger"/>
                             <element name="reverse" value="procrad/R2.fq" ftype="fastqsanger"/>
                         </collection>
                     </element>
@@ -152,15 +155,15 @@
             <param name="filter_cond|len_limit" value="50"/>
             <param name="capture" value="-D"/>
             <param name="outype" value="gzfasta"/>
-            <param name="add_log" value="yes" />
+            <param name="add_log" value="yes"/>
             <output name="output_log" file="procrad/process_radtags_paired.out" lines_diff="4"/>
             <assert_command>
-                <has_text text="--len_limit 50" />
+                <has_text text="--len_limit 50"/>
             </assert_command>
             <output_collection name="demultiplexed_paired" type="list:paired" count="40">
                 <element name="PopA_01">
-                    <element name="forward" value="demultiplexed/PopA_01.1.fa.gz" ftype="fasta.gz" />
-                    <element name="reverse" value="demultiplexed/PopA_01.2.fa.gz" ftype="fasta.gz" />
+                    <element name="forward" value="demultiplexed/PopA_01.1.fa.gz" ftype="fasta.gz"/>
+                    <element name="reverse" value="demultiplexed/PopA_01.2.fa.gz" ftype="fasta.gz"/>
                 </element>
             </output_collection>
             <output_collection name="remaining" type="list:paired" count="40">
@@ -177,13 +180,13 @@
             </output_collection>
         </test>
         <!-- paired input (gzipped) + advanced options + two enzymes, fasta output -->
-        <test>
+        <test expect_num_outputs="3">
             <param name="input_type|input_type_select" value="paired"/>
             <param name="input_type|fqinputs">
                 <collection type="list:paired">
                     <element name="reads">
                         <collection type="paired">
-                            <element name="forward" value="procrad/R1.fq.gzip" ftype="fastqsanger.gz" />
+                            <element name="forward" value="procrad/R1.fq.gzip" ftype="fastqsanger.gz"/>
                             <element name="reverse" value="procrad/R2.fq.gzip" ftype="fastqsanger.gz"/>
                         </collection>
                     </element>
@@ -193,30 +196,30 @@
             <param name="options_enzyme|options_enzyme_selector" value="2"/>
             <param name="options_enzyme|enzyme" value="ecoRI"/>
             <param name="options_enzyme|enzyme2" value="ecoRI"/>
-            <param name="options_advanced|truncate" value="70" />
+            <param name="options_advanced|truncate" value="70"/>
             <param name="options_advanced|rescue_cond|rescue" value="-r"/>
-            <param name="options_advanced|rescue_cond|barcode_dist_1" value="2" />
-            <param name="options_advanced|rescue_cond|barcode_dist_2" value="2" />
-            <param name="options_advanced|bestrad" value="--bestrad" />
+            <param name="options_advanced|rescue_cond|barcode_dist_1" value="2"/>
+            <param name="options_advanced|rescue_cond|barcode_dist_2" value="2"/>
+            <param name="options_advanced|bestrad" value="--bestrad"/>
             <param name="options_advanced|retain_header" value="--retain_header"/>
-            <param name="options_advanced|disable_rad_check" value="--disable_rad_check" />
-            <param name="options_advanced|adapter_1" value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" />
-            <param name="options_advanced|adapter_2" value="TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" />
-            <param name="options_advanced|adapter_mm" value="2" />
+            <param name="options_advanced|disable_rad_check" value="--disable_rad_check"/>
+            <param name="options_advanced|adapter_1" value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"/>
+            <param name="options_advanced|adapter_2" value="TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"/>
+            <param name="options_advanced|adapter_mm" value="2"/>
             <param name="outype" value="fasta"/>
             <assert_command>
-                <has_text text="-e ecoRI" />
-                <has_text text="--renz_2 ecoRI" />
-                <has_text text="-t 70" />
-                <has_text text="-r" />
-                <has_text text="--bestrad" />
-                <has_text text="--retain_header" />
-                <has_text text="--disable_rad_check" />
-                <has_text text="--barcode_dist_1 2" />
-                <has_text text="--barcode_dist_2 2" />
-                <has_text text="--adapter_1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" />
-                <has_text text="--adapter_2 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" />
-                <has_text text="--adapter_mm 2" />
+                <has_text text="-e ecoRI"/>
+                <has_text text="--renz_2 ecoRI"/>
+                <has_text text="-t 70"/>
+                <has_text text="-r"/>
+                <has_text text="--bestrad"/>
+                <has_text text="--retain_header"/>
+                <has_text text="--disable_rad_check"/>
+                <has_text text="--barcode_dist_1 2"/>
+                <has_text text="--barcode_dist_2 2"/>
+                <has_text text="--adapter_1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"/>
+                <has_text text="--adapter_2 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"/>
+                <has_text text="--adapter_mm 2"/>
             </assert_command>
             <output_collection name="demultiplexed_paired" type="list:paired" count="40">
                 <element name="PopA_01">
@@ -226,13 +229,42 @@
             </output_collection>
             <output_collection name="remaining" type="list:paired" count="40">
                 <element name="PopA_01">
-                    <element name="forward" file="demultiplexed/PopA_01.rem.1.fa" ftype="fasta" />
-                    <element name="reverse" file="demultiplexed/PopA_01.rem.2.fa" ftype="fasta" />
+                    <element name="forward" file="demultiplexed/PopA_01.rem.1.fa" ftype="fasta"/>
+                    <element name="reverse" file="demultiplexed/PopA_01.rem.2.fa" ftype="fasta"/>
                 </element>
             </output_collection>
         </test>
+        <!-- test invalid barcode file -->
+        <test expect_failure="true">
+            <param name="input_type|input_type_select" value="single"/>
+            <param name="input_type|fqinputs" ftype="fastqsanger" value="procrad/R1.fq"/>
+            <param name="input_type|barcode_encoding" value="--inline_null"/>
+            <param name="barcode" value="procrad/barcodes-duplicate"/>
+            <param name="options_enzyme|options_enzyme_selector" value="1"/>
+            <param name="options_enzyme|enzyme" value="ecoRI"/>
+            <param name="add_log" value="yes"/>
+        </test>
+        <!-- test invalid barcode file -->
+        <test expect_failure="true">
+            <param name="input_type|input_type_select" value="single"/>
+            <param name="input_type|fqinputs" ftype="fastqsanger" value="procrad/R1.fq"/>
+            <param name="input_type|barcode_encoding" value="--inline_null"/>
+            <param name="barcode" value="procrad/barcodes-duplicate2"/>
+            <param name="options_enzyme|options_enzyme_selector" value="1"/>
+            <param name="options_enzyme|enzyme" value="ecoRI"/>
+            <param name="add_log" value="yes"/>
+    </test>
+        <!-- test invalid barcode file -->
+        <test expect_failure="true">
+            <param name="input_type|input_type_select" value="single"/>
+            <param name="input_type|fqinputs" ftype="fastqsanger" value="procrad/R1.fq"/>
+            <param name="input_type|barcode_encoding" value="--inline_null"/>
+            <param name="barcode" value="procrad/barcodes-duplicate3"/>
+            <param name="options_enzyme|options_enzyme_selector" value="1"/>
+            <param name="options_enzyme|enzyme" value="ecoRI"/>
+            <param name="add_log" value="yes"/>
+        </test>
     </tests>
-
     <help>
 <![CDATA[
 .. class:: infomark
@@ -290,5 +322,5 @@
 @STACKS_INFOS@
 ]]>
     </help>
-    <expand macro="citation" />
+    <expand macro="citation"/>
 </tool>