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>
|
|
3 <command>
|
|
4 #if str( $input_file_index ) != "None":
|
|
5 ln -s -f $input input_file.${input.ext} &&
|
|
6 ln -s -f $input_file_index input_file.${input.ext}.tbi &&
|
|
7 #end if
|
|
8 #if str( $fasta_ref_cond.set_fasta_ref ) == "True":
|
|
9 #if str( $fasta_ref_cond.fasta_ref_index ) != "None":
|
|
10 ln -s -f $fasta_ref_cond.fasta_ref fasta_ref_file.${fasta_ref.ext}.fa &&
|
|
11 ln -s -f $fasta_ref_cond.fasta_ref_index fasta_ref_file.${fasta_ref.ext}.fa.fai &&
|
|
12 #end if
|
|
13 #end if
|
|
14 bcftools norm
|
|
15 --output "${output_file}"
|
|
16 --output-type "${output_type}"
|
|
17 #if str( $regions_file ) != "None":
|
|
18 --regions-file "${regions_file}"
|
|
19 #end if
|
|
20 #if str( $regions ) != "":
|
|
21 --regions "${regions}"
|
|
22 #end if
|
|
23 #if str( $targets_file ) != "None":
|
|
24 --targets-file "${targets_file}"
|
|
25 #end if
|
|
26 #if str( $targets ) != "":
|
|
27 --targets "${targets}"
|
|
28 #end if
|
|
29 #if str( $check_ref_cond.set_check_ref ) == "True":
|
|
30 #if str( $check_ref_cond.warn ) == "true":
|
|
31 #if str( $check_ref_cond.check_ref ) == "None":
|
|
32 --check-ref "w"
|
|
33 #else
|
|
34 --check-ref "w${check_ref_cond.check_ref}"
|
|
35 #end if
|
|
36 #else
|
|
37 --check-ref "${check_ref_cond.check_ref}"
|
|
38 #end if
|
|
39 #end if
|
|
40 #if str( $fasta_ref_cond.set_fasta_ref ) == "True":
|
|
41 #if str( $fasta_ref_cond.fasta_ref_index ) != "None":
|
|
42 --fasta-ref "fasta_ref_file.${fasta_ref.ext}.fa"
|
|
43 #else
|
|
44 --fasta-ref "${fasta_ref}"
|
|
45 #end if
|
|
46 #end if
|
|
47 #if str( $multiallelics_cond.set_multiallelics ) == "True":
|
|
48 #if str( $multiallelics_cond.minus_or_plus ) == "minus":
|
|
49 #if str ( $multiallelics_cond.multiallelics ) != "None":
|
|
50 --multiallelics "-${multiallelics_cond.multiallelics}"
|
|
51 #else
|
|
52 --multiallelics "-"
|
|
53 #end if
|
|
54 #else
|
|
55 #if str ( $multiallelics_cond.multiallelics ) != "None":
|
|
56 --multiallelics "+${multiallelics_cond.multiallelics}"
|
|
57 #else
|
|
58 --multiallelics "+"
|
|
59 #end if
|
|
60 #end if
|
|
61 #end if
|
|
62 #if str( $rm_dup ) != "None":
|
|
63 --rm-dup "${rm_dup}"
|
|
64 #end if
|
|
65 ${do_not_normalize}
|
|
66 ${strict_filter}
|
|
67 #if str( $site_win ) != "":
|
|
68 --site-win "${site_win}"
|
|
69 #end if
|
|
70 #if str( $input_file_index ) != "None":
|
|
71 input_file.${input.ext}
|
|
72 #else
|
|
73 $input
|
|
74 #end if
|
|
75 </command>
|
|
76 <inputs>
|
|
77 <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."/>
|
|
78 <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."/>
|
|
79 <param name="output_type" type="select" label="Output data type" help="-O">
|
|
80 <option value="v" selected="true">VCF</option>
|
|
81 <option value="b">BCF</option>
|
|
82 </param>
|
|
83 <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."/>
|
|
84 <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-[,...]">
|
|
85 <sanitizer invalid_char="">
|
|
86 <valid initial="string.digits"><add value="CHRchr-:,"/> </valid>
|
|
87 </sanitizer>
|
|
88 </param>
|
|
89 <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."/>
|
|
90 <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-[,...]">
|
|
91 <sanitizer invalid_char="">
|
|
92 <valid initial="string.digits"><add value="CHRchr-:,^"/> </valid>
|
|
93 </sanitizer>
|
|
94 </param>
|
|
95 <conditional name="fasta_ref_cond">
|
|
96 <param name="set_fasta_ref" type="boolean" checked="False" label="Specify FASTA reference sequence" help="-f" />
|
|
97 <when value="true">
|
|
98 <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." />
|
|
99 <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." />
|
|
100 </when>
|
|
101 </conditional>
|
|
102 <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." />
|
|
103 <conditional name="check_ref_cond">
|
|
104 <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." />
|
|
105 <when value="true">
|
|
106 <param name="check_ref" type="select" optional="True" label="Action" help="Action when an incorrect or missing REF allele is encountered.">
|
|
107 <option value="e">Exit program</option>
|
|
108 <option value="x">Exclude incorrect/missing sites</option>
|
|
109 <option value="s">Set or fix incorrect/missing sites (requires FASTA reference)</option>
|
|
110 </param>
|
|
111 <param name="warn" type="boolean" checked="False" label="Warn" help="Warn when an incorrect or missing REF allele is encountered." />
|
|
112 </when>
|
|
113 </conditional>
|
|
114 <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.">
|
|
115 <option value="snps">SNPs</option>
|
|
116 <option value="indels">Indels</option>
|
|
117 <option value="both">Both (SNPs and indels)</option>
|
|
118 <option value="any">Any</option>
|
|
119 </param>
|
|
120 <conditional name="multiallelics_cond">
|
|
121 <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." />
|
|
122 <when value="true">
|
|
123 <param name="minus_or_plus" type="select" label="Split or join">
|
|
124 <option value="minus" selected="true">Split multiallelic sites into biallelic records</option>
|
|
125 <option value="plus">Join biallelic sites into multiallelic records</option>
|
|
126 </param>
|
|
127 <param name="multiallelics" type="select" optional="True" label="Sites to split/join" help="">
|
|
128 <option value="snps">SNPs (only SNP records are split/joined)</option>
|
|
129 <option value="indels">Indels (only indel records are split/joined)</option>
|
|
130 <option value="both">Both (SNPs and indels are merged separately into two records)</option>
|
|
131 <option value="any">Any (SNPs and indels are merged into a single record)</option>
|
|
132 </param>
|
|
133 </when>
|
|
134 </conditional>
|
|
135 <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." />
|
|
136 <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." />
|
|
137 </inputs>
|
|
138 <outputs>
|
|
139 <data name="output_file" format="vcf" label="${tool.name} on ${on_string}">
|
|
140 <change_format>
|
|
141 <when input="output_type" value="b" format="bcf" />
|
|
142 </change_format>
|
|
143 </data>
|
|
144 </outputs>
|
|
145 <help>
|
|
146 **About this tool**
|
|
147
|
|
148 **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.
|
|
149
|
|
150 Please see https://samtools.github.io/bcftools/bcftools.html for more info on options.
|
|
151 </help>
|
|
152 </tool>
|
|
153
|