changeset 7:7136e9ab70db draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit c2f6071f729b74540354f4a9e7084c9ac468a135
author iuc
date Mon, 07 Aug 2023 01:33:57 +0000
parents 1bc3657cd694
children e1b9e585de60
files dada2_removeBimeraDenovo.xml macros.xml test-data/gentest.R
diffstat 3 files changed, 19 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/dada2_removeBimeraDenovo.xml	Fri Jun 30 07:55:53 2023 +0000
+++ b/dada2_removeBimeraDenovo.xml	Mon Aug 07 01:33:57 2023 +0000
@@ -33,15 +33,7 @@
     write.data( seqtab.nochim, '$stable_mergepairs', "dada2_mergepairs" )
 #end if
 
-## dada input
-if(class(unqs)=="list"){
-    unqssum<-lapply(lapply(unqs, getUniques),sum)
-    outsum<-lapply(seqtab.nochim,sum)
-    mapply(function(X,Y) { 100*X/Y }, X=nonchimsum, Y=unqssum)
-    cat("remaining nonchimeric: ", mapply(function(X,Y) { 100*X/Y }, X=nonchimsum, Y=unqssum), "%")
-}else{
-    cat("remaining nonchimeric: ", 100*sum(getUniques(seqtab.nochim))/sum(getUniques(unqs)), "%")
-}
+cat("remaining nonchimeric: ", 100*sum(getUniques(seqtab.nochim))/sum(getUniques(unqs)), "%")
     ]]></configfile>
     </configfiles>
     <inputs>
--- a/macros.xml	Fri Jun 30 07:55:53 2023 +0000
+++ b/macros.xml	Mon Aug 07 01:33:57 2023 +0000
@@ -12,8 +12,8 @@
             <xref type="bioconductor">dada2</xref>
         </xrefs>
     </xml>
