# HG changeset patch
# User matthias
# Date 1557073342 14400
# Node ID 9aeea74a1fc9f0fbaa8c8ec64a1ecc06560b9691
# Parent 9f888de151d19ae58fcb5a5bb4e1258e3f416252
planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit 990192685955e9cda0282e348c28ef6462d88a38
diff -r 9f888de151d1 -r 9aeea74a1fc9 README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md Sun May 05 12:22:22 2019 -0400
@@ -0,0 +1,39 @@
+Wrappers for the core functionality of the dada2 package https://benjjneb.github.io/dada2/index.html.
+
+- filterAndTrim
+- derep
+- learnErrors
+- dada
+- mergePairs
+- makeSequenceTable
+- removeBimeraDenovo
+
+Datatypes
+=========
+
+The dada2 Galaxy wrappers use a few extra data types to ensure that only inputs of the correct type can be used.
+
+For the outputs of derep, dada, learnErrors, and mergePairs the following datatypes are used that derive from Rdata (which contains the named list that is returned from the corresponding dada function):
+
+- dada2_derep (Rdata: named list see docs for derep-class)
+- dada2_dada (Rdata: named list, see docs for dada-class)
+- dada2_errorrates (Rdata: named list, see docs for learnErrors)
+- dada2_mergepairs (Rdata: named list, see docs for mergePairs)
+
+For the outputs of makeSequenceTable and removeBimeraDenovo the following data types are used which derive from tabular:
+
+- dada2_uniques
+-- in R a named integer vector (names are the unique sequences)
+-- in Galaxy written as a table (each row corresponding to a unique sequence, column 1: the sequence, column 2: the count)
+- dada2_sequencetable
+-- in R a named integer matrix (rows = samples, columns = unique sequences)
+-- in Galaxy written as a table (rows = unique sequences, columns = samples)
+
+Note the difference between the R and Galaxy representations! The main motivation is that the dada2_sequencetable is analogous to OTU tables as produced for instance by qiime (and it seemed natural to extend this to the uniques which are essentially a sequencetables of single samples).
+
+
+TODOs
+=====
+
+- implememt getUniques tool to view intermediate results?
+- implement tests for cached reference data
diff -r 9f888de151d1 -r 9aeea74a1fc9 dada2_learnErrors.xml
--- a/dada2_learnErrors.xml Mon Apr 29 09:48:19 2019 -0400
+++ b/dada2_learnErrors.xml Sun May 05 12:22:22 2019 -0400
@@ -17,7 +17,7 @@
nthreads <- as.integer(args[1])
files <- c()
-#for $read in $reads:
+#for $read in $fls:
files <- c(files, '$read')
#end for
@@ -29,24 +29,26 @@
saveRDS(err, file='$errors')
## generate error plots
-plot <- plotErrors(err, obs = $plotopt.obs, err_out = $plotopt.errout, err_in = $plotopt.errin, nominalQ = $plotopt.nominalQ)
+plot <- plotErrors(err, obs = $plotopt.obs, err_out = $plotopt.err_out, err_in = $plotopt.err_in, nominalQ = $plotopt.nominalQ)
ggsave('plot.pdf', plot, width = 20,height = 15,units = c("cm"))
]]>
-
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
@@ -55,25 +57,30 @@
-
+
-
+
-
+
+
+
+
+
+
-
-
+
+
-
-
+
+
@@ -83,6 +90,8 @@
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.
+In addition a plot is generated (with plotErrors) that shows the observed frequency of each transition (eg. A->C) as a function of the associated quality score. Also the final estimated error rates (if they exist) are shown. Optionally also the initial input rates and the expected error rates under the nominal definition of quality scores can be added to the plot.
+
Usage
.....
@@ -103,6 +112,12 @@
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.
+Error functions:
+
+- loessErrfun: accepts a matrix of observed transitions, with each transition corresponding to a row (eg. row 2 = A->C) and each column to a quality score (eg. col 31 = Q30). It returns a matrix of estimated error rates of the same shape. Error rates are estimates by a loess fit of the observed rates of each transition as a function of the quality score. Self-transitions (i.e. A->A) are taken to be the left-over probability.
+- noqualErrfun: accepts a matrix of observed transitions, groups together all observed transitions regardless of quality scores, and estimates the error rate for that transition as the observed fraction of those transitions. The effect is that quality scores will be effectively ignored.
+- PacBioErrfun: This function accepts a matrix of observed transitions from PacBio CCS amplicon sequencing data, with each transition corresponding to a row (eg. row 2 = A->C) and each column to a quality score (eg. col 31 = Q30). It returns a matrix of estimated error rates of the same shape. Error rates are estimates by loessErrfun for quality scores 0-92, and individually by the maximum likelihood estimate for the maximum quality score of 93.
+
@HELP_OVERVIEW@
]]>
diff -r 9f888de151d1 -r 9aeea74a1fc9 macros.xml
--- a/macros.xml Mon Apr 29 09:48:19 2019 -0400
+++ b/macros.xml Sun May 05 12:22:22 2019 -0400
@@ -25,23 +25,44 @@
dada2_derep,dada2_dada,dada2_mergepairs
+
+
+
+
@@ -63,9 +84,9 @@
-
-
-
+
+
+