Mercurial > repos > matthias > dada2_makesequencetable
comparison dada2_makeSequenceTable.xml @ 5:ec4a183cc713 draft
planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit 990192685955e9cda0282e348c28ef6462d88a38
| author | matthias |
|---|---|
| date | Sun, 05 May 2019 12:37:14 -0400 |
| parents | c3834c230b0a |
| children | 31e8d1265580 |
comparison
equal
deleted
inserted
replaced
| 4:383501d6aeb0 | 5:ec4a183cc713 |
|---|---|
| 9 Rscript '$dada2_script' | 9 Rscript '$dada2_script' |
| 10 ]]></command> | 10 ]]></command> |
| 11 <configfiles> | 11 <configfiles> |
| 12 <configfile name="dada2_script"><![CDATA[ | 12 <configfile name="dada2_script"><![CDATA[ |
| 13 @READ_FOO@ | 13 @READ_FOO@ |
| 14 @WRITE_FOO@ | |
| 14 | 15 |
| 15 library(dada2, quietly=T) | 16 library(dada2, quietly=T) |
| 16 #if $plot == "yes" | 17 #if $plot == "yes" |
| 17 library(ggplot2, quietly=T) | 18 library(ggplot2, quietly=T) |
| 18 #end if | 19 #end if |
| 19 | 20 |
| 20 samples <- list() | 21 samples <- list() |
| 21 #for $s in $samples: | 22 #for $s in $samples: |
| 22 #if $len($samples) == 1 | |
| 23 samples <- readRDS('$s') | |
| 24 #else | |
| 25 samples[["$s.element_identifier"]] <- readRDS('$s') | 23 samples[["$s.element_identifier"]] <- readRDS('$s') |
| 26 #end if | |
| 27 #end for | 24 #end for |
| 28 ## make sequence table | 25 |
| 29 seqtab <- makeSequenceTable(samples, orderBy = "$orderBy") | 26 seqtab <- makeSequenceTable(samples, orderBy = "$orderBy") |
| 30 | |
| 31 | 27 |
| 32 reads.per.seqlen <- tapply(colSums(seqtab), factor(nchar(getSequences(seqtab))), sum) | 28 reads.per.seqlen <- tapply(colSums(seqtab), factor(nchar(getSequences(seqtab))), sum) |
| 33 df <- data.frame(length=as.numeric(names(reads.per.seqlen)), count=reads.per.seqlen) | 29 df <- data.frame(length=as.numeric(names(reads.per.seqlen)), count=reads.per.seqlen) |
| 34 | 30 |
| 35 #if $plot == "yes" | 31 #if $plot == "yes" |
| 43 bequiet <- dev.off() | 39 bequiet <- dev.off() |
| 44 #end if | 40 #end if |
| 45 | 41 |
| 46 ## filter by seqlengths | 42 ## filter by seqlengths |
| 47 #if $filter_cond.filter_select != "no" | 43 #if $filter_cond.filter_select != "no" |
| 48 seqtab <- seqtab[, nchar(colnames(seqtab)) %in% seq($filter_cond.min, $filter_cond.max)] | 44 seqtab <- seqtab[, nchar(colnames(seqtab)) %in% seq($filter_cond.min, $filter_cond.max), drop=F] |
| 49 #end if | 45 #end if |
| 50 | 46 write.data( seqtab, '$stable', "dada2_sequencetable" ) |
| 51 write.table(seqtab, "$stable", quote=F, sep="\t", row.names = T, col.names = NA) | |
| 52 ]]></configfile> | 47 ]]></configfile> |
| 53 </configfiles> | 48 </configfiles> |
| 54 <inputs> | 49 <inputs> |
| 55 <param name="samples" type="data" multiple="true" format="@DADA_UNIQUES@" label="samples" /> | 50 <param argument="samples" type="data" multiple="true" format="@DADA_UNIQUES@" label="samples" /> |
| 56 <param argument="orderBy" type="select" label="Column order"> | 51 <param argument="orderBy" type="select" label="Column order"> |
| 57 <option value="abundance">abundance</option> | 52 <option value="abundance">abundance</option> |
| 58 <option value="nsamples">nsamples</option> | 53 <option value="nsamples">nsamples</option> |
| 59 </param> | 54 </param> |
| 60 <conditional name="filter_cond"> | 55 <conditional name="filter_cond"> |
| 75 <data name="plot_output" format="pdf" label="${tool.name} on ${on_string}: sequence length distribution"> | 70 <data name="plot_output" format="pdf" label="${tool.name} on ${on_string}: sequence length distribution"> |
| 76 <filter>plot</filter> | 71 <filter>plot</filter> |
| 77 </data> | 72 </data> |
| 78 </outputs> | 73 </outputs> |
| 79 <tests> | 74 <tests> |
| 80 <test> | 75 <test expect_num_outputs="2"> |
| 81 <param name="samples" ftype="dada2_mergepairs" value="mergePairs_F3D0.Rdata"/> | 76 <param name="samples" ftype="dada2_mergepairs" value="mergePairs_F3D0.Rdata"/> |
| 77 <output name="stable" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable" /> | |
| 78 <output name="plot_output" value="makeSequenceTable_F3D0.pdf" ftype="pdf" /> | |
| 79 </test> | |
| 80 <test expect_num_outputs="1"> | |
| 81 <param name="samples" ftype="dada2_mergepairs" value="mergePairs_F3D0.Rdata"/> | |
| 82 <param name="filter_cond|filter_select" value="minmax"/> | |
| 83 <param name="filter_cond|min" value="200"/> | |
| 84 <param name="filter_cond|max" value="300"/> | |
| 85 <param name="plot" value="no" /> | |
| 82 <output name="stable" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable" /> | 86 <output name="stable" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable" /> |
| 83 </test> | 87 </test> |
| 84 </tests> | 88 </tests> |
| 85 <help><