comparison stacks_refmap.xml @ 3:26ad8a52d9fd draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks commit e1c1550e0bd61c88ffead2b1c4f6ab7393052393
author iuc
date Sat, 25 Jun 2016 17:29:09 -0400
parents 66d3c1ae3937
children 827c8c6ec4c1
comparison
equal deleted inserted replaced
2:ba76bd1eef47 3:26ad8a52d9fd
1 <tool id="stacks_refmap" name="Stacks: reference map" version="@WRAPPER_VERSION@.0"> 1 <tool id="stacks_refmap" name="Stacks: reference map" version="@WRAPPER_VERSION@.1">
2 <description>the Stacks pipeline with a reference genome (ref_map.pl)</description> 2 <description>the Stacks pipeline with a reference genome (ref_map.pl)</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
10 #import re 10 #import re
11 11
12 #if str( $options_usage.rad_analysis_type ) == "genetic": 12 #if str( $options_usage.rad_analysis_type ) == "genetic":
13 #for $input_parent in $options_usage.parent_alignments: 13 #for $input_parent in $options_usage.parent_alignments:
14 #if $input_parent.ext == "sam": 14 #if $input_parent.ext == "sam":
15 #set $data_path = splitext($input_parent.name)[0] 15 #set $data_path = splitext($input_parent.element_identifier)[0]
16 #set $data_path = re.sub(r'\.1$', '', $data_path) 16 #set $data_path = re.sub(r'\.1$', '', $data_path)
17 #set $data_path = $data_path + ".sam" 17 #set $data_path = $data_path + ".sam"
18 #else: 18 #else:
19 #set $data_path = splitext($input_parent.name)[0] 19 #set $data_path = splitext($input_parent.element_identifier)[0]
20 #set $data_path = re.sub(r'\.1$', '', $data_path) 20 #set $data_path = re.sub(r'\.1$', '', $data_path)
21 #set $data_path = $data_path + ".bam" 21 #set $data_path = $data_path + ".bam"
22 #end if 22 #end if
23 23
24 ln -s "${input_parent}" "${data_path}" && 24 ln -s "${input_parent}" "${data_path}" &&
25 #end for 25 #end for
26 26
27 #for $input_progeny in $options_usage.progeny_alignments: 27 #for $input_progeny in $options_usage.progeny_alignments:
28 28
29 #if $input_progeny.ext == "sam": 29 #if $input_progeny:
30 #set $data_path = splitext($input_progeny.name)[0] 30 #if $input_progeny.ext == "sam":
31 #set $data_path = splitext($input_progeny.element_identifier)[0]
32 #set $data_path = re.sub(r'\.1$', '', $data_path)
33 #set $data_path = $data_path + ".sam"
34 #else:
35 #set $data_path = splitext($input_progeny.element_identifier)[0]
36 #set $data_path = re.sub(r'\.1$', '', $data_path)
37 #set $data_path = $data_path + ".bam"
38 #end if
39
40 ln -s "${input_progeny}" "${data_path}" &&
41 #end if
42 #end for
43 #else:
44 #for $input_indiv in $options_usage.individual_sample:
45
46 #if $input_indiv.ext == "sam":
47 #set $data_path = splitext($input_indiv.element_identifier)[0]
31 #set $data_path = re.sub(r'\.1$', '', $data_path) 48 #set $data_path = re.sub(r'\.1$', '', $data_path)
32 #set $data_path = $data_path + ".sam" 49 #set $data_path = $data_path + ".sam"
33 #else: 50 #else:
34 #set $data_path = splitext($input_progeny.name)[0] 51 #set $data_path = splitext($input_indiv.element_identifier)[0]
35 #set $data_path = re.sub(r'\.1$', '', $data_path) 52 #set $data_path = re.sub(r'\.1$', '', $data_path)
36 #set $data_path = $data_path + ".bam" 53 #set $data_path = $data_path + ".bam"
37 #end if 54 #end if
38 55
39 ln -s "${input_progeny}" "${data_path}" &&
40 #end for
41 #else:
42 #for $input_indiv in $options_usage.individual_sample:
43
44 #if $input_indiv.ext == "sam":
45 #set $data_path = splitext($input_indiv.name)[0]
46 #set $data_path = re.sub(r'\.1$', '', $data_path)
47 #set $data_path = $data_path + ".sam"
48 #else:
49 #set $data_path = splitext($input_indiv.name)[0]
50 #set $data_path = re.sub(r'\.1$', '', $data_path)
51 #set $data_path = $data_path + ".bam"
52 #end if
53
54 ln -s "${input_indiv}" "${data_path}" && 56 ln -s "${input_indiv}" "${data_path}" &&
55 #end for 57 #end for
56 #end if 58 #end if
57 59
58 mkdir stacks_outputs 60 mkdir stacks_outputs
64 -T \${GALAXY_SLOTS:-1} 66 -T \${GALAXY_SLOTS:-1}
65 67
66 #if str( $options_usage.rad_analysis_type ) == "genetic": 68 #if str( $options_usage.rad_analysis_type ) == "genetic":
67 #for $input_parent in $options_usage.parent_alignments: 69 #for $input_parent in $options_usage.parent_alignments:
68 #if $input_parent.ext == "sam": 70 #if $input_parent.ext == "sam":
69 #set $data_path = splitext($input_parent.name)[0] 71 #set $data_path = splitext($input_parent.element_identifier)[0]
70 #set $data_path = re.sub(r'\.1$', '', $data_path) 72 #set $data_path = re.sub(r'\.1$', '', $data_path)
71 #set $data_path = $data_path + ".sam" 73 #set $data_path = $data_path + ".sam"
72 #else: 74 #else:
73 #set $data_path = splitext($input_parent.name)[0] 75 #set $data_path = splitext($input_parent.element_identifier)[0]
74 #set $data_path = re.sub(r'\.1$', '', $data_path) 76 #set $data_path = re.sub(r'\.1$', '', $data_path)
75 #set $data_path = $data_path + ".bam" 77 #set $data_path = $data_path + ".bam"
76 #end if 78 #end if
77 79
78 -p "${data_path}" 80 -p "${data_path}"
79 #end for 81 #end for
80 82
81 -A $options_usage.cross_type 83 -A $options_usage.cross_type
82 84
83 #for $input_progeny in $options_usage.progeny_alignments: 85 #for $input_progeny in $options_usage.progeny_alignments:
84 #if $input_progeny.ext == "sam": 86 #if $input_progeny:
85 #set $data_path = splitext($input_progeny.name)[0] 87 #if $input_progeny.ext == "sam":
88 #set $data_path = splitext($input_progeny.element_identifier)[0]
89 #set $data_path = re.sub(r'\.1$', '', $data_path)
90 #set $data_path = $data_path + ".sam"
91 #else:
92 #set $data_path = splitext($input_progeny.element_identifier)[0]
93 #set $data_path = re.sub(r'\.1$', '', $data_path)
94 #set $data_path = $data_path + ".bam"
95 #end if
96
97 -r "${data_path}"
98 #end if
99 #end for
100 #else:
101 #for $input_indiv in $options_usage.individual_sample:
102
103 #if $input_indiv.ext == "sam":
104 #set $data_path = splitext($input_indiv.element_identifier)[0]
86 #set $data_path = re.sub(r'\.1$', '', $data_path) 105 #set $data_path = re.sub(r'\.1$', '', $data_path)
87 #set $data_path = $data_path + ".sam" 106 #set $data_path = $data_path + ".sam"
88 #else: 107 #else:
89 #set $data_path = splitext($input_progeny.name)[0] 108 #set $data_path = splitext($input_indiv.element_identifier)[0]
90 #set $data_path = re.sub(r'\.1$', '', $data_path)
91 #set $data_path = $data_path + ".bam"
92 #end if
93
94 -r "${data_path}"
95 #end for
96 #else:
97 #for $input_indiv in $options_usage.individual_sample:
98
99 #if $input_indiv.ext == "sam":
100 #set $data_path = splitext($input_indiv.name)[0]
101 #set $data_path = re.sub(r'\.1$', '', $data_path)
102 #set $data_path = $data_path + ".sam"
103 #else:
104 #set $data_path = splitext($input_indiv.name)[0]
105 #set $data_path = re.sub(r'\.1$', '', $data_path) 109 #set $data_path = re.sub(r'\.1$', '', $data_path)
106 #set $data_path = $data_path + ".bam" 110 #set $data_path = $data_path + ".bam"
107 #end if 111 #end if
108 112
109 -s "${data_path}" 113 -s "${data_path}"
138 #if str( $options_usage.rad_analysis_type ) == "genetic": 142 #if str( $options_usage.rad_analysis_type ) == "genetic":
139 @NORM_GENOTYPES_OUTPUT_LIGHT@ 143 @NORM_GENOTYPES_OUTPUT_LIGHT@
140 #end if 144 #end if
141 145
142 ## If input is in bam format, stacks will output gzipped files (no option to control this) 146 ## If input is in bam format, stacks will output gzipped files (no option to control this)
143 && gunzip stacks_outputs/*.gz 147 && if ls stacks_outputs/*.gz > /dev/null 2>&1; then gunzip stacks_outputs/*.gz; fi
144 ]]></command> 148 ]]></command>
145 149
146 <inputs> 150 <inputs>
147 <conditional name="options_usage"> 151 <conditional name="options_usage">
148 <param name="rad_analysis_type" type="select" label="Select your usage"> 152 <param name="rad_analysis_type" type="select" label="Select your usage">
149 <option value="genetic" selected="true">Genetic map</option> 153 <option value="genetic" selected="true">Genetic map</option>
150 <option value="population">Population</option> 154 <option value="population">Population</option>
151 </param> 155 </param>
152 <when value="genetic"> 156 <when value="genetic">
153 <param name="parent_alignments" format="sam,bam" type="data" multiple="true" label="Files containing parent alignments" argument="-p" /> 157 <param name="parent_alignments" format="sam,bam" type="data" multiple="true" label="Files containing parent alignments" argument="-p" help="Dataset names will be used as sample name (no space allowed)." />
154 <param name="progeny_alignments" format="sam,bam" type="data" multiple="true" optional="true" label="Files containing progeny alignments" argument="-r" /> 158 <param name="progeny_alignments" format="sam,bam" type="data" multiple="true" optional="true" label="Files containing progeny alignments" argument="-r" help="Dataset names will be used as sample name (no space allowed)." />
155 159
156 <param name="cross_type" argument="-A" type="select" label="Cross type"> 160 <param name="cross_type" argument="-A" type="select" label="Cross type">
157 <expand macro="cross_types"/> 161 <expand macro="cross_types"/>
158 </param> 162 </param>
159 </when> 163 </when>
160 <when value="population"> 164 <when value="population">
161 <param name="individual_sample" format="sam,bam" type="data" multiple="true" label="Files containing an individual sample from a population" argument="-s" /> 165 <param name="individual_sample" format="sam,bam" type="data" multiple="true" label="Files containing an individual sample from a population" argument="-s" help="Dataset names will be used as sample name (no space allowed)." />
162 <param name="popmap" type="data" format="tabular,txt" label="Specify a population map" argument="-O" /> 166 <param name="popmap" type="data" format="tabular,txt" label="Specify a population map" argument="-O" />
163 </when> 167 </when>
164 </conditional> 168 </conditional>
165 169
166 <param name="m" type="integer" value="3" label="Minimum depth of coverage" help="specify the minimum depth of coverage to report a stack in pstacks" argument="-m" /> 170 <param name="m" type="integer" value="3" label="Minimum depth of coverage" help="specify the minimum depth of coverage to report a stack in pstacks" argument="-m" />
180 184
181 <expand macro="genotypes_output_light"/> 185 <expand macro="genotypes_output_light"/>
182 <expand macro="populations_output_light"/> 186 <expand macro="populations_output_light"/>
183 187
184 <collection name="tags" type="list" label="Assembled loci (tags) from ${on_string}"> 188 <collection name="tags" type="list" label="Assembled loci (tags) from ${on_string}">
185 <discover_datasets pattern="(?P&lt;name&gt;.+\.tags)\.tsv" ext="tabular" directory="stacks_outputs" /> 189 <discover_datasets pattern="(?P&lt;name&gt;.+\.tags)\.tsv$" ext="tabular" directory="stacks_outputs" />
186 </collection> 190 </collection>
187 191
188 <collection name="snps" type="list" label="Model calls (snps) from each locus on ${on_string}"> 192 <collection name="snps" type="list" label="Model calls (snps) from each locus on ${on_string}">
189 <discover_datasets pattern="(?P&lt;name&gt;.+\.snps)\.tsv" ext="tabular" directory="stacks_outputs" /> 193 <discover_datasets pattern="(?P&lt;name&gt;.+\.snps)\.tsv$" ext="tabular" directory="stacks_outputs" />
190 </collection> 194 </collection>
191 195
192 <collection name="alleles" type="list" label="Haplotypes (alleles) recorded from each locus on ${on_string}"> 196 <collection name="alleles" type="list" label="Haplotypes (alleles) recorded from each locus on ${on_string}">
193 <discover_datasets pattern="(?P&lt;name&gt;.+\.alleles)\.tsv" ext="tabular" directory="stacks_outputs" /> 197 <discover_datasets pattern="(?P&lt;name&gt;.+\.alleles)\.tsv$" ext="tabular" directory="stacks_outputs" />
194 </collection> 198 </collection>
195 199
196 <collection name="matches" type="list" label="Matches to the catalog on ${on_string}"> 200 <collection name="matches" type="list" label="Matches to the catalog on ${on_string}">
197 <discover_datasets pattern="(?P&lt;name&gt;.+\.matches)\.tsv" ext="tabular" directory="stacks_outputs" /> 201 <discover_datasets pattern="(?P&lt;name&gt;.+\.matches)\.tsv$" ext="tabular" directory="stacks_outputs" />
198 </collection> 202 </collection>
199 203
200 <collection name="all_output" type="list" label="Full output from ref_map on ${on_string}"> 204 <collection name="all_output" type="list" label="Full output from ref_map on ${on_string}">
201 <discover_datasets pattern="(?P&lt;name&gt;.+\.(tags|snps|alleles|matches))\.tsv" ext="tabular" directory="stacks_outputs" /> 205 <discover_datasets pattern="(?P&lt;name&gt;.+\.(tags|snps|alleles|matches))\.tsv$" ext="tabular" directory="stacks_outputs" />
202 <discover_datasets pattern="(?P&lt;name&gt;.+\.(haplotypes|genotypes|markers|hapstats|sumstats|sumstats_summary))\.tsv" ext="tabular" directory="stacks_outputs" /> 206 <discover_datasets pattern="(?P&lt;name&gt;.+\.(haplotypes|genotypes|markers|hapstats|sumstats|sumstats_summary))\.tsv$" ext="tabular" directory="stacks_outputs" />
203 <discover_datasets pattern="(?P&lt;name&gt;.+\.(genotypes))\.(loc|txt)" ext="txt" directory="stacks_outputs" /> 207 <discover_datasets pattern="(?P&lt;name&gt;.+\.(genotypes))\.(loc|txt)$" ext="txt" directory="stacks_outputs" />
204 </collection> 208 </collection>
205 </outputs> 209 </outputs>
206 210
207 <tests> 211 <tests>
212 <test>
213 <param name="options_usage|rad_analysis_type" value="genetic"/>
214 <param name="options_usage|parent_alignments" value="refmap/PopA_01.bam" />
215 <output name="output_log">
216 <assert_contents>
217 <has_text text="ref_map.pl completed" />
218 </assert_contents>
219 </output>
220
221 <!-- catalog -->
222 <output name="catalogsnps">
223 <assert_contents>
224 <has_text text="catalog generated" />
225 </assert_contents>
226 </output>
227 <output name="catalogalleles">
228 <assert_contents>
229 <has_text text="catalog generated" />
230 </assert_contents>
231 </output>
232 <output name="catalogtags">
233 <assert_contents>
234 <has_text text="catalog generated" />
235 </assert_contents>
236 </output>
237
238 <!-- genotypes -->
239 <output name="out_generic_haplo">
240 <assert_contents>
241 <has_text text="Catalog ID" />
242 </assert_contents>
243 </output>
244 <output name="out_sql_markers">
245 <assert_contents>
246 <has_text text="Total Genotypes" />
247 </assert_contents>
248 </output>
249 <output name="out_joinmap">
250 <assert_contents>
251 <has_text text="batch_1.genotypes_" />
252 </assert_contents>
253 </output>
254 <output name="out_sql_genotypes">
255 <assert_contents>
256 <has_text text="SQL ID" />
257 </assert_contents>
258 </output>
259 <output name="out_generic_haplo">
260 <assert_contents>
261 <has_text text="Seg Dist" />
262 </assert_contents>
263 </output>
264 <output name="out_sql_markers">
265 <assert_contents>
266 <has_text text="Total Genotypes" />
267 </assert_contents>
268 </output>
269
270 <!-- samples -->
271 <output_collection name="tags">
272 <element name="PopA_01.tags">
273 <assert_contents>
274 <has_text text="generated on " />
275 </assert_contents>
276 </element>
277 </output_collection>
278 <output_collection name="snps">
279 <element name="PopA_01.snps">
280 <assert_contents>
281 <has_text text="generated on " />
282 </assert_contents>
283 </element>
284 </output_collection>
285 <output_collection name="alleles">
286 <element name="PopA_01.alleles">
287 <assert_contents>
288 <has_text text="generated on " />
289 </assert_contents>
290 </element>
291 </output_collection>
292 <output_collection name="matches">
293 <element name="PopA_01.matches">
294 <assert_contents>
295 <has_text text="generated on " />
296 </assert_contents>
297 </element>
298 </output_collection>
299 </test>
208 <test> 300 <test>
209 <param name="options_usage|rad_analysis_type" value="genetic"/> 301 <param name="options_usage|rad_analysis_type" value="genetic"/>
210 <param name="options_usage|parent_alignments" value="refmap/PopA_01.bam" /> 302 <param name="options_usage|parent_alignments" value="refmap/PopA_01.bam" />
211 <param name="options_usage|progeny_alignments" value="refmap/PopA_02.bam" /> 303 <param name="options_usage|progeny_alignments" value="refmap/PopA_02.bam" />
212 <output name="output_log"> 304 <output name="output_log">