13
|
1 <tool id="bcftools_norm" name="BCFtools norm" version="1.0.0">
|
|
2 <description>Left-align and normalize indels, check if REF alleles match reference, change multiallelic format</description>
|
25
|
3 <requirements>
|
|
4 <requirement type="package" version="1.3">bcftools</requirement>
|
|
5 </requirements>
|
13
|
6 <command>
|
|
7 #if str( $input_file_index ) != "None":
|
|
8 ln -s -f $input input_file.${input.ext} &&
|
|
9 ln -s -f $input_file_index input_file.${input.ext}.tbi &&
|
|
10 #end if
|
|
11 #if str( $fasta_ref_cond.set_fasta_ref ) == "True":
|
|
12 #if str( $fasta_ref_cond.fasta_ref_index ) != "None":
|
|
13 ln -s -f $fasta_ref_cond.fasta_ref fasta_ref_file.${fasta_ref.ext}.fa &&
|
|
14 ln -s -f $fasta_ref_cond.fasta_ref_index fasta_ref_file.${fasta_ref.ext}.fa.fai &&
|
|
15 #end if
|
|
16 #end if
|
|
17 bcftools norm
|
|
18 --output "${output_file}"
|
|
19 --output-type "${output_type}"
|
|
20 #if str( $regions_file ) != "None":
|
|
21 --regions-file "${regions_file}"
|
|
22 #end if
|
|
23 #if str( $regions ) != "":
|
|
24 --regions "${regions}"
|
|
25 #end if
|
|
26 #if str( $targets_file ) != "None":
|
|
27 --targets-file "${targets_file}"
|
|
28 #end if
|
|
29 #if str( $targets ) != "":
|
|
30 --targets "${targets}"
|
|
31 #end if
|
|
32 #if str( $check_ref_cond.set_check_ref ) == "True":
|
|
33 #if str( $check_ref_cond.warn ) == "true":
|
|
34 #if str( $check_ref_cond.check_ref ) == "None":
|
|
35 --check-ref "w"
|
|
36 #else
|
|
37 --check-ref "w${check_ref_cond.check_ref}"
|
|
38 #end if
|
|
39 #else
|
|
40 --check-ref "${check_ref_cond.check_ref}"
|
|
41 #end if
|
|
42 #end if
|
|
43 #if str( $fasta_ref_cond.set_fasta_ref ) == "True":
|
|
44 #if str( $fasta_ref_cond.fasta_ref_index ) != "None":
|
|
45 --fasta-ref "fasta_ref_file.${fasta_ref.ext}.fa"
|
|
46 #else
|
|
47 --fasta-ref "${fasta_ref}"
|
|
48 #end if
|
|
49 #end if
|
|
50 #if str( $multiallelics_cond.set_multiallelics ) == "True":
|
|
51 #if str( $multiallelics_cond.minus_or_plus ) == "minus":
|
|
52 #if str ( $multiallelics_cond.multiallelics ) != "None":
|
|
53 --multiallelics "-${multiallelics_cond.multiallelics}"
|
|
54 #else
|
|
55 --multiallelics "-"
|
|
56 #end if
|
|
57 #else
|
|
58 #if str ( $multiallelics_cond.multiallelics ) != "None":
|
|
59 --multiallelics "+${multiallelics_cond.multiallelics}"
|
|
60 #else
|
|
61 --multiallelics "+"
|
|
62 #end if
|
|
63 #end if
|
|
64 #end if
|
|
65 #if str( $rm_dup ) != "None":
|
|
66 --rm-dup "${rm_dup}"
|
|
67 #end if
|
|
68 ${do_not_normalize}
|
|
69 ${strict_filter}
|
|
70 #if str( $site_win ) != "":
|
|
71 --site-win "${site_win}"
|
|
72 #end if
|
|
73 #if str( $input_file_index ) != "None":
|
|
74 input_file.${input.ext}
|
|
75 #else
|
|
76 $input
|
|
77 #end if
|
|
78 </command>
|
|
79 <inputs>
|
|
80 <param name="input" type="data" format="vcf,bcf,bgzip" label="VCF or BCF input file" help="Input file can optionally be compressed and indexed using Bgzip and Tabix Galaxy tools. In this case, select bgzipped file here and index below."/>
|
|
81 <param name="input_file_index" type="data" optional="true" label="Input file index" help="Tabix-generated index for input file. Run Tabix Galaxy tool on bgzipped input file to create index."/>
|
|
82 <param name="output_type" type="select" label="Output data type" help="-O">
|
|
83 <option value="v" selected="true">VCF</option>
|
|
84 <option value="b">BCF</option>
|
|
85 </param>
|
|
86 <param name="regions_file" type="data" optional="true" label="Regions file" help="-R. Regions specified in a VCF, BED, or tab-delimited file with columns CHROM, POS, and, optionally, POS_TO."/>
|
|
87 <param name="regions" type="text" size="80" optional="True" label="Regions list" help="-r. Comma-separated list of regions. Format: chr|chr:pos|chr:from-to|chr:from-[,...]">
|
|
88 <sanitizer invalid_char="">
|
|
89 <valid initial="string.digits"><add value="CHRchr-:,"/> </valid>
|
|
90 </sanitizer>
|
|
91 </param>
|
|
92 <param name="targets_file" type="data" optional="true" label="Targets file" help="-T. Targets specified in a VCF, BED, or tab-delimited file with columns CHROM, POS, and, optionally, POS_TO."/>
|
|
93 <param name="targets" type="text" size="80" optional="True" label="Targets list" help="-t. Comma-separated list of targets. Format: [^]chr|chr:pos|chr:from-to|chr:from-[,...]">
|
|
94 <sanitizer invalid_char="">
|
|
95 <valid initial="string.digits"><add value="CHRchr-:,^"/> </valid>
|
|
96 </sanitizer>
|
|
97 </param>
|
|
98 <conditional name="fasta_ref_cond">
|
|
99 <param name="set_fasta_ref" type="boolean" checked="False" label="Specify FASTA reference sequence" help="-f" />
|
|
100 <when value="true">
|
|
101 <param name="fasta_ref" type="data" label="FASTA reference file" help="Reference sequence. Using this option turns on left-alignment and normalization. Set corresponding index below." />
|
|
102 <param name="fasta_ref_index" type="data" optional="True" label="FASTA reference index" help="Run Faidx (SAMtools) Galaxy tool on above reference file to create index. Errors can arise if this index is not specified." />
|
|
103 </when>
|
|
104 </conditional>
|
|
105 <param name="do_not_normalize" type="boolean" checked="False" truevalue="--do-not-normalize" falsevalue="" label="Turn off indel normalization" help="-N. Indel normalization automatically occurs when FASTA reference is used. Use this option to disable this behavior." />
|
|
106 <conditional name="check_ref_cond">
|
|
107 <param name="set_check_ref" type="boolean" checked="False" label="Check REF" help="-c. Choose action when an incorrect or missing REF allele is encountered." />
|
|
108 <when value="true">
|
|
109 <param name="check_ref" type="select" optional="True" label="Action" help="Action when an incorrect or missing REF allele is encountered.">
|
|
110 <option value="e">Exit program</option>
|
|
111 <option value="x">Exclude incorrect/missing sites</option>
|
|
112 <option value="s">Set or fix incorrect/missing sites (requires FASTA reference)</option>
|
|
113 </param>
|
|
114 <param name="warn" type="boolean" checked="False" label="Warn" help="Warn when an incorrect or missing REF allele is encountered." />
|
|
115 </when>
|
|
116 </conditional>
|
|
117 <param name="rm_dup" type="select" optional="True" label="Remove duplicates" help="-d. For given variant type, if a record is present in multiple files, output only the first instance.">
|
|
118 <option value="snps">SNPs</option>
|
|
119 <option value="indels">Indels</option>
|
|
120 <option value="both">Both (SNPs and indels)</option>
|
|
121 <option value="any">Any</option>
|
|
122 </param>
|
|
123 <conditional name="multiallelics_cond">
|
|
124 <param name="set_multiallelics" type="boolean" checked="False" label="Modify multiallelic sites" help="-m. Split multiallelic sites into biallelic records, or join biallelic sites into multiallelic records." />
|
|
125 <when value="true">
|
|
126 <param name="minus_or_plus" type="select" label="Split or join">
|
|
127 <option value="minus" selected="true">Split multiallelic sites into biallelic records</option>
|
|
128 <option value="plus">Join biallelic sites into multiallelic records</option>
|
|
129 </param>
|
|
130 <param name="multiallelics" type="select" optional="True" label="Sites to split/join" help="">
|
|
131 <option value="snps">SNPs (only SNP records are split/joined)</option>
|
|
132 <option value="indels">Indels (only indel records are split/joined)</option>
|
|
133 <option value="both">Both (SNPs and indels are merged separately into two records)</option>
|
|
134 <option value="any">Any (SNPs and indels are merged into a single record)</option>
|
|
135 </param>
|
|
136 </when>
|
|
137 </conditional>
|
|
138 <param name="strict_filter" type="boolean" checked="False" truevalue="--strict-filter" falsevalue="" label="Strict PASS filter" help="-s. When merging biallelics into multiallelics, merged site has value PASS only if all sites being merged have value PASS." />
|
|
139 <param name="site_win" type="integer" optional="true" label="Position window" help="-w. Maximum distance between two records to consider when locally sorting variants which changed position during the realignment." />
|
|
140 </inputs>
|
|
141 <outputs>
|
|
142 <data name="output_file" format="vcf" label="${tool.name} on ${on_string}">
|
|
143 <change_format>
|
|
144 <when input="output_type" value="b" format="bcf" />
|
|
145 </change_format>
|
|
146 </data>
|
|
147 </outputs>
|
|
148 <help>
|
|
149 **About this tool**
|
|
150
|
|
151 **BCFtools norm**: Left-align and normalize indels, check if REF alleles match the reference, split multiallelic sites into multiple rows, recover multiallelics from multiple rows. Left-alignment and normalization will only be applied if the --fasta-ref option is supplied.
|
|
152
|
|
153 Please see https://samtools.github.io/bcftools/bcftools.html for more info on options.
|
|
154 </help>
|
|
155 </tool>
|
|
156
|