comparison plink.xml @ 0:a98caf1d69ab draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/plink commit 555a851b363c015f26d6fcf1f52bcbf3420a0b3b"
author iuc
date Mon, 21 Sep 2020 10:09:22 +0000
parents
children b8e3d957c0f5
comparison
equal deleted inserted replaced
-1:000000000000 0:a98caf1d69ab
1 <tool id='plink' name='plink' version='@TOOL_VERSION@+galaxy@VERSION_SUFFIX@'>
2 <macros>
3 <token name='@TOOL_VERSION@'>1.9.b618</token>
4 <token name='@VERSION_SUFFIX@'>0</token>
5 <xml name='template_sanitizer'>
6 <sanitizer>
7 <valid initial='default'>
8 <add value='#' />
9 <add value='@' />
10 <add value='$'/>
11 <add value='['/>
12 <add value=']'/>
13 <add value='\'/>
14 <remove value='&#34;'/>
15 <remove value='&#39;'/>
16 </valid>
17 </sanitizer>
18 </xml>
19 <xml name='chr_sanitizer'>
20 <sanitizer>
21 <valid initial='string.digits'>
22 <add value='X' />
23 <add value='Y' />
24 <add value=' ' />
25 </valid>
26 </sanitizer>
27 </xml>
28 <xml name='snp_sanitizer'>
29 <sanitizer>
30 <valid initial='string.ascii_letters + string.digits'/>
31 </sanitizer>
32 </xml>
33 <xml name='snp_space_sanitizer'>
34 <sanitizer>
35 <valid initial='string.ascii_letters + string.digits'>
36 <add value=' '/>
37 </valid>
38 </sanitizer>
39 </xml>
40 </macros>
41 <requirements>
42 <requirement type='package' version='1.90b6.18'>plink</requirement>
43 </requirements>
44 <command detect_errors='exit_code'><![CDATA[
45
46 ## Create Plink folder for any inputs
47 mkdir ./plink_output
48 && mkdir ./plink_input
49 #if $inputs.inputs.filetype == 'bfile':
50 && ln -s '$inputs.inputs.bed' plink_input/plink_input.bed
51 && ln -s '$inputs.inputs.bim' plink_input/plink_input.bim
52 && ln -s '$inputs.inputs.fam' plink_input/plink_input.fam
53 #elif $inputs.inputs.filetype == 'vcf':
54 #if $inputs.inputs.input.is_of_type('vcf'):
55 && plink --vcf '$inputs.inputs.input'
56 #else:
57 && plink --bcf '$inputs.inputs.input'
58 #end if
59 --out plink_input/plink_input
60 #end if
61
62 ## If bmerge is set, create folder for merged files
63 #if $functions.func == 'data_manage':
64 #if $functions.bmerge.set == 'Yes':
65 && mkdir bmerge_files
66 && ln -s '$functions.bmerge.bed' bmerge_files/bmerge_input.bed
67 && ln -s '$functions.bmerge.bim' bmerge_files/bmerge_input.bim
68 && ln -s '$functions.bmerge.fam' bmerge_files/bmerge_input.fam
69 #end if
70 #end if
71
72 ## Plink commands by section
73
74 && plink --bfile plink_input/plink_input
75 #if $inputs.covar_input:
76 --covar '$inputs.covar_input'
77 #end if
78 #if $inputs.pheno:
79 --pheno $inputs.pheno
80 #end if
81 #if $functions.func == 'filtering':
82 ##ID list functions
83 #if $functions.id_list.func == 'keep':
84 --keep '$functions.id_list.file'
85 #elif $functions.id_list.func == 'keep-fam':
86 --keep-fam '$functions.id_list.file'
87 #elif $functions.id_list.func == 'remove':
88 --remove '$functions.id_list.file'
89 #elif $functions.id_list.func == 'remove-fam':
90 --remove-fam '$functions.id_list.file'
91 #end if
92
93 ##Extraction
94 #if $functions.extraction.ex_func == 'extract':
95 --extract $functions.extraction.range $functions.extraction.file
96 #elif $functions.extraction.ex_func == 'exclude':
97 --exclude $functions.extraction.range $functions.extraction.file
98 #end if
99
100 ##Chromosome-specificity
101 #if $functions.chromosome:
102 --chr $functions.chromosome
103 #end if
104
105 #if $functions.excluded_chromosome:
106 --not-chr $functions.excluded_chromosome
107 #end if
108
109 $functions.extra_chromosomes
110
111 #if $functions.autosome != 'none'
112 $functions.autosome
113 #end if
114
115 ##SNP specificity
116 #if $functions.snps_exclusives != 'No':
117 --snps-only
118 #if $functions.snps_exclusives == 'acgt':
119 'just-acgt'
120 #end if
121 #end if
122
123 ##Variant windows
124 #if $functions.ranges.single_multi == 'single':
125 #if $functions.ranges.window.type == 'variant':
126 #if $functions.ranges.window.from:
127 --from $functions.ranges.window.from
128 #end if
129 #if $functions.ranges.window.to:
130 --to $functions.ranges.window.to
131 #end if
132 #elif $functions.ranges.window.type == 'window':
133 #if $functions.ranges.window.snp:
134 --snp $functions.ranges.window.snp
135 #end if
136 #if $functions.ranges.window.exclude_snp:
137 --exclude-snp $functions.ranges.window.exclude_snp
138 #end if
139 #if $functions.ranges.window.window:
140 --window $functions.ranges.window.window
141 #end if
142 #else:
143 #if $functions.ranges.window.from_bp:
144 --from-bp $functions.ranges.window.from_bp
145 #end if
146 #if $functions.ranges.window.to_bp:
147 --to-bp $functions.ranges.window.to_bp
148 #end if
149 #end if
150 #elif $functions.ranges.single_multi == 'multi':
151 $functions.ranges.force_intersect
152 #if $functions.ranges.snps:
153 --snps $functions.ranges.snps
154 #end if
155 #if $functions.ranges.exclude_snps:
156 --exclude-snps $functions.ranges.exclude_snps
157 #end if
158 #end if
159
160 ##Thinning
161 #if $functions.thinning.thinning == 'Yes':
162 #if $functions.thinning.thin:
163 --thin $functions.thinning.thin
164 #end if
165 #if $functions.thinning.thin_count:
166 --thin-count $functions.thinning.thin_count
167 #end if
168 #if $functions.thinning.bp_space:
169 --bp-space $functions.thinning.bp_space
170 #end if
171 #if $functions.thinning.thin_indiv:
172 --thin-indiv $functions.thinning.thin_indiv
173 #end if
174 #if $functions.thinning.thin_indiv_count:
175 --thin-indiv-count $functions.thinning.thin_indiv_count
176 #end if
177 #end if
178
179 ##Pheno/covariate
180 ###########
181
182 ###########
183
184 ##Missing genotype rates
185 #if $functions.geno_rates.geno:
186 --geno $functions.geno_rates.geno
187 #end if
188 #if $functions.geno_rates.mind:
189 --mind $functions.geno_rates.mind
190 #end if
191
192 ##Allele Frequencies
193 #if $functions.allele_freq.maf:
194 --maf $functions.allele_freq.maf
195 #end if
196 #if $functions.allele_freq.max_maf:
197 --max-maf $functions.allele_freq.max_maf
198 #end if
199 #if $functions.allele_freq.mac:
200 --mac $functions.allele_freq.mac
201 #end if
202 #if $functions.allele_freq.max_mac:
203 --max-mac $functions.allele_freq.max_mac
204 #end if
205
206 ## Hardy-Weinberg
207 #if $functions.hwe.hwe == 'Yes':
208 --hwe $functions.hwe.hwe_val
209 #for $type in $functions.hwe.modifiers:
210 $type
211 #end for
212 #end if
213
214 ##Sex and Founder filter
215 #if $functions.sex_founder_filter.filter == 'Yes'
216 $functions.sex_founder_filter.sex_select
217 $functions.sex_founder_filter.no_sex_select
218 $functions.sex_founder_filter.nonfounders
219 #end if
220
221 #elif $functions.func == 'data_manage':
222
223 #if $functions.bmerge.set == 'Yes':
224 --bmerge bmerge_files/bmerge_input
225 #end if
226
227 #if $functions.template:
228 --set-missing-var-ids $functions.template
229 #end if
230
231 $functions.recode
232
233 #if $functions.flip:
234 --flip $functions.flip
235 #end if
236
237 #if $functions.length:
238 --new-id-max-allele-len $functions.length
239 #end if
240
241 #if $functions.update_cols.set == 'update_map':
242 --update-map $functions.update_cols.input $functions.update_cols.col_num $functions.update_cols.old_col $functions.update_cols.skip
243 #elif $functions.update_cols.set == 'update_name':
244 --update-name $functions.update_cols.input $functions.update_cols.col_num $functions.update_cols.var_col $functions.update_cols.skip
245 #end if
246 #if $functions.ref_allele.set == 'yes':
247 --reference-allele $functions.ref_allele.file $functions.ref_allele.column $functions.ref_allele.var_id $functions.ref_allele.skip
248 #end if
249 #if $functions.a2_allele.set == 'yes':
250 --a2-allele $functions.a2_allele.file $functions.a2_allele.column $functions.a2_allele.var_id $functions.a2_allele.skip
251 #end if
252 #elif $functions.func == 'stats':
253 $functions.freq
254 $functions.hardy
255 $functions.missing
256 $functions.het
257 #if $functions.sex.sex_stats:
258 $functions.sex.sex_stats
259 #if $functions.sex.mode:
260 $functions.sex.mode.mode
261 #if $functions.sex.mode.mode == 'ycount'
262 $functions.sex.mode.female_max
263 $functions.sex.mode.male_min
264 $functions.sex.mode.female_max_obvs
265 $functions.sex.mode.male_min_obvs
266 #elif $functions.sex.mode.mode == 'y-only'
267 $functions.sex.mode.female_max_obvs
268 $functions.sex.mode.male_min_obvs
269 #else:
270 $functions.sex.mode.female_max
271 $functions.sex.mode.male_min
272 #end if
273 #end if
274 #end if
275
276
277 #elif $functions.func == 'link':
278 #if $functions.set_indep.choice == 'Yes':
279 --indep-pairwise $functions.set_indep.window $functions.set_indep.step $functions.set_indep.r2
280 #end if
281 ## #elif $functions.func == 'pair_compare':
282 ##
283 ## #elif $functions.func == 'dist_sim':
284 ##
285 #elif $functions.func == 'stratification':
286 #if $functions.read_genome:
287 --read-genome $functions.read_genome
288 #end if
289 #if $functions.cluster.cluster == 'Yes':
290 --cluster
291 #for $type in $functions.cluster.modifiers
292 $type
293 #end for
294 #if $functions.cluster.mds.mds_scaling == 'Yes':
295 --mds-plot $functions.cluster.mds.dimensions
296 #for $type in $functions.cluster.mds.modifiers
297 $type
298 #end for
299 #end if
300 #end if
301
302 #elif $functions.func == 'association':
303 #if $functions.assoc.assoc == 'Yes':
304 --assoc
305 #if $functions.assoc.perm.perm == 'perm':
306 perm
307 #elif $functions.assoc.perm.perm == 'mperm':
308 mperm='$functions.assoc.perm.value'
309 #end if
310 $functions.assoc.genedrop
311 $functions.assoc.perm_count
312 $functions.assoc.fisher
313 $functions.assoc.count
314 #end if
315 #if $functions.adjust.adjust == 'Yes':
316 --adjust
317 #for $type in $functions.adjust.tests:
318 $type
319 #end for
320 #end if
321 ## #if $functions.linear.linear == 'Yes':
322 ## --linear
323 ## #if $functions.linear.perm == 'perm':
324 ## perm
325 ## #elif $functions.linear.perm == 'mperm':
326 ## mperm='$functions.linear.perm.value'
327 ## #end if
328 ## $functions.linear.genedrop
329 ## $functions.linear.perm_count
330 ## $functions.linear.dominance
331 ## $functions.linear.hide_covar
332 ## $functions.linear.sex_covar
333 ## $functions.linear.interaction
334 ## $functions.linear.beta
335 ## $functions.linear.standard_beta
336 ## $functions.linear.intercept
337 ## #end if
338 #if $functions.logistic.logistic == 'Yes':
339 --logistic
340 #if $functions.logistic.perm.perm == 'perm':
341 perm
342 #elif $functions.logistic.perm.perm == 'mperm':
343 mperm='$functions.logistic.perm.value'
344 #end if
345 $functions.logistic.genedrop
346 $functions.logistic.perm_count
347 $functions.logistic.dominance
348 $functions.logistic.hide_covar
349 $functions.logistic.sex_covar
350 $functions.logistic.interaction
351 $functions.logistic.beta
352 $functions.logistic.intercept
353 #end if
354
355 #elif $functions.func == 'ibd':
356 #if $functions.genome.output_genome:
357 --genome
358 #for $type in $functions.genome.modifiers
359 $type
360 #end for
361 #if $functions.genome.min:
362 --min $functions.genome.min
363 #end if
364 #if $functions.genome.max:
365 --max $functions.genome.max
366 #end if
367 #if $functions.genome.ppc:
368 --ppc-gap $functions.genome.ppc
369 #end if
370 #end if
371
372 ## #elif $functions.func == 'scoring':
373 ##
374 ## #else:
375 ## --rerun $functions.logfile
376 ##
377 #end if
378
379 --make-bed
380 --out plink_output/plink_output
381 ]]></command>
382 <inputs>
383 <section name='inputs' title='Data inputs' expanded='true'>
384 <conditional name='inputs'>
385 <param name='filetype' type='select' label='Main input data type'>
386 <option value='bfile'>plink file</option>
387 <option value='vcf'>VCF input file</option>
388 </param>
389 <when value='bfile'>
390 <param format='binary' name='bed' type='data' label='plink bed file'/>
391 <param format='tabular,tsv' name='bim' type='data' label='plink bim file'/>
392 <param format='txt' name='fam' type='data' label='plink fam file'/>
393 </when>
394 <when value='vcf'>
395 <param name='input' format='vcf,bcf' type='data' label='VCF/BCF Input file'/>
396 </when>
397 </conditional>
398 <param name='pheno' type='data' format='txt,tabular' label='Phenotype file' help='Read phenotype values from the 3rd column of the specified space- or tab-delimited file, instead of the .fam or .ped file.' optional='true'/>
399 <param name='covar_input' type='data' format='tabular,tsv' label='Input covariate file' optional='true'/>
400 </section>
401 <conditional name='functions'>
402 <param name='func' type='select' label='Plink functions'>
403 <option value='filtering'>Filtering</option>
404 <option value='data_manage'>Data Management</option>
405 <option value='stats'>Basic statistics</option>
406 <option value='link'>Linkage disequalibrium</option>
407 <option value='stratification'>Population stratification</option>
408 <option value='association'>Association analysis</option>
409 <option value='ibd'>Identity-by-descent</option>
410 <!-- <option value='rerun'>Rerun</option> -->
411 </param>
412 <when value='filtering'>
413 <conditional name='id_list'>
414 <param name='func' type='select' label='ID list functions'>
415 <option value='none'/>
416 <option value='keep'/>
417 <option value='keep-fam'/>
418 <option value='remove'/>
419 <option value='remove-fam'/>
420 </param>
421 <when value='none'/>
422 <when value='keep'>
423 <param format='tabular,tsv' name='file' type='data' label='Keep file.' help='Accepts one or more space/tab-delimited text files with sample IDs, and removes all unlisted samples from the current analysis;'/>
424 </when>
425 <when value='keep-fam'>
426 <param format='tabular,tsv' name='file' type='data' label='Keep-fam file' help='Accepts text files with family IDs in the first column, and keeps entire families.'/>
427 </when>
428 <when value='remove'>
429 <param format='tabular,tsv' name='file' type='data' label='Remove file' help='Accepts one or more space/tab-delimited text files with sample IDs, and removes all listed samples from the current analysis'/>
430 </when>
431 <when value='remove-fam'>
432 <param format='tabular,tsv' name='file' type='data' label='Remove-fam file' help='Acceptz text files with family IDs in the first column, and removes entire families.'/>
433 </when>
434 </conditional>
435 <conditional name='extraction'>
436 <param name='ex_func' type='select' label='ID extraction functions'>
437 <option value='none'/>
438 <option value='extract'/>
439 <option value='exclude'/>
440 </param>
441 <when value='none'/>
442 <when value='extract'>
443 <param format='txt' name='file' type='data' label='Extract' help='Accepts one or more text file(s) with variant IDs , and removes all unlisted variants from the current analysis'/>
444 <param type='boolean' name='range' truevalue='range' falsevalue='' help='Input file is input in set range format.'/>
445 </when>
446 <when value='exclude'>
447 <param format='txt' name='file' type='data' label='Exclude' help='Accepts one or more text file(s) with variant IDs , and removes all listed variants from the current analysis'/>
448 <param type='boolean' name='range' truevalue='range' falsevalue='' help='Input file is input in set range format.'/>
449 </when>
450 </conditional>
451 <!-- <param name='border' type='integer' label='Bed border bp' help='Extends all the intervals in an input BED file (for e.g. extract bed0) by the given number of base-pairs on both sides.' optional='true'/> -->
452 <!-- <conditional name='col-cond'>
453 <param name='func' type='select' label='ID list functions'>
454 <option value='none'/>
455 <option value='extract-col-cond'/>
456 <option value='extract-col-cond-match'/>
457 <option value='extract-col-cond-mismatch'/>
458 <option value='extract-col-cond-substr'/>
459 <option value='extract-col-cond-min'/>
460 <option value='extract-col-cond-max'/>
461 </param>
462 <when value='none'/>
463 <when value='extract-col-cond'>
464 </when>
465 <when value='extract-col-cond-match'>
466 </when>
467 <when value='extract-col-cond-mismatch'>
468 </when>
469 <when value='extract-col-cond-substr'>
470 </when>
471 <when value='extract-col-cond-min'>
472 </when>
473 <when value='extract-col-cond-max'>
474 </when>
475 </conditional> -->
476 <param name='chromosome' type='text' label='Chromosome(s)' help='Excludes all variants not on the listed chromosome(s). Can be listed as single chromsome, a hyphenated range, or comma separated list.' optional='true'>
477 <expand macro='chr_sanitizer'/>
478 </param>
479 <param name='excluded_chromosome' type='text' label='Exclude Chromosome(s)' help='Excludes all variants on the listed chromosome(s). Can be listed as single chromsome, a hyphenated range, or comma separated list.' optional='true'>
480 <expand macro='chr_sanitizer'/>
481 </param>
482 <param name='extra_chromosomes' type='boolean' truevalue='--aec' falsevalue='' checked='false' label='Allow extra chromosomes' help='Allows specified extra chromosomes/scaffolds not normally listed. ex. chr1_gl000191_random.'/>
483 <param name='autosome' type='select' label='Autosome/unplaced exclusion'>
484 <option value='none'>None</option>
485 <option value='--autosome'>Exclude all unplaced and non-autosomal variants</option>
486 <option value='--autosome-par'>Excludes all unplaced and non-autosomal variants, but keep XY/PAR1/PAR2. Can be combined with exclude-chromosmes.</option>
487 </param>
488 <param name='snps_exclusives' type='select' label='SNP exclusive'>
489 <option value='No'>No</option>
490 <option value='--snps-only'>Only return SNPs</option>
491 <option value='acgt'>Return SNPs, excluding any other than {'A', 'C', 'G', 'T', 'a', 'c', 'g', 't', missing}</option>
492 </param>
493 <conditional name='ranges'>
494 <param name='single_multi' type='select' label='Single or multiple variant-based range window?'>
495 <option value=''>No range specified</option>
496 <option value='single'>Single variants</option>
497 <option value='multi'>Multiple variants</option>
498 </param>
499 <when value=''/>
500 <when value='single'>
501 <conditional name='window'>
502 <param name='type' type='select' label='Specify range for variants'>
503 <option value='variant'>Around/between specific variant(s)</option>
504 <option value='window'>Around a specific variant</option>
505 <option value='range'>Within a specific area (Must also specify a single chromosome in above input)</option>
506 </param>
507 <when value='variant'>
508 <param name='from' type='text' label='From' help='Variant ID. Excludes all variants on different chromosomes than the named variant, as well as those with smaller base-pair position values. If they are used together but the --from variant is after the --to variant, they are automatically swapped.' optional='true'/>
509 <param name='to' type='text' label='To' help='Variant ID. Excludes all variants on different chromosomes than the named variant, as well as those with larger base-pair position values. If they are used together but the --from variant is after the --to variant, they are automatically swapped.' optional='true'/>
510 </when>
511 <when value='window'>
512 <param name='snp' type='text' label='SNP variant id to include' help='Use this OR SNP variant to exclude' optional='true'>
513 <expand macro='snp_sanitizer'/>
514 </param>
515 <param name='exclude_snp' type='text' label='SNP variant id to exclude' help='Use this OR SNP variant to include' optional='true'>
516 <expand macro='snp_sanitizer'/>
517 </param>
518 <param name='window' type='integer' label='Window' help='All variants with physical position no more than half the specified kb distance (decimal permitted) from the named variant are loaded as well' optional='true'/>
519 </when>
520 <when value='range'>
521 <param name='from_bp' type='integer' label='from-bp' help='These flags let you use physical positions to specify a variant range to load. Must also have specified a chromosome in above settings.' optional='true'/>
522 <param name='to_bp' type='integer' label='to-bp' help='These flags let you use physical positions to specify a variant range to load. Must also have specified a chromosome in above settings.' optional='true'/>
523 </when>
524 </conditional>
525 </when>
526 <when value='multi'>
527 <param name='force_intersect' type='boolean' truevalue='--force-intersect' falsevalue='' label='Force intersect' help='To reduce the potential for confusion, PLINK 2 normally errors out when multiple variant-inclusion filters
528 (--extract[-intersect], --extract-col-cond, --from/--to, --from-bp/--to-bp, --snp, --snps) are specified, since it may not be obvious whether the intersection or union will be taken.
529 --force-intersect allows the run to proceed; the set intersection will be taken.'/>
530 <param name='snps' type='text' label='List of SNP variant ids to include' optional='true'>
531 <expand macro='snp_space_sanitizer'/>
532 </param>
533 <param name='exclude_snps' type='text' label='List of SNP variant ids to exclude' optional='true'>
534 <expand macro='snp_space_sanitizer'/>
535 </param>
536 </when>
537 </conditional>
538 <conditional name='thinning'>
539 <param name='thinning' type='select' label='Arbitrary thinning'>
540 <option value='No'/>
541 <option value='Yes'/>
542 </param>
543 <when value='No'/>
544 <when value='Yes'>
545 <param name='thin' type='float' label='Thin' min='0' max='1.0' help='Removes variants at random by retaining each variant with probability p' optional='true'/>
546 <param name='thin_count' type='integer' label='Thin Count' help='Removes variants at random until only n remain' min='1' optional='true'/>
547 <param name='bp_space' type='integer' label='BP space' help='Excludes one variant from each pair closer than the given bp count' optional='true'/>
548 <param name='thin_indiv' type='float' label='Thin Individual' min='0' max='1.0' help='Removes samples at random by retaining each sample with probability p' optional='true'/>
549 <param name='thin_indiv_count' type='integer' label='Thin Individual count' min='1' help='Removes samples at random until only n remain.' optional='true'/>
550 </when>
551 </conditional>
552 <!-- <conditional name='pheno_cov_based'>
553 <param name='pheno_cov' type='select' label='Phenotype/Covariate-based'>
554 <option value='No' selected='true'/>
555 <option value='phenotype'/>
556 <option value='Covariate'/>
557 </param>
558 <when value='No'/>
559 <when value='phenotype'> -->
560 <!-- keep-if <phenotype/covariate name> <operator> <value>
561 remove-if <phenotype/covariate name> <operator> <value>
562 require-pheno [phenotype name(s)...]
563 keep-cats <filename>
564 keep-cat-names <name(s)...>
565 remove-cats <filename>
566 remove-cat-names <name(s)...>
567 keep-cat-pheno <phenotype/covariate name>
568 remove-cat-pheno <phenotype/covariate name>
569 </when>
570 <when value='Covariate'>
571 keep-if <phenotype/covariate name> <operator> <value>
572 remove-if <phenotype/covariate name> <operator> <value>
573 require-covar [covariate name(s)...]
574 keep-cats <filename>
575 keep-cat-names <name(s)...>
576 remove-cats <filename>
577 remove-cat-names <name(s)...>
578 </when>
579 </conditional> -->
580 <section name='geno_rates' title='Missing Genotype Rates' expanded='true'>
581 <param name='geno' type='float' min='0' max='1' label='Set Geno' help='filters out all variants with missing call rates exceeding the provided value (default 0.1) to be removed' optional='true'/>
582 <param name='mind' type='float' min='0' max='1' label='Set Mind' help='filters out all samples with missing call rates exceeding the provided value (default 0.1) to be removed' optional='true'/>
583 </section>
584 <section name='allele_freq' title='Allele Frequencies' expanded='true'>
585 <param name='maf' type='float' label='Minimum allele frequency' min='0' max='1.0' help='Filters out all variants with allele frequency below the provided threshold' optional='true'/>
586 <param name='max_maf' type='float' label='Maximum allele frequency' min='0' max='1.0' help='Filters out all variants with allele frequency above the provided threshold' optional='true'/>
587 <param name='mac' type='integer' label='Minimum allele count' min='1' help='Filters out all variants with allele counts below the provided threshold' optional='true'/>
588 <param name='max_mac' type='integer' label='Maximum allele count' min='0' help='filters out all variants with allele counts above the provided threshold' optional='true'/>
589 </section>
590 <conditional name='hwe'>
591 <param name='hwe' type='select' help='Set Hardy-Weinberg equilibrium tests'>
592 <option value='No'/>
593 <option value='Yes'/>
594 </param>
595 <when value='No'/>
596 <when value='Yes'>
597 <param name='hwe_val' type='float' label='Hardy-Weinberg Equilibrium' help='Filters out all variants which have Hardy-Weinberg equilibrium exact test
598 p-value below the provided threshold. It is recommended setting a low threshold—serious genotyping errors often yield extreme p-values like 1e-501 which
599 are detected by any reasonable configuration of this test, while genuine SNP-trait associations can be expected to deviate slightly from Hardy-Weinberg
600 equilibrium (so it is dangerous to choose a threshold that filters out too many variants).' value='1e-50' min='0' max='1'/>
601 <param name='modifiers' type='select' label='Test modifiers' multiple='true' display='checkboxes' optional='true'>
602 <option value='midp'>Apply the mid-p adjustment described in Graffelman J, Moreno V (2013) The mid p-value in exact tests for Hardy-Weinberg equilibrium</option>
603 <option value='include-nonctrl'>Don't ignore cases and missing phenotypes'</option>
604 </param>
605 </when>
606 </conditional>
607 <conditional name='sex_founder_filter'>
608 <param name='filter' type='select' label='Filter on sex and/or founders'>
609 <option value='No'/>
610 <option value='Yes'/>
611 </param>
612 <when value='No'/>
613 <when value='Yes'>
614 <param name='sex_select' type='select' label='Sex select' help='Filter by phenotypes, experiment, and founder state.'>
615 <option value='--filter-cases'>Only include cases</option>
616 <option value='--filter-controls'>Only include controls</option>
617 <option value='--filter-males'>Only include males</option>
618 <option value='--filter-females'>Only include females</option>
619 <option value='--filter-founders'>Exclude all samples with at least one known parental ID</option>
620 <option value='--filter-nonfounders'>Only include samples with at least one known parental ID</option>
621 </param>
622 <param name='no_sex_select' type='select' label='No sex settings' optional='true' help='How to deal with ambiguous sex phenotypes'>
623 <option value='--allow-no-sex'>Prevent samples with ambiguous sex frim having their phenotypes set to missing when analysis commands are run</option>
624 <option value='--must-have-sex'>Force phenotypes of ambiguous-sex samples to missing in output</option>
625 </param>
626 <param name='nonfounders' type='boolean' label='Nonfouders' truevalue='--nonfounders' falsevalue='' checked='false' help='Include nonfounders in --freq[x] or --maf/--max-maf/--hwe calculations'/>
627 </when>
628 </conditional>
629 </when>
630 <when value='data_manage'>
631 <conditional name='bmerge'>
632 <param name='set' type='select' label='Merge plink tilesets'>
633 <option value='No'/>
634 <option value='Yes'/>
635 </param>
636 <when value='No'/>
637 <when value='Yes'>
638 <param format='binary' name='bed' type='data' label='plink bed file'/>
639 <param format='tabular,tsv' name='bim' type='data' label='plink bim file'/>
640 <param format='tabular,tsv' name='fam' type='data' label='plink fam file'/>
641 </when>
642 </conditional>
643 <param name='recode' type='boolean' label='Recode' truevalue='--recode' falsevalue='' checked='false' help='Create a new text fileset, after applying sample/variant filters and other operations'/>
644 <param format='tsv,tabular' name='flip' type='data' label='Flip DNA strand for SNPs' help='Given a file containing a list of SNPs with A/C/G/T alleles, --flip swaps A↔T and C↔G.' optional='true'/>
645 <param name='template' type='text' label='Update Variant Info: Template String' help='Replaces missing IDs. The parameter taken by these flags is a special template string, with a @ where the chromosome code should go, and a # where the base-pair position belongs.'>
646 <expand macro='template_sanitizer'/>
647 </param>
648 <param name='length' type='integer' label='Max allele length' help='Length threshold to rename alleles. Recommended default is 23' optional='true'/>
649 <conditional name='update_cols'>
650 <param name='set' type='select' label='Update variant columns'>
651 <option value='No'>No</option>
652 <option value='update_map'>update-map</option>
653 <option value='update_name'>update-name</option>
654 </param>
655 <when value='No'/>
656 <when value='update_map'>
657 <param name='input' type='data' format='tabular,tsv' help='By default, the new value is read from column 2 and the (old) variant ID from column 1, but you can adjust these positions with the second and third parameters.'/>
658 <param name='col_num' type='integer' min='0' label='New ID column number' value='2'/>
659 <param name='old_col' type='integer' min='0' label='Old ID column' value='1'/>
660 <param name='skip' type='text' label='Skip' optional='true' help='Either a nonnegative integer, in which case it indicates the number of lines to skip at the top of the file, or a single nonnumeric character, which causes each line with that leading character to be skipped.'/>
661 </when>
662 <when value='update_name'>
663 <param name='input' type='data' format='tabular,tsv' help='By default, the new value is read from column 2 and the (old) variant ID from column 1, but you can adjust these positions with the second and third parameters.'/>
664 <param name='col_num' type='integer' min='0' label='BP column number' value='2'/>
665 <param name='var_col' type='integer' min='0' label='Variant ID column' value='1'/>
666 <param name='skip' type='text' label='Skip' optional='true' help='Either a nonnegative integer, in which case it indicates the number of lines to skip at the top of the file, or a single nonnumeric character, which causes each line with that leading character to be skipped.'/>
667 </when>
668 </conditional>
669 <conditional name='ref_allele'>
670 <param name='set' type='select' label='Set REF alleles' help='These cannot be used with any other commands.'>
671 <option value='no'>No</option>
672 <option value='yes'>Yes</option>
673 </param>
674 <when value='no'/>
675 <when value='yes'>
676 <param name='file' type='data' format='vcf' label='Set all alleles specified in the file to REF'/>
677 <param name='column' type='integer' optional='true' min='1' label='Reference column number'/>
678 <param name='var_id' type='integer' optional='true' min='1' label='Variant id column in file'/>
679 <param name='skip' label='Skip' type='text' help='Either a nonnegative integer, in which case it indicates the number of lines to skip at the top of the file, or a single nonnumeric character, which causes each line with that leading character to be skipped.'/>
680 </when>
681 </conditional>
682 <conditional name='a2_allele'>
683 <param name='set' type='select' label='Set a2 alleles' help='These cannot be used with any other commands.'>
684 <option value='no'>No</option>
685 <option value='yes'>Yes</option>
686 </param>
687 <when value='no'/>
688 <when value='yes'>
689 <param name='file' type='data' format='vcf' label='Set all alleles specified in the file to first ALT allele'/>
690 <param name='column' type='integer' value='4' optional='true' label='Alt column number'/>
691 <param name='var_id' type='integer' value='3' optional='true' label='Variant id column in file'/>
692 <param name='skip' label='Skip' type='boolean' truevalue='skip' falsevalue='' checked='false' help='Either a nonnegative integer, in which case it indicates the number of lines to skip at the top of the file, or a single nonnumeric character, which causes each line with that leading character to be skipped.'/>
693 </when>
694 </conditional>
695 </when>
696 <when value='stats'>
697 <param name='freq' label='Return allele frequency file' type='boolean' truevalue='--freq' falsevalue=''/>
698 <param name='hardy' label='Return Hardy-Weinberg statistics file' type='boolean' truevalue='--hardy' falsevalue='' help='Writes out writes autosomal Hardy-Weinberg equilibrium exact test statistics'/>
699 <param name='missing' label='Missing Data' type='boolean' truevalue='--missing' falsevalue='' help='produces sample-based and variant-based missing data reports'/>
700 <param name='het' label='Inbreeding' type='boolean' truevalue='--het' falsevalue='' help='Compute observed and expected homozygous/heterozygous genotype counts for each sample, and reports method-of-moments F coefficient estimates'/>
701 <conditional name='sex'>
702 <param name='sex_stats' label='Sex imputation' type='select'>
703 <option value=''>No</option>
704 <option value='--check-sex'>Compare sex assignments in input dataset with those imputed from X chromosome inbreeding coefficients</option>
705 <option value='--impute-sex'> Changes sex assignments to the imputed values. Cannot be set with any other flags.</option>
706 </param>
707 <when value=''/>
708 <when value='--check-sex'>
709 <conditional name='mode'>
710 <param name='mode' type='select' label='Mode select'>
711 <option value=''>Base</option>
712 <option value='ycount'>ycount</option>
713 <option value='y-only'>y-only</option>
714 </param>
715 <when value=''>
716 <param name='female_max' type='float' label='Female max proportion' min='0' max='1' optional='true'/>
717 <param name='male_min' type='float' label='Male min proportion' min='0' max='1' optional='true'/>
718 </when>
719 <when value='ycount'>
720 <param name='female_max' type='float' label='Female max proportion' min='0' max='1' optional='true'/>
721 <param name='male_min' type='float' label='Male min proportion' min='0' max='1' optional='true'/>
722 <param name='female_max_obvs' type='integer' label='Female max count' min='0' optional='true'/>
723 <param name='male_min_obvs' type='integer' label='Male min count' min='0' optional='true'/>
724 </when>
725 <when value='y-only'>
726 <param name='female_max_obvs' type='integer' label='Female max count' min='0' optional='true'/>
727 <param name='male_min_obvs' type='integer' label='Male mincountn' min='0' optional='true'/>
728 </when>
729 </conditional>
730 </when>
731 <when value='--impute-sex'>
732 <conditional name='mode'>
733 <param name='mode' type='select' label='Mode select'>
734 <option value=''>Base</option>
735 <option value='ycount'>ycount</option>
736 <option value='y-only'>y-only</option>
737 </param>
738 <when value=''>
739 <param name='female_max' type='float' label='Female max proportion' min='0' max='1' optional='true'/>
740 <param name='male_min' type='float' label='Male min proportion' min='0' max='1' optional='true'/>
741 </when>
742 <when value='ycount'>
743 <param name='female_max' type='float' label='Female max proportion' min='0' max='1' optional='true'/>
744 <param name='male_min' type='float' label='Male min proportion' min='0' max='1' optional='true'/>
745 <param name='female_max_obvs' type='integer' label='Female max count' min='0' optional='true'/>
746 <param name='male_min_obvs' type='integer' label='Male min count' min='0' optional='true'/>
747 </when>
748 <when value='y-only'>
749 <param name='female_max_obvs' type='integer' label='Female max count' min='0' optional='true'/>
750 <param name='male_min_obvs' type='integer' label='Male min count' min='0' optional='true'/>
751 </when>
752 </conditional>
753 </when>
754 </conditional>
755 </when>
756 <when value='link'>
757 <conditional name='set_indep'>
758 <param name='choice' label='Variant pruning' type='select' help='Since two-variant r2 only makes sense for biallelic variants, these collapse multiallelic variants down to most common allele vs. the rest.'>
759 <option value='Yes'>Yes</option>
760 <option value='No'>No</option>
761 </param>
762 <when value='No'/>
763 <when value='Yes'>
764 <param name='window' type='integer' label='Window size in bp' value='50' help='Window size'/>
765 <param name='step' type='integer' label='Step size (variant ct)' value='5'/>
766 <param name='r2' type='float' label='Unphased Hardcall r^2 Threshold' value='0.2' />
767 </when>
768 </conditional>
769
770 </when>
771 <when value='stratification'>
772 <param name='read_genome' label='Reusing an IBS/IBD calculation' format='tabular,tsv' type='data' optional='true'/>
773 <conditional name='cluster'>
774 <param name='cluster' type='select' help='Use IBS values calculated via --genome to perform complete linkage clustering'>
775 <option value='No'/>
776 <option value='Yes'/>
777 </param>
778 <when value='No'/>
779 <when value='Yes'>
780 <param name='modifiers' type='select' label='Cluster flag modifiers' multiple='true' display='checkboxes' optional='true'>
781 <option value='cc'>Prevent two all-case or two all-control clusters from being merged.</option>
782 <option value='group-avg'>By default, the distance between two clusters is defined as the maximum pairwise distance between a member of the first cluster and a member of the second cluster. Cause average pairwise distance to be used instead.</option>
783 <option value='missing'>Cause clustering to be based on identity-by-missingness</option>
784 </param>
785 <conditional name='mds'>
786 <param name='mds_scaling' type='select' help='Return a Haploview-friendly multidimensional scaling report'>
787 <option value='No'/>
788 <option value='Yes'/>
789 </param>
790 <when value='No'/>
791 <when value='Yes'>
792 <param name='dimensions' type='integer' label='Dimension count' value='10'/>
793 <param name='modifiers' type='select' label='mds-plot flag modifiers' multiple='true' display='checkboxes' optional='true'>
794 <option value='by-cluster'>Perform mds scaling on an inter-cluster distance matrix</option>
795 <option value='eigendecomp'>Request faster eigendocomposition-based algorithm, yielding slightly different results</option>
796 <option value='eigvals'>Write out top eigenvalues to separate file</option>
797 </param>
798 </when>
799 </conditional>
800 </when>
801 </conditional>
802 </when>
803 <when value='association'>
804 <conditional name='assoc'>
805 <param name='assoc' label='Perform 1df chi-square allelic test' type='select'>
806 <option value=''>No</option>
807 <option value='Yes'/>
808 </param>
809 <when value=''/>
810 <when value='Yes'>
811 <conditional name='perm'>
812 <param name='perm' type='select' help='Request an adaptive or max(T) permutation test on the additive effect.'>
813 <option value='No'>No</option>
814 <option value='perm'>Perform Monte Carlo permutation test</option>
815 <option value='mperm'>Perform a max(T) permutation test with specified number of replications</option>
816 </param>
817 <when value='No'/>
818 <when value='perm'/>
819 <when value='mperm'>
820 <param name='value' label='Replications' type='integer' min='0' value='10000'/>
821 </when>
822 </conditional>
823 <param name='genedrop' label='genedrop' type='boolean' truevalue='genedrop' falsevalue='' checked='false' help='Cause offspring genotypes to be regenerated via gene-dropping in the permutation test.'/>
824 <param name='perm_count' label='Perm-count' type='boolean' truevalue='perm-count' falsevalue='' checked='false' help='Cause the permutation test report to include permutation counts instead of frequencies.'/>
825 <param name='fisher' label='Fisher tests' type='select'>
826 <option value=''>Don't specify</option>
827 <option value='fisher'>Use fisher's exact test</option>
828 <option value='fisher-midp'>User Fisher's exact test with Lancaster's mid-p adjustment</option>
829 </param>
830 <param name='count' label='Counts' type='boolean' truevalue='counts' falsevalue='' checked='false' help='Report allele counts instead of frequencies'/>
831 </when>
832 </conditional>
833 <conditional name='adjust'>
834 <param name='adjust' label='Report basic multiple testing corrections for the raw p-values' type='select'>
835 <option value='No'/>
836 <option value='Yes'/>
837 </param>
838 <when value='No'/>
839 <when value='Yes'>
840 <param name='tests' label='Testing modifiers' type='select' multiple='true' display='checkboxes' optional='true'>
841 <option value='gc'>Use genomic-controlled p-values in the formulas</option>
842 <option value='log10'>Replace the p-values in the .adjusted file with their negative base 10 logarithms.</option>
843 <option value='qq-plot'>Add a quantile column to simplify QQ plotting.</option>
844 </param>
845 </when>
846 </conditional>
847 <!-- <conditional name='linear'>
848 <param name='linear' type='select' label='Perform linenar regression and return report'>
849 <option value='No'/>
850 <option value='Yes'/>
851 </param>
852 <when value='No'/>
853 <when value='Yes'>
854 <conditional name='perm'>
855 <param name='perm' type='select' help='Request an adaptive or max(T) permutation test on the additive effect.'>
856 <option value='No'>No</option>
857 <option value='perm'>Perform Monte Carlo permutation test</option>
858 <option value='mperm'>Perform a max(T) permutation test with specified number of replications</option>
859 </param>
860 <when value='No'/>
861 <when value='perm'/>
862 <when value='mperm'>
863 <param name='value' label='Replications' type='integer' min='0' value='10000'/>
864 </when>
865 </conditional>
866 <param name='genedrop' label='genedrop' type='boolean' truevalue='genedrop' falsevalue='' checked='false' help='Cause offspring genotypes to be regenerated via gene-dropping in the permutation test.'/>
867 <param name='perm_count' label='Perm-count' type='boolean' truevalue='perm-count' falsevalue='' checked='false' help='Cause the permutation test report to include permutation counts instead of frequencies.'/>
868 <param name='set_test' label='set_test' type='boolean' truevalue='set-test' falsevalue='' checked='false' help='Test the significance of variant sets'/>
869 <param name='dominance' label='Set dominance model' type='select'>
870 <option value=''>Don't specify</option>
871 <option value='genotypic'>Add an additive effect/dominance deviation 2df joint test (with two genotype-dependent variables in the regression, one with 0/1/2 coding and the second with 0/1/0</option>
872 <option value='hethom'>Add an additive effect/dominance deviation 2df joint test (with two genotype-dependent variables in the regression, one with 0/0/1 coding and the second with 0/1/0</option>
873 <option value='dominant'>Assume full dominance in A1 allele</option>
874 <option value='recessive'>Assume full recessiveness in A1 allele</option>
875 <option value='no-snp'>Request a regression only on the phenotype and the covariates, without reference to genomic data</option>
876 </param>
877 <param name='hide_covar' label='hide_covar' type='boolean' truevalue='hide-covar' falsevalue='' checked='false' help='Remove covariate-specific lines from the main report'/>
878 <param name='sex_covar' label='Sex as a covariate' type='select'>
879 <option value=''>Only used where specified</option>
880 <option value='sex'>By default, when at least one male and one female is present, sex (male = 1, female = 0) is automatically added as a covariate on X chromosome SNPs, and nowhere else. The 'sex' modifier causes it to be added everywhere.</option>
881 <option value='no-x-sex'>By default, when at least one male and one female is present, sex (male = 1, female = 0) is automatically added as a covariate on X chromosome SNPs, and nowhere else. The 'no-x-sex' modifier causes it to be excluded everywhere</option>
882 </param>
883 <param name='interaction' label='interaction' type='boolean' truevalue='interaction' falsevalue='' checked='false' help='Add genotype x covariate interactions to the model.'/>
884 <param name='beta' label='beta' type='boolean' truevalue='beta' falsevalue='' checked='false' help=''/>
885 <param name='standard_beta' label='standard-beta' type='boolean' truevalue='standard-beta' falsevalue='' checked='false' help=''/>
886 <param name='intercept' label='intercept' type='boolean' truevalue='intercept' falsevalue='' checked='false' help=''/>
887 </when>
888 </conditional> -->
889 <conditional name='logistic'>
890 <param name='logistic' type='select' label='Perform logistic regression and return report'>
891 <option value='No'/>
892 <option value='Yes'/>
893 </param>
894 <when value='No'/>
895 <when value='Yes'>
896 <conditional name='perm'>
897 <param name='perm' type='select' help='Request an adaptive or max(T) permutation test on the additive effect.'>
898 <option value='No'>No</option>
899 <option value='perm'>Perform Monte Carlo permutation test</option>
900 <option value='mperm'>Perform a max(T) permutation test with specified number of replications</option>
901 </param>
902 <when value='No'/>
903 <when value='perm'/>
904 <when value='mperm'>
905 <param name='value' label='Replications' type='integer' min='0' value='10000'/>
906 </when>
907 </conditional>
908 <param name='genedrop' label='genedrop' type='boolean' truevalue='genedrop' falsevalue='' checked='false' help='Cause offspring genotypes to be regenerated via gene-dropping in the permutation test.'/>
909 <param name='perm_count' label='Perm-count' type='boolean' truevalue='perm-count' falsevalue='' checked='false' help='Cause the permutation test report to include permutation counts instead of frequencies.'/>
910 <param name='dominance' label='Set dominance model' type='select'>
911 <option value=''>Don't specify</option>
912 <option value='genotypic'>Add an additive effect/dominance deviation 2df joint test (with two genotype-dependent variables in the regression, one with 0/1/2 coding and the second with 0/1/0</option>
913 <option value='hethom'>Add an additive effect/dominance deviation 2df joint test (with two genotype-dependent variables in the regression, one with 0/0/1 coding and the second with 0/1/0</option>
914 <option value='dominant'>Assume full dominance in A1 allele</option>
915 <option value='recessive'>Assume full recessiveness in A1 allele</option>
916 <option value='no-snp'>Request a regression only on the phenotype and the covariates, without reference to genomic data</option>
917 </param>
918 <param name='hide_covar' label='Hide covar' type='boolean' truevalue='hide-covar' falsevalue='' checked='false' help='Remove covariate-specific lines from the main report'/>
919 <param name='sex_covar' label='Sex as a covariate' type='select'>
920 <option value=''>Only used where specified</option>
921 <option value='sex'>By default, when at least one male and one female is present, sex (male = 1, female = 0) is automatically added as a covariate on X chromosome SNPs, and nowhere else. The 'sex' modifier causes it to be added everywhere.</option>
922 <option value='no-x-sex'>By default, when at least one male and one female is present, sex (male = 1, female = 0) is automatically added as a covariate on X chromosome SNPs, and nowhere else. The 'no-x-sex' modifier causes it to be excluded everywhere</option>
923 </param>
924 <param name='interaction' label='Interaction' type='boolean' truevalue='interaction' falsevalue='' checked='false' help='Add genotype x covariate interactions to the model.'/>
925 <param name='beta' label='Beta' type='boolean' truevalue='beta' falsevalue='' checked='false' help=''/>
926 <param name='intercept' label='Intercept' type='boolean' truevalue='intercept' falsevalue='' checked='false' help=''/>
927 </when>
928 </conditional>
929 <param name='lambda' type='float' label='Lambda value' optional='true'/>
930 </when>
931 <!-- <when value='scoring'>
932 </when> -->
933 <when value='ibd'>
934 <conditional name='genome'>
935 <param name='output_genome' type='select' help='Perform and return results of IBS/IBD computation'>
936 <option value=''>No</option>
937 <option value='Yes'/>
938 </param>
939 <when value=''/>
940 <when value='Yes'>
941 <param name='min' type='float' label='min' min='0' max='1.0' help='Minimum PI_HAT value' optional='true'/>
942 <param name='max' type='float' label='max' min='0' max='1.0' help='Maximum PI_HAT value' optional='true'/>
943 <param name='ppc' type='integer' label='PPC-gap' min='0' help='Minimum distance between informative pairs of SNPs used in the pairwise population concordance (PPC) inn kbs' value='500' optional='true'/>
944 <param name='modifiers' type='select' label='Genome flag modifiers' multiple='true' display='checkboxes' optional='true'>
945 <option value='rel-check'>Remove pairs of samples with different FIDs</option>
946 <option value='full'>Add IBS , HOMHOM and HETHET fields to output</option>
947 <option value='unbounded'>Turn off clipping due to IBD estimator</option>
948 <option value='nudge'>If PI_HAT2 greater than P(IBD=2), adjusts the final estimates to P(IBD=0) := (1-p2), P(IBD=1) := 2p(1-p), and P(IBD=2) := p2, where p is the current PI_HAT</option>
949 </param>
950 </when>
951 </conditional>
952 </when>
953 <!-- <when value='rerun'>
954 <param type='data' name='logfile' format='binary' label='Plink Log File'/>
955 </when> -->
956 </conditional>
957 </inputs>
958 <outputs>
959 <!--Main-->
960 <collection name='plink_out' type='list' label='Plink main outputs'>
961 <data name='plink_bed' format='binary' from_work_dir='plink_output/plink_output.bed'/>
962 <data name='plink_bim' format='tabular' from_work_dir='plink_output/plink_output.bim'/>
963 <data name='plink_fam' format='tabular' from_work_dir='plink_output/plink_output.fam'/>
964 <data name='plink_log' format='txt' from_work_dir='plink_output/plink_output.log'/>
965 </collection>
966
967 <!--Data Manage-->
968 <data name='plink_ped' format='txt' from_work_dir='plink_output/plink_output.ped' label='${tool.name}: Recode ped'>
969 <filter>functions['func'] == 'data_manage' and functions['recode']</filter>
970 </data>
971 <data name='plink_map' format='txt' from_work_dir='plink_output/plink_output.map' label='${tool.name}: Recode map'>
972 <filter>functions['func'] == 'data_manage' and functions['recode']</filter>
973 </data>
974
975 <!--Stats-->
976 <data name='frequency' format='tabular' from_work_dir='plink_output/plink_output.frq' label='${tool.name}: freq out'>
977 <filter>functions['func'] == 'stats' and functions['freq']</filter>
978 </data>
979 <data name='hardy_out' format='tabular' from_work_dir='plink_output/plink_output.hwe' label='${tool.name}: Hardy-Weinberg equilibrium'>
980 <filter>functions['func'] == 'stats' and functions['hardy']</filter>
981 </data>
982 <data name='missing_1' format='tabular' from_work_dir='plink_output/plink_output.imiss' label='${tool.name}: imiss'>
983 <filter>functions['func'] == 'stats' and functions['missing']</filter>
984 </data>
985 <data name='missing_2' format='tabular' from_work_dir='plink_output/plink_output.lmiss' label='${tool.name}: lmiss'>
986 <filter>functions['func'] == 'stats' and functions['missing']</filter>
987 </data>
988 <data name='het' format='tabular' from_work_dir='plink_output/plink_output.het' label='${tool.name}: Het'>
989 <filter>functions['func'] == 'stats' and functions['het']</filter>
990 </data>
991 <data name='sex_check' format='tabular' from_work_dir='plink_output/plink_output.sexcheck' label='${tool.name}: Sex check'>
992 <filter>functions['func'] == 'stats' and functions['sex']['sex_stats']</filter>
993 </data>
994
995 <!--Association-->
996 <!--assoc-->
997 <data name='assoc' format='tabular' from_work_dir='plink_output/plink_output.assoc' label='${tool.name}: Association'>
998 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and not functions['assoc']['fisher']</filter>
999 </data>
1000 <data name='perm' format='tabular' from_work_dir='plink_output/plink_output.assoc.perm' label='${tool.name}: Association Monte Carlo'>
1001 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['perm']['perm'] == 'perm' and not functions['assoc']['fisher']</filter>
1002 </data>
1003 <data name='mperm' format='tabular' from_work_dir='plink_output/plink_output.assoc.mperm' label='${tool.name}: Association Max(T) permutation test'>
1004 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['perm']['perm'] == 'mperm' and not functions['assoc']['fisher']</filter>
1005 </data>
1006 <data name='fisher' format='tabular' from_work_dir='plink_output/plink_output.assoc.fisher' label='${tool.name}: Association Fisher'>
1007 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['fisher']</filter>
1008 </data>
1009 <data name='fisher_perm' format='tabular' from_work_dir='plink_output/plink_output.assoc.fisher.perm' label='${tool.name}: Association Fisher perm'>
1010 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['perm']['perm'] == 'perm' and functions['assoc']['fisher']</filter>
1011 </data>
1012 <data name='fisher_mperm' format='tabular' from_work_dir='plink_output/plink_output.assoc.fisher.mperm' label='${tool.name}: Association Fisher mperm'>
1013 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['assoc']['perm']['perm'] == 'mperm' and functions['assoc']['fisher']</filter>
1014 </data>
1015
1016 <!--adjust-->
1017 <data name='adjust' format='tabular' from_work_dir='plink_output/plink_output.assoc.adjusted' label='${tool.name}: Adjusted'>
1018 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['adjust']['adjust'] == 'Yes' and not functions['assoc']['fisher']</filter>
1019 </data>
1020 <data name='adjust_fisher' format='tabular' from_work_dir='plink_output/plink_output.assoc.fisher.adjusted' label='${tool.name}: Fisher Adjusted'>
1021 <filter>functions['func'] == 'association' and functions['assoc']['assoc'] == 'Yes' and functions['adjust']['adjust'] == 'Yes' and functions['assoc']['fisher']</filter>
1022 </data>
1023 <data name='adjust_logistic' format='tabular' from_work_dir='plink_output/plink_output.assoc.logistic.adjusted' label='${tool.name}: Logistic Adjusted'>
1024 <filter>functions['func'] == 'association' and functions['adjust']['adjust'] == 'Yes' and functions['logistic']['logistic'] == 'Yes'</filter>
1025 </data>
1026
1027 <!-- <data name='linear' format='tabular' from_work_dir='plink_output/plink_output.assoc.linenar' label='${tool.name}: Linear Regression'>
1028 <filter>functions['func'] == 'association' and functions.func.association.linear['linear'] == 'Yes'</filter>
1029 </data> -->
1030
1031 <!--Logistic-->
1032 <data name='logistic' format='tabular' from_work_dir='plink_output/plink_output.assoc.logistic' label='${tool.name}: Logistic Regression'>
1033 <filter>functions['func'] == 'association' and functions['logistic']['logistic'] == 'Yes'</filter>
1034 </data>
1035 <data name='logistic_perm' format='tabular' from_work_dir='plink_output/plink_output.assoc.logistic.perm' label='${tool.name}: Logistic Association Monte Carlo'>
1036 <filter>functions['func'] == 'association' and functions['logistic']['logistic'] == 'Yes' and functions['logistic']['perm']['perm'] == 'perm'</filter>
1037 </data>
1038 <data name='logistic_mperm' format='tabular' from_work_dir='plink_output/plink_output.assoc.logistic.mperm' label='${tool.name}: Logistic Association Max(T) permutation test'>
1039 <filter>functions['func'] == 'association' and functions['logistic']['logistic'] == 'Yes' and functions['logistic']['perm']['perm'] == 'mperm'</filter>
1040 </data>
1041
1042 <!--Link-->
1043 <data name='prune_in' format='tabular' from_work_dir='plink_output/plink_output.prune.in' label='${tool.name}: Prune In'>
1044 <filter>functions['func'] == 'link' and functions['set_indep']['choice'] == 'Yes'</filter>
1045 </data>
1046 <data name='prune_out' format='tabular' from_work_dir='plink_output/plink_output.prune.out' label='${tool.name}: Prune Out'>
1047 <filter>functions['func'] == 'link' and functions['set_indep']['choice'] == 'Yes'</filter>
1048 </data>
1049
1050 <!--IBD-->
1051 <data name='genome' format='tabular' from_work_dir='plink_output/plink_output.genome' label='${tool.name}: Genome'>
1052 <filter>functions['func'] == 'ibd' and functions['genome']['output_genome']</filter>
1053 </data>
1054
1055 <!--Stratifiction-->
1056 <data name='mds' format='txt' from_work_dir='plink_output/plink_output.mds' label='${tool.name}: MDS'>
1057 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and functions['cluster']['mds']['mds_scaling'] == 'Yes'</filter>
1058 </data>
1059 <data name='cluster1' format='tabular' from_work_dir='plink_output/plink_output.cluster1' label='${tool.name}: Cluster 1'>
1060 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes'</filter>
1061 </data>
1062 <data name='cluster2' format='tabular' from_work_dir='plink_output/plink_output.cluster2' label='${tool.name}: Cluster 2'>
1063 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes'</filter>
1064 </data>
1065 <data name='cluster3' format='tabular' from_work_dir='plink_output/plink_output.cluster3' label='${tool.name}: Cluster 3'>
1066 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and 'missing' not in functions['cluster']['modifiers']</filter>
1067 </data>
1068 <data name='cluster3missing' format='tabular' from_work_dir='plink_output/plink_output.cluster3.missing' label='${tool.name}: Cluster 3 missing'>
1069 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and functions['cluster']['modifiers'] and 'missing' in functions['cluster']['modifiers']</filter>
1070 </data>
1071 <data name='mds_miss' format='tabular' from_work_dir='plink_output/plink_output.mdist.missing' label='${tool.name}: Mdist missing'>
1072 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and functions['cluster']['modifiers'] and 'missing' in functions['cluster']['modifiers']</filter>
1073 </data>
1074 <data name='eigenvals' format='txt' from_work_dir='plink_output/plink_output.mds.eigvals' label='${tool.name}: Eigenvals'>
1075 <filter>functions['func'] == 'stratification' and functions['cluster']['cluster'] == 'Yes' and functions['cluster']['mds']['mds_scaling'] == 'Yes' and functions['cluster']['mds']['modifiers'] and 'eigvals' in functions['cluster']['mds']['modifiers']</filter>
1076 </data>
1077 </outputs>
1078 <tests>
1079 <test expect_num_outputs='5'>
1080 <section name='inputs'>
1081 <conditional name='inputs'>
1082 <param name='filetype' value='bfile'/>
1083 <param name='bed' value='plink.bed'/>
1084 <param name='bim' value='plink.bim'/>
1085 <param name='fam' value='plink.fam'/>
1086 </conditional>
1087 </section>
1088 <conditional name='functions'>
1089 <param name='func' value='filtering'/>
1090 <conditional name='id_list'>
1091 <param name='func' value='remove'/>
1092 <param name='file' value='1.tabular'/>
1093 </conditional>
1094 <conditional name='extraction'>
1095 <param name='ex_func' value='exclude'/>
1096 <param name='file' value='testing.txt'/>
1097 <param name='range' value='true'/>
1098 </conditional>
1099 <param name='snps_exclusives' value='--snps-only'/>
1100 <conditional name='ranges'>
1101 <param name='single_multi' value='single'/>
1102 <conditional name='window'>
1103 <param name='type' value='variant'/>
1104 <param name='from' value='snp0'/>
1105 <param name='to' value='snp3'/>
1106 </conditional>
1107 </conditional>
1108 <conditional name='thinning'>
1109 <param name='thinning' value='Yes'/>
1110 <param name='thin_count' value='4'/>
1111 </conditional>
1112 <section name='geno_rates'>
1113 <param name='geno' value='0.02'/>
1114 <param name='mind' value='0.02'/>
1115 </section>
1116 <section name='allele_freq'>
1117 <param name='maf' value='0.01'/>
1118 </section>
1119 <conditional name='hwe'>
1120 <param name='hwe' value='Yes'/>
1121 <param name='hwe_val' value='1e-50'/>
1122 <param name='modifiers' value='midp,include-nonctrl'/>
1123 </conditional>
1124 <conditional name='sex_founder_filter'>
1125 <param name='filter' value='Yes'/>
1126 <param name='sex_select' value='--filter-cases'/>
1127 <param name='no_sex_select' value='--allow-no-sex'/>
1128 <param name='nonfounders' value='--nonfounders'/>
1129 </conditional>
1130 </conditional>
1131 <output_collection name='plink_out' type='list'>
1132 <element name='plink_bed' file='test1_out.bed' compare='sim_size'/>
1133 <element name='plink_bim' file='test1_out.bim'/>
1134 <element name='plink_fam' file='test1_out.fam'/>
1135 </output_collection>
1136 </test>
1137
1138 <test expect_num_outputs='7'>
1139 <section name='inputs'>
1140 <conditional name='inputs'>
1141 <param name='filetype' value='bfile'/>
1142 <param name='bed' value='plink.bed'/>
1143 <param name='bim' value='plink.bim'/>
1144 <param name='fam' value='plink.fam'/>
1145 </conditional>
1146 </section>
1147 <conditional name='functions'>
1148 <param name='func' value='data_manage'/>
1149 <conditional name='bmerge'>
1150 <param name='set' value='Yes'/>
1151 <param name='bed' value='plink_2.bed'/>
1152 <param name='bim' value='plink_2.bim'/>
1153 <param name='fam' value='plink_2.fam'/>
1154 </conditional>
1155 <param name='recode' value='--recode'/>
1156 <param name='template' value='@asd#123'/>
1157 <param name='length' value='23'/>
1158 <conditional name='update_cols'>
1159 <param name='set' value='update_name'/>
1160 <param name='input' value='update_cols.txt'/>
1161 <param name='col_num' value='1'/>
1162 <param name='var_col' value='2'/>
1163 <param name='skip' value='a'/>
1164 </conditional>
1165 </conditional>
1166 <output_collection name='plink_out' type='list'>
1167 <element name='plink_bed' file='test2_out.bed' compare='sim_size'/>
1168 <element name='plink_bim' file='test2_out.bim'/>
1169 <element name='plink_fam' file='test2_out.fam'/>
1170 </output_collection>
1171 <output name='plink_ped' file='out.ped'/>
1172 <output name='plink_map' file='out.map'/>
1173 </test>
1174
1175 <test expect_num_outputs='5'>
1176 <section name='inputs'>
1177 <conditional name='inputs'>
1178 <param name='filetype' value='vcf'/>
1179 <param name='input' value='test.vcf'/>
1180 </conditional>
1181 </section>
1182 <output_collection name='plink_out' type='list'>
1183 <element name='plink_bed' file='vcf_out.bed'/>
1184 <element name='plink_bim' file='vcf_out.bim'/>
1185 <element name='plink_fam' file='vcf_out.fam'/>
1186 </output_collection>
1187 </test>
1188
1189 <test expect_num_outputs='11'>
1190 <section name='inputs'>
1191 <conditional name='inputs'>
1192 <param name='filetype' value='bfile'/>
1193 <param name='bed' value='plink.bed'/>
1194 <param name='bim' value='x_plink.bim'/>
1195 <param name='fam' value='plink.fam'/>
1196 </conditional>
1197 </section>
1198 <conditional name='functions'>
1199 <param name='func' value='stats'/>
1200 <param name='freq' value='--freq'/>
1201 <param name='hardy' value='--hardy'/>
1202 <param name='missing' value='--missing'/>
1203 <param name='het' value='--het'/>
1204 <conditional name='sex'>
1205 <param name='sex_stats' value='--check-sex'/>
1206 <conditional name='mode'>
1207 <param name='mode' value='ycount'/>
1208 <param name='female_max' value='0.2'/>
1209 <param name='male_min' value='0.8'/>
1210 <param name='female_max_obvs' value='10'/>
1211 <param name='male_min_obvs' value='200'/>
1212 </conditional>
1213 </conditional>
1214 </conditional>
1215 <output_collection name='plink_out' type='list'>
1216 <element name='plink_bed' file='stats.bed'/>
1217 <element name='plink_bim' file='stats.bim'/>
1218 <element name='plink_fam' file='stats.fam'/>
1219 <element name='plink_fam' file='stats.fam'/>
1220 </output_collection>
1221 <output name='frequency' file='out.freq'/>
1222 <output name='hardy_out' file='out.hardy'/>
1223 <output name='missing_1' file='out.imiss'/>
1224 <output name='missing_2' file='out.lmiss'/>
1225 <output name='het' file='out.het'/>
1226 <output name='sex_check' file='out.sexcheck'/>
1227 </test>
1228
1229 <test expect_num_outputs='7'>
1230 <section name='inputs'>
1231 <conditional name='inputs'>
1232 <param name='filetype' value='bfile'/>
1233 <param name='bed' value='plink.bed'/>
1234 <param name='bim' value='plink.bim'/>
1235 <param name='fam' value='plink.fam'/>
1236 </conditional>
1237 </section>
1238 <conditional name='functions'>
1239 <param name='func' value='link'/>
1240 <conditional name='set_indep'>
1241 <param name='choice' value='Yes'/>
1242 <param name='window' value='51'/>
1243 <param name='step' value='6'/>
1244 <param name='r2' value='0.3'/>
1245 </conditional>
1246 </conditional>
1247 <output_collection name='plink_out' type='list'>
1248 <element name='plink_bed' file='test5_out.bed' compare='sim_size'/>
1249 <element name='plink_bim' file='test5_out.bim'/>
1250 <element name='plink_fam' file='test5_out.fam'/>
1251 </output_collection>
1252 <output name='prune_in' file='plink.prune.in'/>
1253 </test>
1254
1255 <test expect_num_outputs='10'>
1256 <section name='inputs'>
1257 <conditional name='inputs'>
1258 <param name='filetype' value='bfile'/>
1259 <param name='bed' value='plink.bed'/>
1260 <param name='bim' value='plink.bim'/>
1261 <param name='fam' value='plink.fam'/>
1262 </conditional>
1263 </section>
1264 <conditional name='functions'>
1265 <param name='func' value='stratification'/>
1266 <param name='read_genome' value='plink.genome'/>
1267 <conditional name='cluster'>
1268 <param name='cluster' value='Yes'/>
1269 <param name='modifiers' value='cc,group-avg'/>
1270 <conditional name='mds'>
1271 <param name='mds_scaling' value='Yes'/>
1272 <param name='dimensions' value='10'/>
1273 <param name='modifiers' value='eigendecomp,eigvals'/>
1274 </conditional>
1275 </conditional>
1276 </conditional>
1277 <output_collection name='plink_out' type='list'>
1278 <element name='plink_bed' file='test6_out.bed' compare='sim_size'/>
1279 <element name='plink_bim' file='test6_out.bim'/>
1280 <element name='plink_fam' file='test6_out.fam'/>
1281 </output_collection>
1282 <output name='mds' value='plink.mds' compare='sim_size'/>
1283 <output name='cluster1' value='plink.cluster1' compare='sim_size'/>
1284 <output name='cluster2' value='plink.cluster2' compare='sim_size'/>
1285 <output name='cluster3' value='plink.cluster3' compare='sim_size'/>
1286 <output name='eigenvals' value='plink.mds.eigenval' compare='sim_size'/>
1287 </test>
1288
1289 <test expect_num_outputs='11'>
1290 <section name='inputs'>
1291 <conditional name='inputs'>
1292 <param name='filetype' value='bfile'/>
1293 <param name='bed' value='plink.bed'/>
1294 <param name='bim' value='plink.bim'/>
1295 <param name='fam' value='plink.fam'/>
1296 </conditional>
1297 </section>
1298 <conditional name='functions'>
1299 <param name='func' value='association'/>
1300 <conditional name='assoc'>
1301 <param name='assoc' value='Yes'/>
1302 <conditional name='perm'>
1303 <param name='perm' value='mperm'/>
1304 <param name='value' value='10000'/>
1305 </conditional>
1306 <param name='fisher' value='fisher-midp'/>
1307 </conditional>
1308 <conditional name='adjust'>
1309 <param name='adjust' value='Yes'/>
1310 <param name='tests' value='gc,log10,qq-plot'/>
1311 </conditional>
1312 <conditional name='logistic'>
1313 <param name='logistic' value='Yes'/>
1314 <conditional name='perm'>
1315 <param name='perm' value='perm'/>
1316 </conditional>
1317 <param name='genedrop' value='genedrop'/>
1318 <param name='perm_count' value='perm-count'/>
1319 <param name='dominance' value='dominant'/>
1320 <param name='hide_covar' value='hide-covar'/>
1321 <param name='beta' value='beta'/>
1322 <param name='intercept' value='intercept'/>
1323 </conditional>
1324 <param name='lambda' value='1.0'/>
1325 </conditional>
1326 <output_collection name='plink_out' type='list'>
1327 <element name='plink_bed' file='out.assoc.bed' compare='sim_size'/>
1328 <element name='plink_bim' file='out.assoc.bim'/>
1329 <element name='plink_fam' file='out.assoc.fam'/>
1330 </output_collection>
1331 <output name='fisher' value="out.assoc.fisher"/>
1332 <output name='adjust_fisher' value="out.assoc.fisher.adjusted" sort="True" />
1333 <output name='fisher_mperm' value="out.assoc.fisher.mperm" compare='sim_size'/>
1334 <output name='logistic' value="out.assoc.logistic"/>
1335 <output name='adjust_logistic' value="out.assoc.logistic.adjusted"/>
1336 <output name='logistic_perm' value="out.assoc.logistic.perm" compare='sim_size'/>
1337 </test>
1338
1339 <test expect_num_outputs='6'>
1340 <section name='inputs'>
1341 <conditional name='inputs'>
1342 <param name='filetype' value='bfile'/>
1343 <param name='bed' value='plink.bed'/>
1344 <param name='bim' value='plink.bim'/>
1345 <param name='fam' value='plink.fam'/>
1346 </conditional>
1347 </section>
1348 <conditional name='functions'>
1349 <param name='func' value='ibd'/>
1350 <conditional name='genome'>
1351 <param name='output_genome' value='Yes'/>
1352 <param name='min' value='0.1'/>
1353 <param name='max' value='0.9'/>
1354 <param name='modifiers' value='full,unbounded,nudge'/>
1355 </conditional>
1356 </conditional>
1357 <output name='genome' file='out.genome'/>
1358 </test>
1359 </tests>
1360 <help><![CDATA[
1361 PLINK is a free, open-source whole genome association analysis toolset, designed to perform a range of basic, large-scale analyses in a computationally efficient manner.
1362
1363 For detailed usage notes, visit http://www.cog-genomics.org/plink/2.0/
1364 ]]></help>
1365 <citations>
1366 <citation type='doi'>10.1186/s13742-015-0047-8</citation>
1367 </citations>
1368 </tool>