diff dada2_learnErrors.xml @ 3:10141f4eaae9 draft

planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit 5b1603bbcd3f139cad5c876be83fcb39697b5613-dirty
author matthias
date Mon, 29 Apr 2019 08:56:03 -0400
parents 57eb7437f646
children 9aeea74a1fc9
line wrap: on
line diff
--- a/dada2_learnErrors.xml	Tue Apr 09 07:00:24 2019 -0400
+++ b/dada2_learnErrors.xml	Mon Apr 29 08:56:03 2019 -0400
@@ -6,11 +6,6 @@
     <expand macro="requirements"/>
     <expand macro="version_command"/>
     <command detect_errors="exit_code"><![CDATA[
-    ## TODO check to remove ln, instead maybe rename output to ids
-    #for $read in $reads:
-        ln -s '$read' '$read.element_identifier' &&
-    #end for
-    mkdir '$errors.extra_files_path' &&
     Rscript '$dada2_script' \${GALAXY_SLOTS:-1}
     ]]></command>
     <configfiles>
@@ -23,30 +18,29 @@
 
 files <- c()
 #for $read in $reads:
-files <- c(files, '$read.element_identifier')
+files <- c(files, '$read')
 #end for
 
-err <- learnErrors(files, nbases = 10**$nbases, 
+err <- learnErrors(files, nbases = 10**$nbases,
            errorEstimationFunction = $advanced.errfoo, multithread = nthreads,
            randomize = $advanced.randomize, MAX_CONSIST = $advanced.maxconsist, OMEGA_C = $advanced.omegac)
 
-write.table(err\$err_out, file = '$errors', quote = F, sep = "\t", row.names = T, col.names = F)
-saveRDS(err, file=file.path('$errors.extra_files_path', "Rdata"))
-
+## write.table(err\$err_out, file = '$errors', quote = F, sep = "\t", row.names = T, col.names = F)
+saveRDS(err, file='$errors')
 
 ## generate error plots
 plot <- plotErrors(err, obs = $plotopt.obs, err_out = $plotopt.errout, err_in = $plotopt.errin, nominalQ = $plotopt.nominalQ)
-ggsave('output.pdf', plot, width = 20,height = 15,units = c("cm"))
+ggsave('plot.pdf', plot, width = 20,height = 15,units = c("cm"))
     ]]></configfile>
     </configfiles>
     <inputs>
         <param name="reads" type="data" multiple="true" format="fastqsanger,fastqsanger.gz" label="Short read data" help="forward or reverse reads should be processed separately"/>
-        <param name="nbases" type="integer" value="8" min="0" label="Magnitide of number of bases to use for learning"/>
+        <param argument="nbases" type="integer" value="8" min="0" label="Magnitide of number of bases to use for learning"/>
         <section name="advanced" title="Advanced Option">
             <expand macro="errorEstimationFunction"/>
-            <param name="randomize" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Randomize samples"/>
-                <param name="maxconsist" type="integer" value="10" min="0" label="Maximum number of times to step through the selfconsistency loop" help=""/>
-            <param name="omegac" type="integer" value="0" min="0" label="Threshold at which unique sequences inferred to contain errors are corrected" help=""/>
+            <param argument="randomize" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Randomize samples"/>
+            <param name="maxconsist" argument="MAX_CONSIST" type="integer" value="10" min="0" label="Maximum number of times to step through the selfconsistency loop" help=""/>
+            <param name="omegac" argument="OMEGA_C" type="integer" value="0" min="0" label="Threshold at which unique sequences inferred to contain errors are corrected" help=""/>
         </section>
         <section name="plotopt" title="Plotting Option">
             <param name="obs" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Plot observed error rates"/>
@@ -57,64 +51,59 @@
     </inputs>
     <outputs>
         <data name="errors" format="dada2_errorrates" label="${tool.name} on ${on_string}"/>
-        <data name="output" format="pdf" from_work_dir="output.pdf" label="${tool.name} on ${on_string}: error rates plot"/>
+        <data name="plot" format="pdf" from_work_dir="plot.pdf" label="${tool.name} on ${on_string}: error rates plot"/>
     </outputs>
     <tests>
         <test>
-            <param name="reads" value="filterAndTrim_paired_F3D0_R1.fq.gz,filterAndTrim_paired_F3D141_R1.fq.gz" ftype="fastqsanger.gz"/>
-            <output name="errors" value="learnErrors_forward.tab" ftype="dada_errorrates">
-                <extra_files type="rdata" name="Rdata" value="learnErrors_forward.Rdata" />
-            </output>
-            <output name="output" value="learnErrors_forward.pdf" ftype="pdf" />
+            <param name="reads" value="filterAndTrim_F3D0_R1.fq.gz" ftype="fastqsanger.gz"/>
+            <output name="errors" value="learnErrors_F3D0_R1.Rdata" ftype="dada2_errorrates"/>
+            <output name="plot" value="learnErrors_F3D0_R1.pdf" ftype="pdf" />
         </test>
