comparison stacks_tsv2bam.xml @ 0:99d0b19ef534 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit 98327d2948ae1ccb5aef5db9ab88605fd74a0de7-dirty
author matthias
date Thu, 29 Nov 2018 11:48:13 -0500
parents
children 9cd90b2f08f7
comparison
equal deleted inserted replaced
-1:000000000000 0:99d0b19ef534
1 <tool id="stacks2_tsv2bam" name="Stacks2: tsv2bam" version="@WRAPPER_VERSION@">
2 <description>oriented data by locus</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="stdio"/>
8 <command><![CDATA[
9 @CLEAN_EXT@
10
11 mkdir stacks_inputs stacks_outputs &&
12
13 ## TODO make token
14 #set $catalog = ""
15 #for $input_file in $input_cat
16 #set $filename = str($input_file.element_identifier)
17 #if not filename.endswith('.tsv')
18 #set $filename = $filename + ".tsv"
19 #end if
20 #if re.search('catalog\.[a-z]+(\.tsv)?$', $filename)
21 ln -s '${input_file}' 'stacks_inputs/$filename' &&
22 #if $filename.endswith('.tags.tsv')
23 #set catalog += " -c 'stacks_inputs/'"
24 #end if
25 #end if
26 #end for
27
28 ## TODO make token
29 #set $samples = ""
30 #for $input_file in $input_tags
31 #set $filename = str($input_file.element_identifier)
32 #if not filename.endswith('.tsv')
33 #set $filename = $filename + ".tsv"
34 #end if
35 #if not re.search('catalog\.[a-z]+(\.tsv)?$', $filename)
36 ln -s '${input_file}' 'stacks_inputs/$filename' &&
37 #if $filename.endswith('.tags.tsv')
38 #set samples += " -s '"+$filename[:-9] + "'"
39 #end if
40 #end if
41 #end for
42
43 ## TODO make token
44 #for $input_file in $input_matches
45 #set $filename = str($input_file.element_identifier)
46 #if not filename.endswith('.tsv')
47 #set $filename = $filename + ".tsv"
48 #end if
49 #if re.search('matches.tsv$', $filename)
50 ln -s '${input_file}' 'stacks_inputs/$filename' &&
51 #end if
52 #end for
53
54 ## link fastq files into stacks_inputs/
55 #set $paired_reads=False
56 #for $sample in $input_type.samples:
57 #if not $sample:
58 #continue
59 #end if
60 #set $paired_reads=True
61 #set $read_direction="reverse"
62 @FASTQ_INPUT@
63 #end for
64
65 tsv2bam
66 -P stacks_inputs
67 #if $popmap
68 -M '$popmap'
69 #else
70 $samples
71 #end if
72 #if $paired_reads
73 --pe-reads-dir stacks_inputs
74 #end if
75 -t \${GALAXY_SLOTS:-1}
76 ## tsv2bam writes to stdout and creates a log file
77 ## - make stdout stderr
78 ## - move the additional log file
79 2>&1
80 && mv stacks_inputs/tsv2bam.log $output_log
81 && mv stacks_inputs/*matches.bam stacks_outputs
82
83 ]]></command>
84
85 <inputs>
86 <!-- TODO make the inputs macros and use in other tools -->
87 <param name="input_cat" format="tabular,txt" type="data_collection" collection_type="list" label="Catalog files" help="output from a previous Stacks pipeline steps e.g. denovo_map, refmap or cstacks" />
88 <param name="input_tags" format="tabular,txt" type="data_collection" collection_type="list" label="Samples stacks" help="output from previous Stacks pipeline steps e.g. denovo_map, refmap or ustacks/pstacks" />
89 <param name="input_matches" format="tabular,txt" type="data_collection" collection_type="list" label="Matches to the catalog" help="output from previous Stacks pipeline steps e.g. denovo_map, refmap or sstacks" />
90 <!-- TODO add BAM? -->
91 <expand macro="fastq_input_macro" fastq_optional="true"/>
92 <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, matching will be done only for samples listed in this file" optional="true" argument="-M" />
93 <expand macro="in_log"/>
94 </inputs>
95
96 <outputs>
97 <expand macro="out_log"/>
98 <expand macro="tsv2bam_outputs_macro"/>
99 </outputs>
100
101 <tests>
102 <!-- test wo paired end data -->
103 <test>
104 <param name="input_cat">
105 <collection type="list">
106 <element name="catalog.alleles.tsv" ftype="tabular" value="cstacks/catalog.alleles.tsv" />
107 <element name="catalog.snps.tsv" ftype="tabular" value="cstacks/catalog.snps.tsv" />
108 <element name="catalog.tags.tsv" ftype="tabular" value="cstacks/catalog.tags.tsv" />
109 </collection>
110 </param>
111 <param name="input_tags">
112 <collection type="list">
113 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
114 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
115 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
116 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
117 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
118 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
119 </collection>
120 </param>
121 <param name="input_matches">
122 <collection type="list">
123 <element name="PopA_01.matches" ftype="tabular" value="sstacks/PopA_01.matches.tsv" />
124 <element name="PopA_02.matches" ftype="tabular" value="sstacks/PopA_02.matches.tsv" />
125 </collection>
126 </param>
127 <param name="add_log" value="yes" />
128 <output name="output_log" ftype="txt" file="tsv2bam/tsv2bam.log" lines_diff="2"/>
129 <output_collection name="bams" type="list" count="2">
130 <element name="PopA_01.matches" file="tsv2bam/PopA_01.matches.bam" ftype="bam" compare="sim_size"/>
131 <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size" />
132 </output_collection>
133 </test>
134 <!-- test w popmap, w reverse reads as multiple selection -->
135 <test>
136 <param name="input_cat">
137 <collection type="list">
138 <element name="catalog.alleles.tsv" ftype="tabular" value="cstacks/catalog.alleles.tsv" />
139 <element name="catalog.snps.tsv" ftype="tabular" value="cstacks/catalog.snps.tsv" />
140 <element name="catalog.tags.tsv" ftype="tabular" value="cstacks/catalog.tags.tsv" />
141 </collection>
142 </param>
143 <param name="input_tags">
144 <collection type="list">
145 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
146 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
147 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
148 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
149 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
150 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
151 </collection>
152 </param>
153 <param name="input_matches">
154 <collection type="list">
155 <element name="PopA_01.matches" ftype="tabular" value="sstacks/PopA_01.matches.tsv" />
156 <element name="PopA_02.matches" ftype="tabular" value="sstacks/PopA_02.matches.tsv" />
157 </collection>
158 </param>
159 <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
160 <param name="input_type|input_type_selector" value="manual"/>
161 <param name="input_type|samples" value="demultiplexed/PopA_01.2.fq,demultiplexed/PopA_02.2.fq" ftype="fastqsanger" />
162 <param name="add_log" value="yes" />
163 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
164 <output_collection name="bams" type="list" count="2">
165 <element name="PopA_01.matches" file="tsv2bam/PopA_01.matches.bam" ftype="bam" compare="sim_size"/>
166 <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size" />
167 </output_collection>
168 </test>
169 <!-- test w reverse reads as list -->
170 <test>
171 <param name="input_cat">
172 <collection type="list">
173 <element name="catalog.alleles.tsv" ftype="tabular" value="cstacks/catalog.alleles.tsv" />
174 <element name="catalog.snps.tsv" ftype="tabular" value="cstacks/catalog.snps.tsv" />
175 <element name="catalog.tags.tsv" ftype="tabular" value="cstacks/catalog.tags.tsv" />
176 </collection>
177 </param>
178 <param name="input_tags">
179 <collection type="list">
180 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
181 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
182 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
183 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
184 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
185 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
186 </collection>
187 </param>
188 <param name="input_matches">
189 <collection type="list">
190 <element name="PopA_01.matches" ftype="tabular" value="sstacks/PopA_01.matches.tsv" />
191 <element name="PopA_02.matches" ftype="tabular" value="sstacks/PopA_02.matches.tsv" />
192 </collection>
193 </param>
194 <param name="input_type|input_type_selector" value="list"/>
195 <param name="input_type|samples">
196 <collection type="list">
197 <element name="PopA_01" value="demultiplexed/PopA_01.2.fq" ftype="fastqsanger" />
198 <element name="PopA_02" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
199 </collection>
200 </param>
201 <param name="add_log" value="yes" />
202 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
203 <output_collection name="bams" type="list" count="2">
204 <element name="PopA_01.matches" file="tsv2bam/PopA_01.matches.bam" ftype="bam" compare="sim_size"/>
205 <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size" />
206 </output_collection>
207 </test>
208 <!-- test w paired reads as paired data set list -->
209 <test>
210 <param name="input_cat">
211 <collection type="list">
212 <element name="catalog.alleles.tsv" ftype="tabular" value="cstacks/catalog.alleles.tsv" />
213 <element name="catalog.snps.tsv" ftype="tabular" value="cstacks/catalog.snps.tsv" />
214 <element name="catalog.tags.tsv" ftype="tabular" value="cstacks/catalog.tags.tsv" />
215 </collection>
216 </param>
217 <param name="input_tags">
218 <collection type="list">
219 <element name="PopA_01.alleles.tsv" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
220 <element name="PopA_01.snps.tsv" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
221 <element name="PopA_01.tags.tsv" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
222 <element name="PopA_02.alleles.tsv" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
223 <element name="PopA_02.snps.tsv" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
224 <element name="PopA_02.tags.tsv" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
225 </collection>
226 </param>
227 <param name="input_matches">
228 <collection type="list">
229 <element name="PopA_01.matches" ftype="tabular" value="sstacks/PopA_01.matches.tsv" />
230 <element name="PopA_02.matches" ftype="tabular" value="sstacks/PopA_02.matches.tsv" />
231 </collection>
232 </param>
233 <param name="input_type|input_type_selector" value="list"/>
234 <param name="input_type|samples">
235 <collection type="list:paired">
236 <element name="PopA_01">
237 <collection type="paired">
238 <element name="forward" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger" />
239 <element name="reverse" value="demultiplexed/PopA_01.2.fq" ftype="fastqsanger"/>
240 </collection>
241 </element>
242 <element name="PopA_02">
243 <collection type="paired">
244 <element name="forward" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
245 <element name="reverse" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
246 </collection>
247 </element>
248 </collection>
249 </param>
250 <param name="add_log" value="yes" />
251 <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
252 <output_collection name="bams" type="list" count="2">
253 <element name="PopA_01.matches" file="tsv2bam/PopA_01.matches.bam" ftype="bam" compare="sim_size"/>
254 <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size" />
255 </output_collection>
256 </test>
257 </tests>
258
259 <help>
260 <![CDATA[
261 .. class:: infomark
262
263 **What it does**
264
265 The unique stacks program will take as input a set of short-read sequences and align them into exactly-matching stacks. Comparing the stacks it will form a set of loci and detect SNPs at each locus using a maximum likelihood framework
266
267 --------
268
269 **Input files**
270
271 FASTQ, FASTA
272
273 **Output files**
274
275 - XXX.tags.tsv file:
276
277 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
278
279 Notes: For the tags file, each stack will start in the file with a consensus sequence for the entire stack followed by the flags for that stack. Then, each individual read that was merged into that stack will follow. The next stack will start with another consensus sequence.
280
281
282 - XXX.snps.tsv file:
283
284 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
285
286 Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one.
287
288
289 - XXX.alleles.tsv file:
290
291 See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
292
293 @STACKS_INFOS@
294 ]]>
295 </help>
296 <expand macro="citation" />
297 </tool>