Mercurial > repos > iuc > bwa_mem2
comparison read_group_macros.xml @ 0:82217dccdbcf draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bwa_mem2 commit 7998bbefd9bfd03bc0e92a922297b503832c0419"
author | iuc |
---|---|
date | Fri, 08 Oct 2021 10:19:48 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:82217dccdbcf |
---|---|
1 <macros> | |
2 <!-- Import this at the top of your command block and then | |
3 define rg_auto_name. --> | |
4 <token name="@define_read_group_helpers@"> | |
5 #def identifier_or_name($input1) | |
6 #if hasattr($input1, 'element_identifier') | |
7 #return $input1.element_identifier | |
8 #else | |
9 #return $input1.name.rstrip('.gz').rstrip('.fastq').rstrip('.fq') | |
10 #end if | |
11 #end def | |
12 | |
13 #def clean(name) | |
14 #import re | |
15 #set $name_clean = re.sub('[^\w\-_\.]', '_', $name) | |
16 #return $name_clean | |
17 #end def | |
18 | |
19 #def read_group_name_default($input1, $input2=None) | |
20 #if $input2 is None | |
21 #return $clean($identifier_or_name($input1)) | |
22 #else | |
23 #import itertools | |
24 #set $input_name1 = $clean($identifier_or_name($input1)) | |
25 #set $input_name2 = $clean($identifier_or_name($input2)) | |
26 #set $common_prefix = ''.join([c[0] for c in itertools.takewhile(lambda x: all(x[0] == y for y in x), zip(*[$input_name1, $input_name2]))]) | |
27 #if len($common_prefix) > 3 | |
28 #return $common_prefix | |
29 #else | |
30 #return $input_name1 | |
31 #end if | |
32 #end if | |
33 #end def | |
34 | |
35 #def format_read_group(prefix, value, quote='', arg='') | |
36 #if $value | |
37 #return $arg + $quote + $prefix + $value + $quote | |
38 #else | |
39 #return '' | |
40 #end if | |
41 #end def | |
42 | |
43 #def rg_param(name) | |
44 #if $varExists("rg") | |
45 #return $rg.get($name, None) | |
46 #else | |
47 #return $getVar($name, None) | |
48 #end if | |
49 #end def | |
50 | |
51 #set $use_rg = True | |
52 </token> | |
53 <!-- preconditions use_rg and rg_auto_name have been | |
54 defined. | |
55 --> | |
56 <token name="@set_read_group_vars@"> | |
57 #if $use_rg | |
58 #if $rg_param('read_group_id_conditional') is None | |
59 #set $rg_id = $rg_auto_name | |
60 #elif $rg_param('read_group_id_conditional').do_auto_name | |
61 #set $rg_id = $rg_auto_name | |
62 #else | |
63 #set $rg_id = str($rg_param('read_group_id_conditional').ID) | |
64 #end if | |
65 | |
66 #if $rg_param('read_group_sm_conditional') is None | |
67 #set $rg_sm = '' | |
68 #elif $rg_param('read_group_sm_conditional').do_auto_name | |
69 #set $rg_sm = $rg_auto_name | |
70 #else | |
71 #set $rg_sm = str($rg_param('read_group_sm_conditional').SM) | |
72 #end if | |
73 | |
74 #if $rg_param('PL') | |
75 #set $rg_pl = str($rg_param('PL')) | |
76 #else | |
77 #set $rg_pl = '' | |
78 #end if | |
79 | |
80 #if $rg_param('read_group_lb_conditional') is None | |
81 #set $rg_lb = '' | |
82 #elif $rg_param('read_group_lb_conditional').do_auto_name | |
83 #set $rg_lb = $rg_auto_name | |
84 #else | |
85 #set $rg_lb = str($rg_param('read_group_lb_conditional').LB) | |
86 #end if | |
87 | |
88 #if $rg_param('CN') | |
89 #set $rg_cn = str($rg_param('CN')) | |
90 #else | |
91 #set $rg_cn = '' | |
92 #end if | |
93 | |
94 #if $rg_param("DS") | |
95 #set $rg_ds = str($rg_param("DS")) | |
96 #else | |
97 #set $rg_ds = '' | |
98 #end if | |
99 | |
100 #if $rg_param("DT") | |
101 #set $rg_dt = str($rg_param("DT")) | |
102 #else | |
103 #set $rg_dt = '' | |
104 #end if | |
105 | |
106 #if $rg_param("FO") | |
107 #set $rg_fo = str($rg_param("FO")) | |
108 #else | |
109 #set $rg_fo = '' | |
110 #end if | |
111 | |
112 #if $rg_param("KS") | |
113 #set $rg_ks = str($rg_param("KS")) | |
114 #else | |
115 #set $rg_ks = '' | |
116 #end if | |
117 | |
118 #if $rg_param("PG") | |
119 #set $rg_pg = str($rg_param("PG")) | |
120 #else | |
121 #set $rg_pg = '' | |
122 #end if | |
123 | |
124 #if $rg_param("PI") != None | |
125 #set $rg_pi = str($rg_param("PI")) | |
126 #else | |
127 #set $rg_pi = '' | |
128 #end if | |
129 | |
130 #if $rg_param("PU") | |
131 #set $rg_pu = str($rg_param("PU")) | |
132 #else | |
133 #set $rg_pu = '' | |
134 #end if | |
135 #end if | |
136 </token> | |
137 <token name="@set_use_rg_var@"> | |
138 #set $use_rg = str($rg.rg_selector) != "do_not_set" | |
139 </token> | |
140 <xml name="read_group_auto_name_conditional"> | |
141 <param name="do_auto_name" type="boolean" label="Auto-assign" help="Use dataset name or collection information to automatically assign this value" checked="no" /> | |
142 <when value="true"> | |
143 </when> | |
144 <when value="false"> | |
145 <yield /> | |
146 </when> | |
147 </xml> | |
148 <xml name="read_group_id_param"> | |
149 <param name="ID" type="text" value="" label="Read group identifier (ID)" help="This value must be unique among multiple samples in your experiment" optional="false"> | |
150 <validator type="empty_field" /> | |
151 </param> | |
152 </xml> | |
153 <xml name="read_group_id_conditional"> | |
154 <conditional name="read_group_id_conditional"> | |
155 <expand macro="read_group_auto_name_conditional"> | |
156 <expand macro="read_group_id_param" /> | |
157 </expand> | |
158 </conditional> | |
159 </xml> | |
160 <xml name="read_group_sm_param"> | |
161 <param name="SM" type="text" value="" label="Read group sample name (SM)" help="This value should be descriptive. Use pool name where a pool is being sequenced" /> | |
162 </xml> | |
163 <xml name="read_group_sm_conditional"> | |
164 <conditional name="read_group_sm_conditional"> | |
165 <expand macro="read_group_auto_name_conditional"> | |
166 <expand macro="read_group_sm_param" /> | |
167 </expand> | |
168 </conditional> | |
169 </xml> | |
170 <!-- Above SM param is optional (for SAM/BAM spec, this is required | |
171 as per Picard. | |
172 --> | |
173 <xml name="read_group_sm_param_required"> | |
174 <param name="SM" type="text" value="" label="Read group sample name (SM)" optional="false" help="This value should be descriptive. Use pool name where a pool is being sequenced"> | |
175 <validator type="empty_field" /> | |
176 </param> | |
177 </xml> | |
178 <xml name="read_group_sm_required_conditional"> | |
179 <conditional name="read_group_sm_conditional"> | |
180 <expand macro="read_group_auto_name_conditional"> | |
181 <expand macro="read_group_sm_param" /> | |
182 </expand> | |
183 </conditional> | |
184 </xml> | |
185 <xml name="read_group_pl_param"> | |
186 <param name="PL" type="select" label="Platform/technology used to produce the reads (PL)"> | |
187 <option value="CAPILLARY">CAPILLARY</option> | |
188 <option value="LS454">LS454</option> | |
189 <option selected="True" value="ILLUMINA">ILLUMINA</option> | |
190 <option value="SOLID">SOLID</option> | |
191 <option value="HELICOS">HELICOS</option> | |
192 <option value="IONTORRENT">IONTORRENT</option> | |
193 <option value="PACBIO">PACBIO</option> | |
194 </param> | |
195 </xml> | |
196 <xml name="read_group_lb_param"> | |
197 <param name="LB" type="text" label="Library name (LB)" optional="true" /> | |
198 </xml> | |
199 <xml name="read_group_lb_conditional"> | |
200 <conditional name="read_group_lb_conditional"> | |
201 <expand macro="read_group_auto_name_conditional"> | |
202 <expand macro="read_group_lb_param" /> | |
203 </expand> | |
204 </conditional> | |
205 </xml> | |
206 <xml name="read_group_lb_required_param"> | |
207 <param name="LB" type="text" label="Library name (LB)" optional="false"> | |
208 <validator type="empty_field" /> | |
209 </param> | |
210 </xml> | |
211 <xml name="read_group_lb_required_conditional"> | |
212 <conditional name="read_group_lb_conditional"> | |
213 <expand macro="read_group_auto_name_conditional"> | |
214 <expand macro="read_group_lb_required_param" /> | |
215 </expand> | |
216 </conditional> | |
217 </xml> | |
218 <xml name="read_group_cn_param"> | |
219 <param name="CN" type="text" label="Sequencing center that produced the read (CN)" /> | |
220 </xml> | |
221 <xml name="read_group_ds_param"> | |
222 <param name="DS" type="text" label="Description (DS)" /> | |
223 </xml> | |
224 <xml name="read_group_dt_param"> | |
225 <param name="DT" type="text" label="Date that run was produced (DT)" help="ISO8601 format date or date/time, like YYYY-MM-DD" /> | |
226 </xml> | |
227 <xml name="read_group_fo_param"> | |
228 <param name="FO" type="text" optional="true" label="Flow order (FO)" help="The array of nucleotide bases that correspond to the nucleotides used for each flow of each read. Multi-base flows are encoded in IUPAC format, and non-nucleotide flows by various other characters. Format: /\*|[ACMGRSVTWYHKDBN]+/"> | |
229 <validator type="regex" message="Invalid flow order">\*|[ACMGRSVTWYHKDBN]+$</validator> | |
230 </param> | |
231 </xml> | |
232 <xml name="read_group_ks_param"> | |
233 <param name="KS" type="text" label="The array of nucleotide bases that correspond to the key sequence of each read (KS)" /> | |
234 </xml> | |
235 <xml name="read_group_pg_param"> | |
236 <param name="PG" type="text" label="Programs used for processing the read group (PG)" /> | |
237 </xml> | |
238 <xml name="read_group_pi_param"> | |
239 <param name="PI" type="integer" optional="true" label="Predicted median insert size (PI)" /> | |
240 </xml> | |
241 <xml name="read_group_pu_param"> | |
242 <param name="PU" type="text" label="Platform unit (PU)" help="Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" optional="True" /> | |
243 </xml> | |
244 <xml name="read_group_pu_required_param"> | |
245 <param name="PU" type="text" value="run" label="Platform unit (PU)" help="Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" optional="False" /> | |
246 </xml> | |
247 <!-- Only ID is required - all groups available --> | |
248 <xml name="read_group_inputs_spec"> | |
249 <expand macro="read_group_id_conditional" /> | |
250 <expand macro="read_group_sm_conditional" /> | |
251 <expand macro="read_group_pl_param" /> | |
252 <expand macro="read_group_lb_conditional" /> | |
253 <expand macro="read_group_cn_param" /> | |
254 <expand macro="read_group_ds_param" /> | |
255 <expand macro="read_group_dt_param" /> | |
256 <expand macro="read_group_fo_param" /> | |
257 <expand macro="read_group_ks_param" /> | |
258 <expand macro="read_group_pg_param" /> | |
259 <expand macro="read_group_pi_param" /> | |
260 <expand macro="read_group_pu_param" /> | |
261 </xml> | |
262 <!-- ID, SM, LB, PU, PL all required - not ks, pg, or fo params. --> | |
263 <xml name="read_group_inputs_picard"> | |
264 <expand macro="read_group_id_conditional" /> | |
265 <expand macro="read_group_sm_required_conditional" /> | |
266 <expand macro="read_group_lb_required_conditional" /> | |
267 <expand macro="read_group_pl_param" /> | |
268 <expand macro="read_group_pu_required_param" /> | |
269 <expand macro="read_group_cn_param" /> | |
270 <expand macro="read_group_ds_param" /> | |
271 <expand macro="read_group_pi_param" /> | |
272 <expand macro="read_group_dt_param" /> | |
273 </xml> | |
274 <xml name="read_group_conditional"> | |
275 <conditional name="rg"> | |
276 <param name="rg_selector" type="select" label="Set read groups information?" help="Specifying read group information can greatly simplify your downstream analyses by allowing combining multiple datasets."> | |
277 <option value="set">Set read groups (SAM/BAM specification)</option> | |
278 <option value="set_picard">Set read groups (Picard style)</option> | |
279 <option value="set_id_auto">Automatically assign ID</option> | |
280 <option value="do_not_set" selected="True">Do not set</option> | |
281 </param> | |
282 <when value="set_picard"> | |
283 <expand macro="read_group_inputs_picard" /> | |
284 </when> | |
285 <when value="set"> | |
286 <expand macro="read_group_inputs_spec" /> | |
287 </when> | |
288 <when value="set_id_auto"> | |
289 </when> | |
290 <when value="do_not_set"> | |
291 </when> | |
292 </conditional> | |
293 </xml> | |
294 </macros> |