changeset 1:bca267738b33 draft

Uploaded
author greg
date Thu, 19 Nov 2020 21:25:31 +0000
parents ebc08e5ce646
children ee6166a3edd8
files vsnp_determine_ref_from_data.xml
diffstat 1 files changed, 51 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/vsnp_determine_ref_from_data.xml	Tue Apr 21 10:08:28 2020 -0400
+++ b/vsnp_determine_ref_from_data.xml	Thu Nov 19 21:25:31 2020 +0000
@@ -7,7 +7,6 @@
     <command detect_errors="exit_code"><![CDATA[
 #import os
 #import re
-#set $dnaprint_fields = $__app__.tool_data_tables['vsnp_dnaprints'].get_fields()
 #set gzipped = 'false'
 #set input_type = $input_type_cond.input_type
 #set input_reads_dir = 'input_reads'
@@ -35,13 +34,13 @@
         #end if
     #end if
 #else:
-    #for $i in $input_type_cond.reads_collection:
+    #for $i in $input_type_cond.collection_type_cond.reads_collection:
         #if $i.is_of_type('fastqsanger.gz'):
             #set gzipped = 'true'
         #end if
         #set filename = $i.file_name
         #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
-        ln -s $filename $input_reads_dir/$identifier &&
+        ln -s '$filename' '$input_reads_dir/$identifier' &&
     #end for
 #end if
 python '$__tool_directory__/vsnp_determine_ref_from_data.py'
@@ -57,15 +56,20 @@
 #end if
 --gzipped $gzipped
 --processes $processes
-#for $i in $dnaprint_fields:
-    --dnaprint_fields '${i[0]}' '${i[2]}'
-#end for
+#if str($in_test_mode) == "false":
+    #set $dnaprint_fields = $__app__.tool_data_tables['vsnp_dnaprints'].get_fields()
+    #for $i in $dnaprint_fields:
+        --dnaprint_fields '${i[0]}' '${i[2]}'
+    #end for
+#else:
+    --in_test_mode '$in_test_mode'
+#end if
 ]]></command>
     <inputs>
         <conditional name="input_type_cond">
             <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
                 <option value="single" selected="true">Single files</option>
-                <option value="collection">Collections of files</option>
+                <option value="collection">Collection of files</option>
             </param>
             <when value="single">
                 <conditional name="read_type_cond">
@@ -83,10 +87,23 @@
                 </conditional>
             </when>
             <when value="collection">
-                <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of fastqsanger files"/>
+                <conditional name="collection_type_cond">
+                    <param name="collection_type" type="select" label="Collection of single reads or paired reads?">
+                        <option value="single_reads" selected="true">Single reads</option>
+                        <option value="paired_reads">Paired reads</option>
+                    </param>
+                    <when value="single_reads">
+                        <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of fastqsanger files"/>
+                    </when>
+                    <when value="paired_reads">
+                        <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
+                    </when>
+                </conditional>
             </when>
         </conditional>
         <param name="processes" type="integer" min="1" max="20" value="8" label="Number of processes for job splitting"/>
+        <!-- Functional testing -->
+        <param name="in_test_mode" type="hidden" value="false"/>
     </inputs>
     <outputs>
         <data name="output_dbkey" format="txt"  label="${tool.name} (dbkey) on ${on_string}">
@@ -96,27 +113,46 @@
             <filter>input_type_cond['input_type'] == 'single'</filter>
         </data>
         <collection name="output_dbkey_collection" type="list">
-            <discover_datasets pattern="__name__" directory="output_dbkey" format="txt" />
+            <discover_datasets pattern="__name__" directory="output_dbkey" format="txt"/>
             <filter>input_type_cond['input_type'] == 'collection'</filter>
         </collection>
         <collection name="output_metrics_collection" type="list">
-            <discover_datasets pattern="__name__" directory="output_metrics" format="txt" />
+            <discover_datasets pattern="__name__" directory="output_metrics" format="txt"/>
             <filter>input_type_cond['input_type'] == 'collection'</filter>
         </collection>
     </outputs>
     <tests>
         <test>
-            <!-- Need to figure out how to test installed data tables -->
-            <param name="read1" value="reads.fastqsanger" ftype="fastqsanger" dbkey="89"/>
-            <param name="read2" value="read2.fastqsanger" ftype="fastqsanger" dbkey="89"/>
+            <param name="in_test_mode" value="true"/>
+            <param name="read_type" value="single"/>
+            <param name="read1" value="Mcap_Deer_DE_SRR650221.fastq.gz" ftype="fastqsanger.gz"/>
             <output name="output_dbkey" file="output_dbkey.txt" ftype="txt"/>
             <output name="output_metrics" file="output_metrics.txt" ftype="txt"/>
         </test>
+        <test>
+            <param name="in_test_mode" value="true"/>
+            <param name="input_type" value="collection"/>
+            <param name="collection_type" value="paired_reads"/>
+            <param name="reads_collection">
+                <collection type="paired">
+                    <element name="forward" value="forward.fastq.gz" ftype="fastqsanger.gz"/>
+                    <element name="reverse" value="reverse.fastq.gz" ftype="fastqsanger.gz"/>
+                </collection>
+            </param>
+            <output_collection name="output_dbkey_collection" type="list">
+                <element name="forward.txt" file="forward_dbkey.txt" ftype="txt"/>
+                <element name="reverse.txt" file="reverse_dbkey.txt" ftype="txt"/>
+            </output_collection>
+            <output_collection name="output_metrics_collection" type="list">
+                <element name="forward.txt" file="forward_metrics.txt" ftype="txt"/>
+                <element name="reverse.txt" file="reverse_metrics.txt" ftype="txt"/>
+            </output_collection>
+        </test>
     </tests>
     <help>
 **What it does**
 
-Accepts a single fastqsanger read, a set of paired reads, or a collections of reads and inspects the data to discover the
+Accepts a single fastqsanger read, a set of paired reads, or a collection of reads and inspects the data to discover the
 best reference genome for aligning the reads.  This tool is, in essence, a DNA sniffer, and is the first Galaxy tool to
 perform this task.  While inspecting the data, a string of 0's and 1's is compiled based on the data contents, and we call
 the complete string a "DNA print".  All of the "DNA prints" files installed by the complementary **vSNP DNAprints data
@@ -149,7 +185,7 @@
 
 **Required Options**
 
- * **Choose the category of the files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single or paired fastqsanger reads or collections of fastqsanger reads) based on the selected option.
+ * **Choose the category of the files to be analyzed** - select "Single files" or "Collection of files", then select the appropriate history items (single or paired fastqsanger reads or a collection of fastqsanger reads) based on the selected option.
  * **Number of processes for job splitting** - Select the number of processes for splitting the job to shorten execution time.
     </help>
     <citations>