comparison hamronize_tool.xml @ 4:cbfa52c8f1ef draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hamronization commit b49fc153425676a82e77dec090676403112bcbe6
author iuc
date Tue, 05 Mar 2024 19:47:12 +0000
parents e13b801516dd
children
comparison
equal deleted inserted replaced
3:e13b801516dd 4:cbfa52c8f1ef
1 <tool id="hamronize_tool" name="hamronize" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@"> 1 <tool id="hamronize_tool" name="hAMRonize" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
2 <description> parse multiple Antimicrobial Resistance Analysis Reports into a common data structure</description> 2 <description>Antimicrobial Resistance Analysis Reports into a common data structure</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="bio_tools"/> 6 <expand macro="bio_tools"/>
7 <expand macro="requirements" /> 7 <expand macro="requirements" />
8 <expand macro="version_command" /> 8 <expand macro="version_command" />
9
10 <command detect_errors="exit_code"><![CDATA[ 9 <command detect_errors="exit_code"><![CDATA[
11 #set $extra_2_params = str("ariba,srax,csstar,groot").split(",") 10 #import re
12 #set $extra_1_param = $extra_2_params + str("amrfinderplus,rgi,resfinder4,deeparg,kmerresistance,srst2,amrplusplus,resfarms").split(",") 11
13 12 #set $no_origin_info_tools = ['mykrobe', 'tbprofiler']
14 hamronize 13 #set $origin_tools = ['abricate', 'amrfinderplus', 'fargene', 'srst2', 'staramr']
15 ${select_tool.tool} 14 #set $in_fname_tools = ['amrfinderplus', 'amrplusplus', 'ariba', 'csstar', 'deeparg', 'fargene', 'groot', 'kmerresistance', 'pointfinder', 'resfarms', 'rgi', 'srax', 'srst2']
16 --analysis_software_version '${analysis_software_version}' 15 #set $ref_db_name_tools = ['ariba', 'csstar', 'groot', 'srax']
17 --reference_database_version '${reference_database_version}' 16 #set $input_file_name = re.sub('[^\s\w\-\.]', '_', str($input.report.element_identifier))
18 --format ${output_format} 17
19 #if $output_format == "tsv" 18 hamronize
20 --output hamronized.tsv 19 '$input.tool'
20 '$input.report'
21 --format '$format'
22 --output '$output'
23 #if $input.tool not in $no_origin_info_tools
24 #if $input.tool in $origin_tools and $input.origin.origin
25 #if $input.origin.origin
26 --analysis_software_version '$input.report.tool_version'
21 #else 27 #else
22 --output hamronized.json 28 --analysis_software_version '$input.origin.analysis_software_version'
23 #end if
24
25 #if $select_tool.tool in $extra_1_param
26 --input_file_name $select_tool.input_file_name
27 #end if 29 #end if
28 30 --reference_database_version '$input.reference_database_version'
29 #if $select_tool.tool in $extra_2_params 31 #else
30 --reference_database_id $select_tool.reference_database_id 32 --analysis_software_version '$input.analysis_software_version'
31 #end if 33 --reference_database_version '$input.reference_database_version'
32 34 #end if
33 $report 35 #end if
36 #if $input.tool in $in_fname_tools
37 #if str($input.input_file_name) != ''
38 --input_file_name '$input.input_file_name'
39 #else
40 --input_file_name '$input_file_name'
41 #end if
42 #end if
43 #if $input.tool in $ref_db_name_tools
44 --reference_database_name '$input.reference_database_name'
45 #end if
34 ]]> </command> 46 ]]> </command>
35
36 <inputs> 47 <inputs>
37 <param name="report" type="data" format="txt,tabular" label="Report file"/> 48 <conditional name="input">
38 <conditional name="select_tool">
39 <param name="tool" type="select" label="Tool"> 49 <param name="tool" type="select" label="Tool">
40 <option value="abricate" selected="true">abricate</option> 50 <option value="abricate" selected="true">ABRicate</option>
41 <option value="amrfinderplus">amrfinderplus</option> 51 <option value="amrfinderplus">AMRFinderPlus</option>
42 <option value="ariba">ariba</option> 52 <option value="amrplusplus">AMRplusplus</option>
43 <option value="rgi">rgi</option> 53 <option value="ariba">ARIBA</option>
44 <option value="resfinder">resfinder</option> 54 <option value="csstar">c-SSTAR</option>
45 <option value="resfinder4">resfinder4</option> 55 <option value="deeparg">DeepARG</option>
46 <option value="srax">srax</option> 56 <option value="fargene">fARGene</option>
47 <option value="deeparg">deeparg</option> 57 <option value="groot">GROOT</option>
48 <option value="kmerresistance">kmerresistance</option> 58 <option value="kmerresistance">KmerResistance</option>
49 <option value="srst2">srst2</option> 59 <option value="mykrobe">Mykrobe</option>
50 <option value="staramr">staramr</option> 60 <option value="pointfinder">PointFinder</option>
51 <option value="csstar">csstar</option> 61 <option value="resfams">ResFams</option>
52 <option value="amrplusplus">amrplusplus</option> 62 <option value="resfinder">ResFinder</option>
53 <option value="resfams">resfams</option> 63 <option value="rgi">RGI</option>
54 <option value="groot">groot</option> 64 <option value="srax">SraX</option>
65 <option value="srst2">SRST2</option>
66 <option value="staramr">StarAMR</option>
67 <option value="tbprofiler">TBProfiler</option>
55 </param> 68 </param>
56 <when value="abricate" /> 69 <when value="abricate">
57 <when value="resfinder" /> 70 <expand macro="report" format="tabular" label="ABRicate Report file"/>
58 <when value="staramr" /> 71 <expand macro="origin" software="ABRicate"/>
72 </when>
59 <when value="amrfinderplus"> 73 <when value="amrfinderplus">
60 <expand macro="input_file_name"/> 74 <expand macro="report" format="tabular" label="AMRFinderPlus Report file"/>
75 <expand macro="input_file_name"/>
76 <expand macro="origin" software="AMRFinderPlus"/>
77 </when>
78 <when value="amrplusplus">
79 <expand macro="report" format="tabular" label="AMRplusplus gene report"/>
80 <expand macro="input_file_name"/>
81 <expand macro="analysis_software_version" software="AMRplusplus"/>
82 <expand macro="reference_database_version"/>
61 </when> 83 </when>
62 <when value="ariba"> 84 <when value="ariba">
63 <expand macro="input_file_name"/> 85 <expand macro="report" format="tabular" label="ARIBA output"/>
64 <expand macro="reference_database_id"/> 86 <expand macro="input_file_name"/>
87 <expand macro="analysis_software_version" software="ARIBA"/>
88 <expand macro="reference_database_version"/>
89 <expand macro="reference_database_name" software="ARIBA"/>
90 </when>
91 <when value="csstar">
92 <expand macro="report" format="tabular" label="c-SSTAR output"/>
93 <expand macro="input_file_name"/>
94 <expand macro="analysis_software_version" software="c-SSTAR" />
95 <expand macro="reference_database_version"/>
96 <expand macro="reference_database_name" software="c-SSTAR"/>
97 </when>
98 <when value="deeparg">
99 <expand macro="report" format="tabular" label="DeepARG output"/>
100 <expand macro="input_file_name"/>
101 <expand macro="analysis_software_version" software="DeepARG"/>
102 </when>
103 <when value="fargene">
104 <expand macro="report" format="txt" label="fARGene HMM Search Result"/>
105 <expand macro="input_file_name"/>
106 <expand macro="origin" software="fARGene"/>
107 </when>
108 <when value="groot">
109 <expand macro="report" format="tabular" label="GROOT output"/>
110 <expand macro="input_file_name"/>
111 <expand macro="analysis_software_version" software="GROOT" />
112 <expand macro="reference_database_version"/>
113 <expand macro="reference_database_name" software="GROOT"/>
114 </when>
115 <when value="kmerresistance">
116 <expand macro="report" format="tabular" label="KmerResistance gene report"/>
117 <expand macro="input_file_name"/>
118 <expand macro="analysis_software_version" software="KmerResistance"/>
119 <expand macro="reference_database_version"/>
120 </when>
121 <when value="mykrobe">
122 <expand macro="report" format="json" label="Mykrobe Report file"/>
123 </when>
124 <when value="pointfinder">
125 <param name="report" type="data" format="txt" label="PointFinder results"/>
126 <expand macro="input_file_name"/>
127 <expand macro="analysis_software_version" software="PointFinder"/>
128 <expand macro="reference_database_version"/>
129 </when>
130 <when value="resfams">
131 <param name="report" type="data" format="txt" label="ResFams results"/>
132 <expand macro="input_file_name"/>
133 <expand macro="analysis_software_version" software="ResFams"/>
134 <expand macro="reference_database_version"/>
135 </when>
136 <when value="resfinder">
137 <param name="report" type="data" format="tabular" label="ResFinder results"/>
138 <expand macro="input_file_name"/>
139 <expand macro="analysis_software_version" software="ResFinder"/>
140 <expand macro="reference_database_version"/>
65 </when> 141 </when>
66 <when value="rgi"> 142 <when value="rgi">
67 <expand macro="input_file_name"/> 143 <param name="report" type="data" format="txt" label="RGI output"/>
68 </when> 144 <expand macro="input_file_name"/>
69 <when value="resfinder4"> 145 <expand macro="analysis_software_version" software="RGI"/>
70 <expand macro="input_file_name"/> 146 <expand macro="reference_database_version"/>
71 </when> 147 </when>
72 <when value="srax"> 148 <when value="srax">
73 <expand macro="input_file_name"/> 149 <param name="report" type="data" format="tabular" label="SraX detected ARGs"/>
74 <expand macro="reference_database_id"/> 150 <expand macro="input_file_name"/>
75 </when> 151 <expand macro="analysis_software_version" software="SraX"/>
76 <when value="deeparg"> 152 <expand macro="reference_database_version"/>
77 <expand macro="input_file_name"/> 153 <expand macro="reference_database_name" software="SraX"/>
78 </when>
79 <when value="kmerresistance">
80 <expand macro="input_file_name"/>
81 </when> 154 </when>
82 <when value="srst2"> 155 <when value="srst2">
83 <expand macro="input_file_name"/> 156 <expand macro="report" format="tabular" label="SRST2 report"/>
84 </when> 157 <expand macro="input_file_name"/>
85 <when value="csstar"> 158 <expand macro="origin" software="SRST2"/>
86 <expand macro="input_file_name"/> 159 </when>
87 <expand macro="reference_database_id"/> 160 <when value="staramr">
88 </when> 161 <expand macro="report" format="tabular" label="StarAMR ResFinder output"/>
89 <when value="amrplusplus"> 162 <expand macro="origin" software="StarAMR"/>
90 <expand macro="input_file_name"/> 163 </when>
91 </when> 164 <when value="tbprofiler">
92 <when value="resfams"> 165 <param name="report" type="data" format="tabular" label="TBProfiler output"/>
93 <expand macro="input_file_name"/>
94 </when>
95 <when value="groot">
96 <expand macro="input_file_name"/>
97 <expand macro="reference_database_id"/>
98 </when> 166 </when>
99 </conditional> 167 </conditional>
100 <param name="output_format" type="select" label="Output format" multiple="false" display="radio"> 168 <param argument="--format" type="select" label="Output format">
101 <option value="tsv" selected="True">tsv</option> 169 <option value="tsv" selected="True">Tabular</option>
102 <option value="json">json</option> 170 <option value="json">JSON</option>
103 </param> 171 </param>
104 <param name="analysis_software_version" type="text" label="Analysis software version"></param>
105 <param name="reference_database_version" type="text" label="Reference database version"></param>
106 </inputs> 172 </inputs>
107
108 <outputs> 173 <outputs>
109 <data format="tabular" name="output_tsv" label="${tool.name} on ${on_string}: Table" from_work_dir="hamronized.tsv"> 174 <data name="output" format="tabular" label="${tool.name} on ${on_string} (${input.tool})">
110 <filter>output_format == "tsv"</filter> 175 <change_format>
111 </data> 176 <when input="format" value="json" format="json"/>
112 <data format="json" name="output_json" label="${tool.name} on ${on_string}: JSON" from_work_dir="hamronized.json"> 177 </change_format>
113 <filter>output_format == "json"</filter>
114 </data> 178 </data>
115 </outputs> 179 </outputs>
116 <tests> 180 <tests>
117 <!-- abricate --> 181 <!-- abricate -->
118 <test expect_num_outputs="1"> 182 <test expect_num_outputs="1">
119 <param name="report" value="abricate/report.tsv" ftype="tabular" /> 183 <conditional name="input">
120 <param name="tool" value="abricate" /> 184 <param name="tool" value="abricate" />
121 <param name="output_format" value="tsv" /> 185 <param name="report" value="abricate/report.tsv" ftype="tabular" />
122 <param name="reference_database_version" value="db_v_1" /> 186 <conditional name="origin">
123 <param name="analysis_software_version" value="tool_v_1" /> 187 <param name="origin" value="false"/>
124 <output name="output_tsv" file="hamronized_abricate.tsv" ftype="tabular" /> 188 <param name="analysis_software_version" value="tool_v_1"/>
125 </test> 189 </conditional>
126 <test expect_num_outputs="1"> 190 <param name="reference_database_version" value="db_v_1"/>
127 <param name="report" value="abricate/report.tsv" ftype="tabular" /> 191 </conditional>
128 <param name="tool" value="abricate" /> 192 <param name="format" value="tsv" />
129 <param name="output_format" value="json" /> 193 <output name="output" ftype="tabular">
130 <param name="reference_database_version" value="db_v_1" /> 194 <assert_contents>
131 <param name="analysis_software_version" value="tool_v_1" /> 195 <has_n_lines n="8"/>
132 <output name="output_json" file="hamronized_abricate.json" ftype="json" /> 196 <has_n_columns n="36"/>
197 <has_text text="input_file_name"/>
198 <has_text text="GCF_010120755.1_ASM1012075v1_genomic"/>
199 <has_text text="vanS-M"/>
200 <has_text text="db_v_1"/>
201 </assert_contents>
202 </output>
203 </test>
204 <test expect_num_outputs="1">
205 <conditional name="input">
206 <param name="tool" value="abricate" />
207 <param name="report" value="abricate/report.tsv" ftype="tabular" />
208 <conditional name="origin">
209 <param name="origin" value="false"/>
210 <param name="analysis_software_version" value="tool_v_1"/>
211 </conditional>
212 <param name="reference_database_version" value="db_v_1"/>
213 </conditional>
214 <param name="format" value="json" />
215 <output name="output" ftype="json">
216 <assert_contents>
217 <has_text text="input_file_name"/>
218 <has_text text="GCF_010120755.1_ASM1012075v1_genomic"/>
219 <has_text text="vanS-M"/>
220 <has_text text="db_v_1"/>
221 </assert_contents>
222 </output>
133 </test> 223 </test>
134 <!-- ariba --> 224 <!-- ariba -->
135 <test expect_num_outputs="1"> 225 <test expect_num_outputs="1">
136 <param name="report" value="ariba/report.tsv" ftype="tabular" /> 226 <conditional name="input">
137 <param name="tool" value="ariba" /> 227 <param name="tool" value="ariba" />
138 <param name="output_format" value="tsv" /> 228 <param name="report" value="ariba/report.tsv" ftype="tabular" />
139 <param name="reference_database_version" value="db_v_1" /> 229 <param name="input_file_name" value="ariba_report" />
140 <param name="analysis_software_version" value="ariba_v1" /> 230 <param name="analysis_software_version" value="ariba_v1" />
141 <param name="input_file_name" value="ariba_report" /> 231 <param name="reference_database_version" value="db_v_1" />
142 <param name="reference_database_id" value="dbname" /> 232 <param name="reference_database_name" value="dbname" />
143 <output name="output_tsv" file="hamronized_ariba.tsv" ftype="tabular" /> 233 </conditional>
234 <param name="format" value="tsv" />
235 <output name="output" ftype="tabular">
236 <assert_contents>
237 <has_n_lines n="257"/>
238 <has_n_columns n="36"/>
239 <has_text text="input_file_name"/>
240 <has_text text="ariba_report"/>
241 <has_text text="AAC_3__IId"/>
242 <has_text text="ariba_v1"/>
243 <has_text text="db_v_1"/>
244 <has_text text="dbname"/>
245 </assert_contents>
246 </output>
247 </test>
248 <!-- mykrobe -->
249 <test expect_num_outputs="1">
250 <conditional name="input">
251 <param name="tool" value="mykrobe" />
252 <param name="report" value="mykrobe/mykrobe.json" ftype="json" />
253 </conditional>
254 <param name="format" value="tsv" />
255 <output name="output" ftype="tabular">
256 <assert_contents>
257 <has_n_lines n="2"/>
258 <has_n_columns n="36"/>
259 <has_text text="input_file_name"/>
260 <has_text text="rpoB"/>
261 <has_text text="v0.10.0"/>
262 <has_text text="NC_000962.3"/>
263 <has_text text="mykrobe"/>
264 </assert_contents>
265 </output>
144 </test> 266 </test>
145 <!-- rgi --> 267 <!-- rgi -->
146 <test expect_num_outputs="1"> 268 <test expect_num_outputs="1">
147 <param name="report" value="rgi/rgi.txt" ftype="txt" /> 269 <conditional name="input">
148 <param name="tool" value="rgi" /> 270 <param name="tool" value="rgi" />
149 <param name="output_format" value="tsv" /> 271 <param name="report" value="rgi/rgi.txt" ftype="txt" />
150 <param name="reference_database_version" value="card_v1" /> 272 <param name="analysis_software_version" value="rgi_v1" />
151 <param name="analysis_software_version" value="rgi_v1" /> 273 <param name="reference_database_version" value="card_v1" />
152 <param name="input_file_name" value="rgi_report" /> 274 </conditional>
153 <output name="output_tsv" file="hamronized_rgi.tsv" ftype="tabular"/> 275 <param name="format" value="tsv" />
276 <output name="output" ftype="tabular">
277 <assert_contents>
278 <has_n_lines n="42"/>
279 <has_n_columns n="36"/>
280 <has_text text="input_file_name"/>
281 <has_text text="rgi.txt"/>
282 <has_text text="oqxA"/>
283 <has_text text="CARD"/>
284 <has_text text="card_v1"/>
285 <has_text text="rgi_v1"/>
286 </assert_contents>
287 </output>
154 </test> 288 </test>
155 </tests> 289 </tests>
156 <help><![CDATA[ 290 <help><![CDATA[
157 **What it does** 291 **What it does**
158 292
159 Hamronize parse multiple Antimicrobial Resistance Analysis Reports into a common data structure 293 hAMRonization parses multiple Antimicrobial Resistance Analysis Reports
294 from disparate antimicrobial resistance gene detection tools into a single
295 unified format.
296
297 This is an implementation of the hAMRonization AMR detection specification
298 scheme which supports gene presence/absence resistance and mutational resistance
299 (if supported by the underlying tool).
160 300
161 **Inputs** 301 **Inputs**
162 302
163 Depends on the tools with hAMRonizable reports: 303 Report or output of an antimicrobial resistance gene detection tool:
164 304
165 * abricate: abricate's output report i.e., OUTPUT.tsv 305 * abricate: abricate's output report i.e., OUTPUT.tsv
166 * amrfinderplus: amrfinderplus's output report i.e., OUTPUT.tsv 306 * amrfinderplus: amrfinderplus's output report i.e., OUTPUT.tsv
167 * ariba: ariba's output report i.e., OUTDIR/OUTPUT.tsv 307 * ariba: ariba's output report i.e., OUTDIR/OUTPUT.tsv
168 * rgi: rgi's output report i.e., OUTPUT.txt or OUTPUT_bwtoutput.gene_mapping_data.txt 308 * rgi: rgi's output report i.e., OUTPUT.txt or OUTPUT_bwtoutput.gene_mapping_data.txt