Mercurial > repos > iuc > medaka_variant
comparison variant.xml @ 12:0f5f4a208660 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/medaka commit 86211daa63a6f39524df8759364795b782324303"
author | iuc |
---|---|
date | Fri, 17 Sep 2021 20:22:49 +0000 |
parents | 9fb055604648 |
children | 222669c4afb6 |
comparison
equal
deleted
inserted
replaced
11:2bf63b38ee9b | 12:0f5f4a208660 |
---|---|
1 <?xml version="1.0"?> | 1 <?xml version="1.0"?> |
2 <tool id="medaka_variant" name="medaka variant tool" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@"> | 2 <tool id="medaka_variant" name="medaka variant tool" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@"> |
3 <description>Probability decoding</description> | 3 <description>decodes variant calls from medaka consensus output</description> |
4 <macros> | 4 <macros> |
5 <import>macros.xml</import> | 5 <import>macros.xml</import> |
6 </macros> | 6 </macros> |
7 <expand macro="requirements"/> | 7 <expand macro="requirements"/> |
8 | |
9 <expand macro="version_command"/> | 8 <expand macro="version_command"/> |
10 | |
11 <configfiles> | |
12 <configfile name="convert_fasta"> | |
13 import sys | |
14 infile = open(sys.argv[1], 'r') | |
15 outfile = open(sys.argv[2], 'w') | |
16 for line in infile: | |
17 if line[0] == '>': | |
18 outfile.write(line) | |
19 else: | |
20 outfile.write(line.upper()) | |
21 infile.close() | |
22 outfile.close() | |
23 </configfile> | |
24 </configfiles> | |
25 | |
26 <command detect_errors="exit_code"><![CDATA[ | 9 <command detect_errors="exit_code"><![CDATA[ |
27 ## initialize | 10 ## initialize |
28 @REF_FASTA@ | 11 @REF_FASTA@ |
29 | 12 |
30 | 13 |
42 ## required | 25 ## required |
43 reference.fa | 26 reference.fa |
44 #for $current in $pool.inputs | 27 #for $current in $pool.inputs |
45 '$current' | 28 '$current' |
46 #end for | 29 #end for |
47 '$out_result' ## output | |
48 2>&1 | tee '$out_log' | |
49 #elif $pool.pool_mode == "No": | 30 #elif $pool.pool_mode == "No": |
50 ## run | 31 ## run |
51 medaka variant | 32 medaka variant |
52 ## optional | 33 ## optional |
53 --debug | 34 --debug |
58 ${ambig_ref} | 39 ${ambig_ref} |
59 ${gvcf} | 40 ${gvcf} |
60 ## required | 41 ## required |
61 reference.fa | 42 reference.fa |
62 '$pool.input' | 43 '$pool.input' |
63 '$out_result' ##output | 44 #end if |
45 #if str($output_annotated.output_annotated_select) == 'false': | |
46 '$out_variants' ##output | |
64 2>&1 | tee '$out_log' | 47 2>&1 | tee '$out_log' |
65 #end if | 48 #else |
66 #if $out_annotated: | 49 raw.vcf ##output of medaka variant |
67 ## medaka annotate errors out if the reference is lower case at a position it's annotating because it checks vs the ref base in the vcf | 50 2>&1 | tee '$out_log' |
68 && python '$convert_fasta' reference.fa upper_reference.fa | |
69 && ln -s '$output_annotated.in_bam' in.bam | 51 && ln -s '$output_annotated.in_bam' in.bam |
70 && ln -s '$output_annotated.in_bam.metadata.bam_index' in.bai | 52 && ln -s '$output_annotated.in_bam.metadata.bam_index' in.bai |
71 && medaka tools annotate --dpsp --pad $output_annotated.pad '$out_result' upper_reference.fa in.bam tmp.vcf | 53 && medaka tools annotate --dpsp --pad $output_annotated.pad raw.vcf reference.fa in.bam tmp.vcf |
72 && python '$__tool_directory__/convert_VCF_info_fields.py' tmp.vcf '$out_annotated' | 54 && python '$__tool_directory__/convert_VCF_info_fields.py' tmp.vcf '$out_variants' |
73 #end if | 55 #end if |
74 ]]></command> | 56 ]]></command> |
75 <inputs> | 57 <inputs> |
76 <conditional name="pool"> | 58 <conditional name="pool"> |
77 <param name="pool_mode" type="select" label="Are you pooling HDF5 datasets?"> | 59 <param name="pool_mode" type="select" label="Are you pooling HDF5 datasets?"> |
97 </param> | 79 </param> |
98 <param argument="--verbose" type="boolean" truevalue="--verbose" falsevalue="" label="Populate VCF info fields?"/> | 80 <param argument="--verbose" type="boolean" truevalue="--verbose" falsevalue="" label="Populate VCF info fields?"/> |
99 <param argument="--ambig_ref" type="boolean" truevalue="--ambig_ref" falsevalue="" label="Decode variants at ambiguous reference positions?" checked="false"/> | 81 <param argument="--ambig_ref" type="boolean" truevalue="--ambig_ref" falsevalue="" label="Decode variants at ambiguous reference positions?" checked="false"/> |
100 <param argument="--gvcf" type="boolean" truevalue="--gvcf" falsevalue="" label="Output VCF records for reference loci predicted to be non-variant?" checked="false"/> | 82 <param argument="--gvcf" type="boolean" truevalue="--gvcf" falsevalue="" label="Output VCF records for reference loci predicted to be non-variant?" checked="false"/> |
101 <conditional name="output_annotated"> | 83 <conditional name="output_annotated"> |
102 <param name="output_annotated_select" type="select" label="Output annotated VCF?" help="Annotate allele frequency, depth of coverage, etc for each variant (requires BAM file)"> | 84 <param name="output_annotated_select" type="select" |
103 <option value="true" selected="true">Output annotated VCF</option> | 85 label="Type of VCF to generate" |
104 <option value="false">Don't output annotated VCF</option> | 86 help="Variant INFO fields in the VCF can be extended to include allele frequency, depth of coverage, etc., but this requires a BAM dataset to calculate those values from."> |
87 <option value="true" selected="true">Write annotated VCF with extended INFO</option> | |
88 <option value="false">Write original decoded VCF with minimal INFO field</option> | |
105 </param> | 89 </param> |
106 <when value="true"> | 90 <when value="true"> |
107 <param name="in_bam" type="data" format="bam" optional="false" label="BAM to annotate the VCF"/> | 91 <param name="in_bam" type="data" format="bam" optional="false" label="BAM to caclulate additional INFO fields from"/> |
108 <param name="pad" type="integer" min="1" value="25" label="Padding width on either side of variant for realignment in medaka tools anntotate, used to calculate DPSP, DPSPS, AF, FAF, RAF, SB, DP4, and AS in the output annotated VCF"/> | 92 <param name="pad" type="integer" min="1" value="25" |
93 label="Padding width on either side of variant for realignment" | |
94 help="To calculate the additional INFO fields the tool will run medaka tools anntotate, which performs local realignment of the region +- this width around each variant. All calculated new fields will depend on the width chosen, so only change this value if you know what you are doing." /> | |
109 </when> | 95 </when> |
110 <when value="false"/> | 96 <when value="false"/> |
111 </conditional> | 97 </conditional> |
112 <param name="output_log_bool" type="boolean" label="Output log file?" checked="true"/> | 98 <param name="output_log_bool" type="boolean" label="Output log file?" checked="true"/> |
113 </inputs> | 99 </inputs> |
114 <outputs> | 100 <outputs> |
115 <!-- standard --> | 101 <data name="out_variants" format="vcf" label="${tool.name} on ${on_string}: called variants"/> |
116 <data name="out_result" format="vcf" label="${tool.name} on ${on_string}: Result"/> | |
117 <!-- optional --> | |
118 <data name="out_annotated" format="vcf" label="${tool.name} on ${on_string}: Annotated"> | |
119 <filter>output_annotated['output_annotated_select']!='false'</filter> | |
120 </data> | |
121 <data name="out_log" format="tabular" label="${tool.name} on ${on_string}: Log"> | 102 <data name="out_log" format="tabular" label="${tool.name} on ${on_string}: Log"> |
122 <filter>output_log_bool</filter> | 103 <filter>output_log_bool</filter> |
123 </data> | 104 </data> |
124 </outputs> | 105 </outputs> |
125 <tests> | 106 <tests> |
126 <!-- #1 default --> | 107 <!-- #1 default --> |
127 <test expect_num_outputs="3"> | 108 <test expect_num_outputs="2"> |
128 <conditional name="pool"> | 109 <conditional name="pool"> |
129 <param name="pool_mode" value="Yes"/> | 110 <param name="pool_mode" value="Yes"/> |
130 <param name="inputs" value="medaka_test.hdf,medaka_test.hdf"/> | 111 <param name="inputs" value="medaka_test.hdf,medaka_test.hdf"/> |
131 </conditional> | 112 </conditional> |
132 <conditional name="reference_source"> | 113 <conditional name="reference_source"> |
133 <param name="reference_source_selector" value="history"/> | 114 <param name="reference_source_selector" value="history"/> |
134 <param name="ref_file" value="ref.fasta.gz"/> | 115 <param name="ref_file" value="ref.fasta"/> |
135 </conditional> | 116 </conditional> |
136 <param name="ambig_ref" value="true"/> | 117 <param name="ambig_ref" value="true"/> |
137 <conditional name="output_annotated"> | 118 <conditional name="output_annotated"> |
138 <param name="output_annotated_select" value="true"/> | 119 <param name="output_annotated_select" value="true"/> |
139 <param name="in_bam" value="medaka_test.bam"/> | 120 <param name="in_bam" value="medaka_test.bam"/> |
140 </conditional> | 121 </conditional> |
141 <param name="output_log_bool" value="true"/> | 122 <param name="output_log_bool" value="true"/> |
142 | 123 <output name="out_variants"> |
143 <output name="out_result"> | 124 <assert_contents> |
144 <assert_contents> | 125 <has_n_lines n="18"/> |
145 <has_n_lines n="9"/> | |
146 <has_line line="##fileformat=VCFv4.1" /> | |
147 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> | |
148 </assert_contents> | |
149 </output> | |
150 <output name="out_annotated"> | |
151 <assert_contents> | |
152 <has_n_lines n="23"/> | |
153 <has_line line="##fileformat=VCFv4.1" /> | 126 <has_line line="##fileformat=VCFv4.1" /> |
154 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> | 127 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> |
155 <has_line_matching expression="##convert_VCF_info_fields=[0-9]+\.[0-9]+" /> | 128 <has_line_matching expression="##convert_VCF_info_fields=[0-9]+\.[0-9]+" /> |
156 </assert_contents> | 129 </assert_contents> |
157 </output> | 130 </output> |
160 <has_n_lines n="10" /> | 133 <has_n_lines n="10" /> |
161 </assert_contents> | 134 </assert_contents> |
162 </output> | 135 </output> |
163 </test> | 136 </test> |
164 <!--No pooling--> | 137 <!--No pooling--> |
165 <test expect_num_outputs="3"> | 138 <test expect_num_outputs="2"> |
166 <conditional name="pool"> | 139 <conditional name="pool"> |
167 <param name="pool_mode" value="No"/> | 140 <param name="pool_mode" value="No"/> |
168 <param name="input" value="medaka_test.hdf"/> | 141 <param name="input" value="medaka_test.hdf"/> |
169 </conditional> | 142 </conditional> |
170 <conditional name="reference_source"> | 143 <conditional name="reference_source"> |
175 <conditional name="output_annotated"> | 148 <conditional name="output_annotated"> |
176 <param name="output_annotated_select" value="true"/> | 149 <param name="output_annotated_select" value="true"/> |
177 <param name="in_bam" value="medaka_test.bam"/> | 150 <param name="in_bam" value="medaka_test.bam"/> |
178 </conditional> | 151 </conditional> |
179 <param name="output_log_bool" value="true"/> | 152 <param name="output_log_bool" value="true"/> |
180 | 153 <output name="out_variants"> |
181 <output name="out_result"> | 154 <assert_contents> |
182 <assert_contents> | 155 <has_n_lines n="18"/> |
183 <has_n_lines n="9"/> | |
184 <has_line line="##fileformat=VCFv4.1" /> | |
185 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> | |
186 </assert_contents> | |
187 </output> | |
188 <output name="out_annotated"> | |
189 <assert_contents> | |
190 <has_n_lines n="23"/> | |
191 <has_line line="##fileformat=VCFv4.1" /> | 156 <has_line line="##fileformat=VCFv4.1" /> |
192 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> | 157 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> |
193 <has_line_matching expression="##convert_VCF_info_fields=[0-9]+\.[0-9]+" /> | 158 <has_line_matching expression="##convert_VCF_info_fields=[0-9]+\.[0-9]+" /> |
194 </assert_contents> | 159 </assert_contents> |
195 </output> | 160 </output> |
211 </conditional> | 176 </conditional> |
212 <conditional name="output_annotated"> | 177 <conditional name="output_annotated"> |
213 <param name="output_annotated_select" value="false"/> | 178 <param name="output_annotated_select" value="false"/> |
214 </conditional> | 179 </conditional> |
215 <param name="output_log_bool" value="false"/> | 180 <param name="output_log_bool" value="false"/> |
216 | 181 <output name="out_variants"> |
217 <output name="out_result"> | |
218 <assert_contents> | 182 <assert_contents> |
219 <has_n_lines n="9"/> | 183 <has_n_lines n="9"/> |
220 <has_line line="##fileformat=VCFv4.1" /> | 184 <has_line line="##fileformat=VCFv4.1" /> |
221 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> | 185 <has_line_matching expression="##medaka_version=[0-9]+\.[0-9]+\.[0-9]+" /> |
222 </assert_contents> | 186 </assert_contents> |