0
|
1 <tool id="vcfgeno2haplo" name="VCFgenotype-to-haplotype:" version="0.0.1">
|
|
2 <requirements>
|
|
3 <requirement type="package" version="586c5ae5d57a38dae6b32ea831fb1f7cfa14c9bd">vcflib</requirement>
|
|
4 </requirements>
|
|
5 <description>Convert genotype-based phased alleles into haplotype alleles</description>
|
|
6 <command>
|
|
7 #set $reference_fasta_filename = "localref.fa"
|
|
8 #if str( $reference_source.reference_source_selector ) == "history":
|
|
9 ln -s "${reference_source.ref_file}" "${reference_fasta_filename}" &&
|
|
10 #else:
|
|
11 #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
|
|
12 #end if
|
|
13 vcfgeno2haplo ${output_option} -w ${window_size} -r "${reference_fasta_filename}" "${input_vcf}" > "${out_file1}"</command>
|
|
14 <inputs>
|
|
15 <conditional name="reference_source">
|
|
16 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
|
|
17 <option value="cached">Locally cached</option>
|
|
18 <option value="history">History</option>
|
|
19 </param>
|
|
20 <when value="cached">
|
|
21 <param name="ref_file" type="select" label="Select reference genome">
|
|
22 <options from_data_table="fasta_indexes">
|
|
23 <!--<filter type="data_meta" key="dbkey" ref="input_bam" column="value"/>-->
|
|
24 </options>
|
|
25 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
|
|
26 </param>
|
|
27 <param name="input_vcf" type="data" format="vcf" label="Select VCF dataset">
|
|
28 <!-- Validators are commented to allow users apply too to any build. May need to be revised in the future
|
|
29 <validator type="unspecified_build" />
|
|
30 <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
|
|
31 -->
|
|
32 </param>
|
|
33 </when>
|
|
34 <when value="history"> <!-- FIX ME!!!! -->
|
|
35 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
|
|
36 <param name="input_vcf" type="data" format="vcf" label="Select VCF dataset" />
|
|
37 </when>
|
|
38 </conditional>
|
|
39 <param name="window_size" type="text" size="4" value="30" label="compare records up to this many bp away (window size)" help="--window-size option (default = 30)" />
|
|
40 <param name="output_option" type="boolean" truevalue="-o" falsevalue="" label="What to report?" help="--only-variants option" />
|
|
41 <!-- <option value=" ">Output entire haplotype</option>
|
|
42 <option value="-o">Don't output the entire haplotype, just concatenate REF/ALT strings (delimited by ":")</option>
|
|
43 </param> -->
|
|
44 </inputs>
|
|
45 <outputs>
|
|
46 <data format="vcf" name="out_file1" />
|
|
47 </outputs>
|
|
48 <stdio>
|
|
49 <exit_code range="1:" level="fatal" />
|
|
50 </stdio>
|
|
51 <tests>
|
|
52 <test>
|
|
53 <param name="reference_source_selector" value="history" />
|
|
54 <param name="output_option" value="true" />
|
|
55 <param name="window_size" value="5000" />
|
|
56 <param name="input_vcf" value="vcflib-phix.vcf"/>
|
|
57 <param name="ref_file" value="vcflib-test-genome-phix.fa" />
|
|
58 <output name="out_file1" file="vcfgeno2haplo-test1.vcf"/>
|
|
59 </test>
|
|
60 </tests>
|
|
61 <help>
|
|
62
|
|
63 Convert genotype-based phased alleles within a window size specified by -w option into haplotype alleles. Will break haplotype construction when encountering non-phased genotypes on input.
|
|
64
|
|
65 The options are::
|
|
66
|
|
67 -r, --reference FILE FASTA reference file, required with -i and -u
|
|
68 -w, --window-size N Merge variants at most this many bp apart (default 30)
|
|
69 -o, --only-variants Don't output the entire haplotype, just concatenate
|
|
70 REF/ALT strings (delimited by ":")
|
|
71
|
|
72 ----
|
|
73
|
|
74 Vcfgeno2haplo is a part of VCFlib toolkit developed by Erik Garrison (https://github.com/ekg/vcflib).
|
|
75
|
|
76 </help>
|
|
77 </tool>
|