comparison dada2_makeSequenceTable.xml @ 0:6e0946238688 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f8b6b6e72914ad6bcca8423dfa03f59bde80992e"
author iuc
date Fri, 08 Nov 2019 18:49:57 -0500
parents
children 9ccec6ed8e82
comparison
equal deleted inserted replaced
-1:000000000000 0:6e0946238688
1 <tool id="dada2_makeSequenceTable" name="dada2: makeSequenceTable" version="@DADA2_VERSION@+galaxy@WRAPPER_VERSION@" profile="19.09">
2 <description>construct a sequence table (analogous to OTU table)</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="stdio"/>
8 <expand macro="version_command"/>
9 <command detect_errors="exit_code"><![CDATA[
10 Rscript '$dada2_script'
11 ]]></command>
12 <configfiles>
13 <configfile name="dada2_script"><![CDATA[
14 @READ_FOO@
15 @WRITE_FOO@
16
17 library(dada2, quietly=T)
18 #if $plot == "yes"
19 library(ggplot2, quietly=T)
20 #end if
21
22 samples <- list()
23 #for $s in $samples:
24 samples[["$s.element_identifier"]] <- readRDS('$s')
25 #end for
26
27 seqtab <- makeSequenceTable(samples, orderBy = "$orderBy")
28
29 reads.per.seqlen <- tapply(colSums(seqtab), factor(nchar(getSequences(seqtab))), sum)
30 df <- data.frame(length=as.numeric(names(reads.per.seqlen)), count=reads.per.seqlen)
31
32 #if $plot == "yes"
33 pdf( '$plot_output' )
34 ggplot(data=df, aes(x=length, y=count)) +
35 geom_col() +
36 #if $filter_cond.filter_select != "no"
37 geom_vline( xintercept=c($filter_cond.min-0.5, $filter_cond.max+0.5) ) +
38 #end if
39 theme_bw()
40 bequiet <- dev.off()
41 #end if
42
43 ## filter by seqlengths
44 #if $filter_cond.filter_select != "no"
45 seqtab <- seqtab[, nchar(colnames(seqtab)) %in% seq($filter_cond.min, $filter_cond.max), drop=F]
46 #end if
47 write.data( seqtab, '$stable', "dada2_sequencetable" )
48 ]]></configfile>
49 </configfiles>
50 <inputs>
51 <param argument="samples" type="data" multiple="true" format="@DADA_UNIQUES@" label="samples" />
52 <param argument="orderBy" type="select" label="Column order">
53 <option value="abundance">abundance</option>
54 <option value="nsamples">nsamples</option>
55 </param>
56 <conditional name="filter_cond">
57 <param name="filter_select" type="select" label="Length filter method">
58 <option value="no">No filter</option>
59 <option value="minmax">Specify minimum and maximum sequence lengths</option>
60 </param>
61 <when value="no"/>
62 <when value="minmax">
63 <param name="min" type="integer" value="" label="Minimum sequence length"/>
64 <param name="max" type="integer" value="" label="Maximum sequence length"/>
65 </when>
66 </conditional>
67 <param name="plot" type="boolean" truevalue="yes" falsevalue="no" checked="true" label="plot sequence length distribution" />
68 </inputs>
69 <outputs>
70 <data name="stable" format="dada2_sequencetable" label="${tool.name} on ${on_string}"/>
71 <data name="plot_output" format="pdf" label="${tool.name} on ${on_string}: sequence length distribution">
72 <filter>plot</filter>
73 </data>
74 </outputs>
75 <tests>
76 <test expect_num_outputs="2">
77 <param name="samples" ftype="dada2_mergepairs" value="mergePairs_F3D0.Rdata"/>
78 <output name="stable" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable" lines_diff="2"/>
79 <output name="plot_output" value="makeSequenceTable_F3D0.pdf" ftype="pdf" />
80 </test>
81 <test expect_num_outputs="1">
82 <param name="samples" ftype="dada2_mergepairs" value="mergePairs_F3D0.Rdata"/>
83 <param name="filter_cond|filter_select" value="minmax"/>
84 <param name="filter_cond|min" value="200"/>
85 <param name="filter_cond|max" value="300"/>
86 <param name="plot" value="no" />
87 <output name="stable" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable" lines_diff="2" />
88 </test>
89 </tests>
90 <help><![CDATA[
91 Description
92 ...........
93
94 This function constructs a sequence table -- more precisely an amplicon sequence variant table (ASV) table -- a higher-resolution version of the OTU table produced by traditional methods.
95
96 The sequence table is a matrix with rows corresponding to (and named by) the samples, and columns corresponding to (and named by) the sequence variants.
97
98 Usage
99 .....
100
101 **Input**: The result of dada, or mergePairs.
102
103 **Output**: A data set of type dada2_sequencetable, i.e. a tabular with a row for each sample, and a column for each unique sequence across all the samples. The columns are named by the sequence.
104
105 Details
106 .......
107
108 Sequences that are much longer or shorter than expected may be the result of non-specific priming. You can remove non-target-length by applying a length filter. This is analogous to “cutting a band” in-silico to get amplicons of the targeted length.
109
110 @HELP_OVERVIEW@
111 ]]></help>
112 <expand macro="citations"/>
113 </tool>