-		<!-- test for creating input for dada results for reverse, not needed for testing -->
+        <!-- test for creating input for dada results for reverse, not needed for testing -->
         <test>
-            <param name="reads" value="filterAndTrim_paired_F3D0_R2.fq.gz,filterAndTrim_paired_F3D141_R2.fq.gz" ftype="fastqsanger.gz"/>
-            <output name="errors" value="learnErrors_reverse.tab" ftype="dada_errorrates">
-                <extra_files type="rdata" name="Rdata" value="learnErrors_reverse.Rdata" />
-            </output>
-            <output name="output" value="learnErrors_reverse.pdf" ftype="pdf" />
+            <param name="reads" value="filterAndTrim_F3D0_R2.fq.gz" ftype="fastqsanger.gz"/>
+            <output name="errors" value="learnErrors_F3D0_R2.Rdata" ftype="dada2_errorrates"/>
+            <output name="plot" value="learnErrors_F3D0_R2.pdf" ftype="pdf" />
         </test>
+        <!-- test w non-default parameters -->
         <test>
-            <param name="reads" value="filterAndTrim_paired_F3D0_R1.fq.gz,filterAndTrim_paired_F3D141_R1.fq.gz" ftype="fastqsanger.gz"/>
+            <param name="reads" value="filterAndTrim_F3D0_R1.fq.gz" ftype="fastqsanger.gz"/>
             <param name="plotopt|obs" value="FALSE" />
             <param name="plotopt|errout" value="FALSE" />
             <param name="plotopt|errin" value="TRUE" />
             <param name="plotopt|nominalQ" value="FALSE"/>
-            <output name="errors" value="learnErrors_reverse.tab" ftype="dada_errorrates" />
-            <output name="output" value="learnErrors_reverse.pdf" ftype="pdf" />
+            <output name="errors" value="learnErrors_F3D0_R1.Rdata" ftype="dada2_errorrates" />
+            <output name="output" value="learnErrors_F3D0_R1.pdf" ftype="pdf" compare="sim_size" />
         </test>
+        <!-- TODO test w multiple inputs -->
     </tests>
     <help><![CDATA[
 Description
 ...........
 
-Error rates are learned by alternating between sample inference and error rate estimation until convergence. Additionally a plot is generated that shows the observed frequency of each transition (eg. A->C) as a function of the associated quality score, the final estimated error rates (if they exist), the initial input rates, and the expected error rates under the nominal definition of quality scores. 
+Error rates are learned by alternating between sample inference and error rate estimation until convergence. Additionally a plot is generated that shows the observed frequency of each transition (eg. A->C) as a function of the associated quality score, the final estimated error rates (if they exist), the initial input rates, and the expected error rates under the nominal definition of quality scores.
 
 Usage
------
+.....
 
 **Input** are the FASTQ dataset containing the filtered and trimmed reads of the samples.
 
-The main **output** of type dada2_errorrates shows the numeric matrix with the learned error rates.
-
-The **plot** shows the error rates for each possible transition (A→C, A→G,...)
+**Output** a dataset with type *dada2_errorrates* (which is a RData file containing the output of dada2's learnErrors function) and a **plot** showing the error rates for each possible transition (A→C, A→G,...)
 
-- Points are the observed error rates for each consensus quality score. 
-- The black line shows the estimated error rates after convergence of the machine-learning algorithm. 
-- The red line shows the error rates expected under the nominal definition of the Q-score. 
+- Points are the observed error rates for each consensus quality score.
+- The black line shows the estimated error rates after convergence of the machine-learning algorithm.
+- The red line shows the error rates expected under the nominal definition of the Q-score.
 
 The learned error rates are input the the *dada2: dada* tool.
 
 Details
 .......
 
-The learnErrors method learns a parametric this error model from the data, by alternating estimation of the error rates and inference of sample composition until they converge on a jointly consistent solution. As in many machine-learning problems, the algorithm must begin with an initial guess, for which the maximum possible error rates in this data are used (the error rates if only the most abundant sequence is correct and all the rest are errors).
+The learnErrors method learns a parametric error model from the data, by alternating estimation of the error rates and inference of sample composition until they converge on a jointly consistent solution. As in many machine-learning problems, the algorithm must begin with an initial guess, for which the maximum possible error rates in this data are used (the error rates if only the most abundant sequence is correct and all the rest are errors).
 
 It is expected that the estimated error rates (black lines in the plot) are in a good fit to the observed rates (points in the plot), and that the error rates drop with increased quality. Try to increase the **number of bases to use for learning** if this is not the case.
-    
 
-Everything looks reasonable and we proceed with confidence.
+@HELP_OVERVIEW@
     ]]></help>
     <expand macro="citations"/>
 </tool>