-    <token name="@DADA2_VERSION@">1.20</token>
-    <token name="@WRAPPER_VERSION@">1</token>
+    <token name="@DADA2_VERSION@">1.28</token>
+    <token name="@WRAPPER_VERSION@">0</token>
 
     <xml name="version_command">
         <version_command><![CDATA[
@@ -43,17 +43,18 @@
          - uniques is a named integer vector (columns=ASVs, only one rows)-->
     <token name="@READ_FOO@"><![CDATA[
     read.uniques <- function ( fname ) {
-         p <- read.table(fname, header=F, sep="\t")
+         x <- read.table(fname, header=F, sep="\t")
          n <-x[,2]
          names(n)<-x[,1]
+         return(n)
     }
     #def read_data($dataset)
         #if $dataset.is_of_type('dada2_sequencetable')
-            t(as.matrix( read.table('$dataset', header=T, sep="\t", row.names=1) ))
+            t(read.table('$dataset', header=T, sep="\t", row.names=1, check.names=FALSE))
         #else if $dataset.is_of_type('dada2_uniques')
             read.uniques('$dataset')
         #else if $dataset.is_of_type('tabular')
-            read.table('$dataset', header=T, sep="\t", row.names=1)
+            read.table('$dataset', header=T, sep="\t", row.names=1, check.names=FALSE)
         #else
             readRDS('$dataset')
         #end if
@@ -97,7 +98,7 @@
 
     <!-- for filterAndTrim -->
     <xml name="trimmers">
-        <section name="trim" title="Trimming parameters">
+        <section name="trim" title="Trimming parameters" expanded="true">
             <param argument="truncQ" type="integer" value="2" min="0" label="Truncate reads at quality threshold" help="Truncate reads at the first instance of a quality score less than or equal to this threshold"/>
             <param argument="trimLeft" type="integer" value="0" min="0" label="Trim start of each read" help="The number of nucleotides to remove from the start of each read."/>
             <param argument="trimRight" type="integer" value="0" min="0" label="Trim end of each read" help="The number of nucleotides to remove from the end of each read"/>
@@ -105,7 +106,7 @@
         </section>
     </xml>
     <xml name="filters">
-        <section name="filter" title="Filtering parameters">
+        <section name="filter" title="Filtering parameters" expanded="true">
             <param argument="maxLen" type="integer" value="" optional="true" min="0" label="Remove long reads" help="Remove reads with length greater than this value. Default: no length threshold"/>
             <param argument="minLen" type="integer" value="20" min="0" label="Remove short reads" help="Remove reads with length less than this value. Default: 20"/>
             <param argument="maxN" type="integer" value="0" min="0" label="Remove reads with more Ns" help="Note that some of the subsequent dada pipeline steps do not allow Ns"/>
--- a/test-data/gentest.R	Fri Jun 30 07:55:53 2023 +0000
+++ b/test-data/gentest.R	Mon Aug 07 01:33:57 2023 +0000
@@ -11,9 +11,9 @@
 print("filterAndTrim")
 
 for (i in seq_len(fwd)) {
-    ftout <- dada2::filterAndTrim(fwd[i], filt_fwd[i], rev[i], filt_rev[i])
-    b <- paste(strsplit(fwd[i], ".", fixed = TRUE)[[1]][1], "tab", sep = ".")
-    write.table(ftout, b, quote = FALSE, sep = "\t", col.names = NA)
+  ftout <- dada2::filterAndTrim(fwd[i], filt_fwd[i], rev[i], filt_rev[i])
+  b <- paste(strsplit(fwd[i], ".", fixed = TRUE)[[1]][1], "tab", sep = ".")
+  write.table(ftout, b, quote = FALSE, sep = "\t", col.names = NA)
 }
 
 # In the test only the 1st data set is used
@@ -64,15 +64,15 @@
 dada_fwd <- dada2::dada(filt_fwd, err_fwd)
 dada_rev <- dada2::dada(filt_rev, err_rev)
 for (id in sample_names) {
-    saveRDS(dada_fwd[[id]], file = paste("dada_", id, "_R1.Rdata", sep = ""))
-    saveRDS(dada_rev[[id]], file = paste("dada_", id, "_R2.Rdata", sep = ""))
+  saveRDS(dada_fwd[[id]], file = paste("dada_", id, "_R1.Rdata", sep = ""))
+  saveRDS(dada_rev[[id]], file = paste("dada_", id, "_R2.Rdata", sep = ""))
 }
 
 # merge pairs
 print("mergePairs")
 merged <- dada2::mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev)
 for (id in sample_names) {
-    saveRDS(merged[[id]], file = paste("mergePairs_", id, ".Rdata", sep = ""))
+  saveRDS(merged[[id]], file = paste("mergePairs_", id, ".Rdata", sep = ""))
 }
 
 
@@ -85,8 +85,8 @@
 df <- data.frame(length = as.numeric(names(reads_per_seqlen)), count = reads_per_seqlen)
 pdf("makeSequenceTable.pdf")
 ggplot(data = df, aes(x = length, y = count)) +
-    geom_col() +
-    theme_bw()
+  geom_col() +
+  theme_bw()
 bequiet <- dev.off()
 
 # remove bimera
@@ -119,7 +119,7 @@
 
 merged_nondef <- dada2::mergePairs(dada_fwd, filt_fwd, dada_rev, filt_rev, minOverlap = 8, maxMismatch = 1, justConcatenate = TRUE, trimOverhang = TRUE)
 for (id in sample_names) {
-    saveRDS(merged_nondef[[id]], file = paste("mergePairs_", id, "_nondefault.Rdata", sep = ""))
+  saveRDS(merged_nondef[[id]], file = paste("mergePairs_", id, "_nondefault.Rdata", sep = ""))
 }
 rb_dada_fwd <- dada2::removeBimeraDenovo(dada_fwd[["F3D0_S188_L001"]])
 write.table(rb_dada_fwd, file = "removeBimeraDenovo_F3D0_dada_uniques.tab", quote = FALSE, sep = "\t", row.names = TRUE, col.names = FALSE)
@@ -129,7 +129,7 @@
 
 # SeqCounts
 get_n <- function(x) {
-    sum(dada2::getUniques(x))
+  sum(dada2::getUniques(x))
 }
 
 print("seqCounts ft")