comparison dada2_seqCounts.xml @ 0:d26cea4b4cc4 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:50:51 -0500
parents
children f74c56549143
comparison
equal deleted inserted replaced
-1:000000000000 0:d26cea4b4cc4
1 <tool id="dada2_seqCounts" name="dada2: sequence counts" version="@DADA2_VERSION@+galaxy@WRAPPER_VERSION@" profile="19.09">
2 <description></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 library(dada2, quietly=T)
16
17 getN <- function(x){ sum(getUniques(x)) }
18
19 df <- NULL
20 #for $i, $rep in enumerate($inrep)
21 samples = list()
22 #for $s in $rep.input:
23 ## for collection input assume identifiers are sample names
24 #if $s.ext in ["tabular", "dada2_dada", "dada2_mergepairs"]
25 sample_name <- '$s.element_identifier'
26 samples[[sample_name]] <- $read_data( $s )
27 #else
28 samples <- $read_data( $s )
29 #end if
30 #if $s.ext == "tabular"
31 tabular <- T
32 #else
33 tabular <- F
34 #end if
35 #end for
36
37 #if str($rep.name) == ""
38 dname <- '$str(i)'
39 #else
40 dname <- '$rep.name'
41 #end if
42
43 if( tabular ){
44 tdf <- NULL
45 for( n in names( samples ) ){
46 if(is.null(tdf)){
47 tdf <- samples[[n]]
48 }else{
49 tdf <- rbind(tdf, samples[[n]])
50 }
51 }
52 names(tdf) <- paste( dname, names(tdf) )
53 tdf <- cbind( data.frame(samples=names( samples )), tdf)
54 }else{
55 if(is.null(names(samples))){
56 tdf <- data.frame( samples = row.names(samples) )
57 }else{
58 tdf <- data.frame( samples = names(samples) )
59 }
60 t <- tryCatch({
61 sapply(samples, getN)
62 },
63 error=function(cond) {
64 rowSums(samples)
65 })
66 tdf[[ dname ]] <- t
67 }
68 if(is.null(df)){
69 df <- tdf
70 }else{
71 df <- merge( df, tdf, by="samples", all=T, no.dups=T)
72 }
73 #end for
74 write.table(df, "$counts", quote=F, sep="\t", row.names = F, col.names = T)
75 ]]></configfile>
76 </configfiles>
77 <inputs>
78 <repeat name="inrep" title="data sets" min="1">
79 <param name="input" type="data" multiple="true" format="tabular,@DADA_UNIQUES@,dada2_sequencetable,dada2_uniques" label="Dataset(s)"/>
80 <param name="name" type="text" value="" optional="true" label="name"/>
81 </repeat>
82 </inputs>
83 <outputs>
84 <data name="counts" format="tabular" label="${tool.name} on ${on_string}"/>
85 </outputs>
86 <tests>
87 <!-- test for the separate inputs (didn't implement as single test using the repeat
88 since the sample name won't match anyway [galaxy does not allow to specify the
89 names of the elements of the input collection for <param ... multiple="true">]) -->
90 <test>
91 <repeat name="inrep">
92 <param name="input" value="filterAndTrim_F3D0.tab" ftype="tabular"/>
93 <param name="name" value="filter"/>
94 </repeat>
95 <output name="counts" value="seqCounts_F3D0_filter.tab" ftype="tabular" />
96 </test>
97 <test>
98 <repeat name="inrep">
99 <param name="input" value="dada_F3D0_R1.Rdata" ftype="dada2_dada"/>
100 <param name="name" value="dadaF"/>
101 </repeat>
102 <output name="counts" value="seqCounts_F3D0_dadaF.tab" ftype="tabular" />
103 </test>
104 <test>
105 <repeat name="inrep">
106 <param name="input" value="mergePairs_F3D0.Rdata" ftype="dada2_mergepairs"/>
107 <param name="name" value="merge"/>
108 </repeat>
109 <output name="counts" value="seqCounts_F3D0_merge.tab" ftype="tabular" />
110 </test>
111 <test>
112 <repeat name="inrep">
113 <param name="input" value="makeSequenceTable_F3D0.tab" ftype="dada2_sequencetable"/>
114 <param name="name" value="seqtab"/>
115 </repeat>
116 <output name="counts" value="seqCounts_F3D0_seqtab.tab" ftype="tabular" />
117 </test>
118 <test>
119 <repeat name="inrep">
120 <param name="input" value="removeBimeraDenovo_F3D0.tab" ftype="dada2_sequencetable"/>
121 <param name="name" value="nochim"/>
122 </repeat>
123 <output name="counts" value="seqCounts_F3D0_nochim.tab" ftype="tabular" />
124 </test>
125 </tests>
126 <help><![CDATA[
127 Description
128 ...........
129
130 Get the counts of sequences per sample for the different stages of the dada pipeline.
131
132 Usage
133 .....
134
135 **Inputs:**
136
137 Any number of results of dada2 steps in the following form:
138 - a collection of results from dada, or mergePairs; or the collection of statistics from filterAndTrim (the identifiers of the collection elements are used as sample names)
139 - the result of makeSequenceTable or removeBimeraDenovo
140
141 **Output:**
142
143 A table containing the number of sequences per sample (rows) for each input (columns)
144
145 Details
146 .......
147
148 For results from
149
150 - dada, and mergePairs the sum of the result of dada2's getUniques function is used
151 - makeSequenceTable, and removeBimeraDenovo R's rowSums function is used
152
153 @HELP_OVERVIEW@
154 ]]></help>
155 <expand macro="citations"/>
156 </tool>