diff dada2_plotQualityProfile.xml @ 2:4095456821e2 draft

planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit 5b1603bbcd3f139cad5c876be83fcb39697b5613-dirty
author matthias
date Tue, 09 Apr 2019 07:03:51 -0400
parents de5c51e1c190
children cf166b8a8e27
line wrap: on
line diff
--- a/dada2_plotQualityProfile.xml	Fri Mar 08 08:34:49 2019 -0500
+++ b/dada2_plotQualityProfile.xml	Tue Apr 09 07:03:51 2019 -0400
@@ -1,4 +1,4 @@
-<tool id="dada2_plotQualityProfile" name="dada2: plotQualityProfile" version="@DADA2_VERSION@">
+<tool id="dada2_plotQualityProfile" name="dada2: plotQualityProfile" version="@DADA2_VERSION@+galaxy@WRAPPER_VERSION@">
     <description>plot a visual summary of the quality scores</description>
     <macros>
         <import>macros.xml</import>
@@ -11,47 +11,103 @@
     <configfiles>
         <configfile name="dada2_script"><![CDATA[
 files = c()
-#if $mode_cond.mode_select == "TRUE"
-    #for $read in $mode_cond.reads:
-        files = c(files, '$read')
-    #end for
+#if "batch" in $paired_cond.paired_select
+	#if "single" in $paired_cond.paired_select
+		files = c(files, '$reads')
+	#else
+		files = c(files, '$reads.forward')
+		files = c(files, '$reads.reverse')
+	#end if
 #else
-    files = c(files, '$mode_cond.reads')
+	#for $read in $paired_cond.reads:
+		#if $paired_cond.paired_select == "no"
+			files = c(files, '$read')
+		#else
+			files = c(files, '$read.forward')
+			files = c(files, '$read.reverse')
+		#end if
+	#end for
 #end if
 
+
 library(ggplot2, quietly=T)
 library(dada2, quietly=T)
 
 qp <- plotQualityProfile(files,
 #if str($n) != ""
-    n=$n, 
+    n=$n,
 #end if
-    aggregate = $mode_cond.mode_select)
+    aggregate = $mode)
 
 ggsave('output.pdf', qp, width = 20,height = 15,units = c("cm"))
     ]]></configfile>
     </configfiles>
     <inputs>
-        <conditional name="mode_cond">
-            <param name="mode_select" type="select" label="Aggregate data" help="Create a single plot for all data sets (default) or a separate plot for each data set">
-                <option value="TRUE">yes</option>
-                <option value="FALSE">no</option>
-            </param>
-            <when value="TRUE">
-                <param name="reads" type="data" multiple="true" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
-            </when>
-            <when value="FALSE">
-                <param name="reads" type="data" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
-            </when>
-        </conditional>
+		<conditional name="paired_cond">
+			<param name="paired_select" type="select" label="Input data organisation and processing mode" help="Select if data is organized in a paired collection or not (note that the pairing of the data sets is not used by the tool); batch will create a separate pdf for each input data set or data set pair; non-batch will create one pdf containing a plot for each data set">
+				<option value="paired">paired - non batch</option>
+				<option value="single">single - non batch</option>
+				<option value="paired_batch">paired - batch</option>
+				<option value="single_batch">single - batch</option>
+			</param>
+			<when value="paired">
+				<param name="reads" type="data_collection" collection_type="list:paired" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
+			</when>
+			<when value="single">
+				<param name="reads" type="data" multiple="true" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
+			</when>
+			<when value="paired_batch">
+				<param name="reads" type="data_collection" collection_type="paired" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
+			</when>
+			<when value="single_batch">
+				<param name="reads" type="data" format="fastqsanger,fastqsanger.gz" label="Short read data"/>
+			</when>
+		</conditional>
+		<param name="mode" type="boolean" label="Aggregate data" checked="True" truevalue="TRUE" falsevalue="FALSE" help="Create a single plot for all data sets (default) or a separate plot for each data set"/>
         <param name="n" type="integer" optional="true" label="sample number" help="number of records to sample from the fastq file (default 500.000)"/>
     </inputs>
     <outputs>
         <data name="output" format="pdf" from_work_dir="output.pdf"/>
     </outputs>
-
+    <tests>
+        <test>
+            <param name="mode" value="TRUE"/>
+            <conditional name="paired_cond">
+                <param name="paired_select" value="TRUE"/>
+                <param name="reads">
+                    <collection type="paired">
+                        <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
+                        <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
+                    </collection>
+                </param>
+            </conditional>
+            <output name="output" value="qualityProfileMultiple.pdf" ftype="pdf"/>
+        </test>
+        <test>
+            <param name="mode" value="FALSE"/>
+            <param name="reads" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
+            <output name="output" value="qualityProfile.pdf" ftype="pdf"/>
+        </test>
+        <test>
+            <param name="mode" value="FALSE"/>
+            <param name="reads" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
+            <param name="n" value="10000"/>
+            <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf"/>
+        </test>
+    </tests>
     <help><![CDATA[
-        TODO: Fill in help.
+Summary
+.......
+
+This function plots a visual summary of the distribution of quality scores as a function of sequence position for the input fastq datasets.
+
+Details
+.......
+
+The distribution of quality scores at each position is shown as a grey-scale heat map, with dark colors corresponding to higher frequency. The plotted lines show positional summary statistics: green is the mean, orange is the median, and the dashed orange lines are the 25th and 75th quantiles. If the sequences vary in length, a red line will be plotted showing the percentage of reads that extend
+to at least that position.
+
+Note this tool ignores the pairing of the reads, but the data is just processed as list.
     ]]></help>
     <expand macro="citations"/>
 </tool>