comparison vsnp_build_tables.xml @ 9:25714108bb22 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 2a94c64d6c7236550bf483d2ffc4e86248c63aab"
author iuc
date Tue, 16 Nov 2021 20:13:54 +0000
parents e54b96acea98
children 6b3b0f5858e6
comparison
equal deleted inserted replaced
8:e54b96acea98 9:25714108bb22
1 <tool id="vsnp_build_tables" name="vSNP: build tables" version="@WRAPPER_VERSION@.2" profile="@PROFILE@"> 1 <tool id="vsnp_build_tables" name="vSNP: build tables" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description></description> 2 <description></description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
7 <requirement type="package" version="1.76">biopython</requirement> 7 <expand macro="biopython_requirement"/>
8 <requirement type="package" version="0.25.3">pandas</requirement> 8 <requirement type="package" version="0.25.3">pandas</requirement>
9 <requirement type="package" version="1.2.8">xlsxwriter</requirement> 9 <expand macro="xlsxwriter_requirement"/>
10 </requirements> 10 </requirements>
11 <command detect_errors="exit_code"><![CDATA[ 11 <command detect_errors="exit_code"><![CDATA[
12 #import re 12 #import re
13 13 #set output_excel_dir = 'output_excel_dir'
14 mkdir 'output_excel_dir' && 14 #set input_type = $input_type_cond.input_type
15 15 mkdir $output_excel_dir &&
16 ## The input_snps_json and input_avg_mq_json identifiers 16 #if $input_type == "collection":
17 ## are typically the same string, so we append a uniquq 17 #set input_newick_dir = 'input_newick_dir'
18 ## extension to enable the links. 18 mkdir $input_newick_dir &&
19 #set input_snps_json_identifier = re.sub('[^\s\w\-]', '_', str($input_snps_json.element_identifier)) + '.snps' 19 #set input_json_avg_mq_dir = 'input_json_avg_mq_dir'
20 ln -s '${input_snps_json}' '${input_snps_json_identifier}' && 20 mkdir $input_json_avg_mq_dir &&
21 #set input_avg_mq_json_identifier = re.sub('[^\s\w\-]', '_', str($input_avg_mq_json.element_identifier)) + '.avg_mq' 21 #set input_json_dir = 'input_json_dir'
22 ln -s '${input_avg_mq_json}' '${input_avg_mq_json_identifier}' && 22 mkdir $input_json_dir &&
23 #set input_newick_identifier = re.sub('[^\s\w\-]', '_', str($input_newick.element_identifier)) 23 #for $i in $input_type_cond.input_avg_mq_json_collection:
24 ln -s '${input_newick}' '${input_newick_identifier}' && 24 #set file_name = $i.file_name
25 25 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
26 ln -s '$file_name' '$input_json_avg_mq_dir/$identifier' &&
27 #end for
28 #for $i in $input_type_cond.input_snps_json_collection:
29 #set file_name = $i.file_name
30 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
31 ln -s '$file_name' '$input_json_dir/$identifier' &&
32 #end for
33 #for $i in $input_type_cond.input_newick_collection:
34 #set file_name = $i.file_name
35 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
36 ln -s '$file_name' '$input_newick_dir/$identifier' &&
37 #end for
38 #end if
26 python '$__tool_directory__/vsnp_build_tables.py' 39 python '$__tool_directory__/vsnp_build_tables.py'
27 --input_snps_json '${input_snps_json_identifier}' 40 #if $input_type == "single":
28 --input_avg_mq_json '${input_avg_mq_json_identifier}' 41 --input_avg_mq_json '$input_avg_mq_json'
29 --input_newick '${input_newick_identifier}' 42 --input_snps_json '$input_snps_json'
30 #if str($gbk_cond.gbk_param) == 'yes': 43 --input_newick '$input_newick'
31 #if str($gbk_cond.gbk_source_cond.gbk_source) == 'cached': 44 #end if:
32 --gbk_file '$gbk_cond.gbk_source_cond.gbk_file.fields.path' 45 #if str($gbk_cond.gbk_param) == "yes":
46 #set gbk_source_cond = $gbk_cond.gbk_source_cond
47 #set gbk_source = $gbk_source_cond.gbk_source
48 #if str($gbk_source) == "cached":
49 --gbk_file '$gbk_source_cond.gbk_file.fields.path'
33 #else: 50 #else:
34 --gbk_file '$gbk_cond.gbk_source_cond.gbk_file' 51 --gbk_file '$gbk_source_cond.gbk_file'
35 #end if 52 #end if
36 #end if 53 #end if
54 --processes \${GALAXY_SLOTS:-8}
37 ]]></command> 55 ]]></command>
38 <inputs> 56 <inputs>
39 <param name="input_snps_json" type="data" format="json" label="SNPs json file"/> 57 <conditional name="input_type_cond">
40 <param name="input_avg_mq_json" type="data" format="json" label="Average MQ json file"/> 58 <param name="input_type" type="select" label="Choose the category for the files to be analyzed">
41 <param name="input_newick" type="data" format="newick" label="Best-scoring ML tree file"/> 59 <option value="single" selected="true">Single files</option>
60 <option value="collection">Collection of files</option>
61 </param>
62 <when value="single">
63 <param name="input_snps_json" type="data" format="json" label="SNPs json file"/>
64 <param name="input_avg_mq_json" type="data" format="json" label="Average MQ json file"/>
65 <param name="input_newick" type="data" format="newick" label="Best-scoring ML tree file"/>
66 </when>
67 <when value="collection">
68 <param name="input_snps_json_collection" format="json" type="data_collection" collection_type="list" label="Collection of SNPs json files"/>
69 <param name="input_avg_mq_json_collection" format="json" type="data_collection" collection_type="list" label="Collection of average MQ json files"/>
70 <param name="input_newick_collection" format="newick" type="data_collection" collection_type="list" label="Collection of best-scoring ML tree files"/>
71 </when>
72 </conditional>
42 <conditional name="gbk_cond"> 73 <conditional name="gbk_cond">
43 <param name="gbk_param" type="select" label="Use Genbank file?"> 74 <param name="gbk_param" type="select" label="Use Genbank file?">
44 <option value="yes" selected="true">yes</option> 75 <option value="yes" selected="true">yes</option>
45 <option value="no">No</option> 76 <option value="no">No</option>
46 </param> 77 </param>
51 <option value="history">from history</option> 82 <option value="history">from history</option>
52 </param> 83 </param>
53 <when value="cached"> 84 <when value="cached">
54 <param name="gbk_file" type="select" label="Genbank file"> 85 <param name="gbk_file" type="select" label="Genbank file">
55 <options from_data_table="vsnp_genbank"> 86 <options from_data_table="vsnp_genbank">
56 <filter type="data_meta" column="0" key="dbkey" ref="input_avg_mq_json"/>
57 <validator type="no_options" message="A cached Genbank file is not available for the build associated with the selected average MQ json file"/> 87 <validator type="no_options" message="A cached Genbank file is not available for the build associated with the selected average MQ json file"/>
58 </options> 88 </options>
59 </param> 89 </param>
60 </when> 90 </when>
61 <when value="history"> 91 <when value="history">
65 </when> 95 </when>
66 <when value="no"/> 96 <when value="no"/>
67 </conditional> 97 </conditional>
68 </inputs> 98 </inputs>
69 <outputs> 99 <outputs>
70 <collection name="excel" type="list" label="${tool.name} on ${on_string}"> 100 <collection name="excel" type="list" format="xlsx" label="${tool.name} on ${on_string}">
71 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;xlsx)" directory="output_excel_dir"/> 101 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;xlsx)" directory="output_excel_dir"/>
72 </collection> 102 </collection>
73 </outputs> 103 </outputs>
74 <tests> 104 <tests>
75 <test> 105 <test>
76 <param name="input_snps_json" value="input_snps_json.json" ftype="json" dbkey="89"/> 106 <param name="input_snps_json" value="input_snps_json.json" ftype="json" dbkey="89"/>
77 <param name="input_newick" value="input_newick.newick" ftype="newick" dbkey="89"/> 107 <param name="input_newick" value="input_newick.newick" ftype="newick" dbkey="89"/>
78 <param name="input_avg_mq_json" value="input_avg_mq_json.json" ftype="json" dbkey="89"/> 108 <param name="input_avg_mq_json" value="input_avg_mq_json.json" ftype="json" dbkey="89"/>
79 <param name="gbk_param" value="no"/> 109 <param name="gbk_param" value="no"/>
80 <output_collection name="excel" type="list" count="2"> 110 <output_collection name="excel" type="list" count="2">
81 <element name="input_newick_newick_cascade_table" file="cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 111 <element name="cascade_table" ftype="xlsx">
82 <element name="input_newick_newick_sort_table" file="sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 112 <assert_contents>
113 <has_size value="6853" delta="100"/>
114 </assert_contents>
115 </element>
116 <element name="sort_table" ftype="xlsx">
117 <assert_contents>
118 <has_size value="6847" delta="100"/>
119 </assert_contents>
120 </element>
83 </output_collection> 121 </output_collection>
84 </test> 122 </test>
85 <test> 123 <test>
86 <param name="input_snps_json" value="Mbovis-01_snps.json" ftype="json" dbkey="89"/> 124 <param name="input_type" value="collection"/>
87 <param name="input_newick" value="Mbovis-01_snps.newick" ftype="newick" dbkey="89"/> 125 <param name="input_snps_json_collection">
88 <param name="input_avg_mq_json" value="Mbovis-01_avg_mq.json" ftype="json" dbkey="89"/> 126 <collection type="list">
127 <element name="Mbovis-01_snps.json" value="Mbovis-01_snps.json" dbkey="89"/>
128 <element name="Mbovis-01D_snps.json" value="Mbovis-01D_snps.json" dbkey="89"/>
129 <element name="Mbovis-01D6_snps.json" value="Mbovis-01D6_snps.json" dbkey="89"/>
130 </collection>
131 </param>
132 <param name="input_newick_collection">
133 <collection type="list">
134 <element name="Mbovis-01_snps.newick" value="Mbovis-01_snps.newick" dbkey="89"/>
135 <element name="Mbovis-01D_snps.newick" value="Mbovis-01D_snps.newick" dbkey="89"/>
136 <element name="Mbovis-01D6_snps.newick" value="Mbovis-01D6_snps.newick" dbkey="89"/>
137 </collection>
138 </param>
139 <param name="input_avg_mq_json_collection">
140 <collection type="list">
141 <element name="Mbovis-01_snps.json" value="Mbovis-01_avg_mq.json" dbkey="89"/>
142 <element name="Mbovis-01D_snps.json" value="Mbovis-01D_avg_mq.json" dbkey="89"/>
143 <element name="Mbovis-01D6_snps.json" value="Mbovis-01D6_avg_mq.json" dbkey="89"/>
144 </collection>
145 </param>
89 <param name="gbk_param" value="no"/> 146 <param name="gbk_param" value="no"/>
90 <output_collection name="excel" type="list" count="2"> 147 <output_collection name="excel" type="list" count="6">
91 <element name="Mbovis-01_snps_newick_cascade_table" file="Mbovis-01_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 148 <element name="Mbovis-01D6_snps_cascade_table" ftype="xlsx">
92 <element name="Mbovis-01_snps_newick_sort_table" file="Mbovis-01_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 149 <assert_contents>
93 </output_collection> 150 <has_size value="6854" delta="100"/>
94 </test> 151 </assert_contents>
95 <test> 152 </element>
96 <param name="input_snps_json" value="Mbovis-01D_snps.json" ftype="json" dbkey="89"/> 153 <element name="Mbovis-01D6_snps_sort_table" ftype="xlsx">
97 <param name="input_newick" value="Mbovis-01D_snps.newick" ftype="newick" dbkey="89"/> 154 <assert_contents>
98 <param name="input_avg_mq_json" value="Mbovis-01D_avg_mq.json" ftype="json" dbkey="89"/> 155 <has_size value="6847" delta="100"/>
99 <param name="gbk_param" value="no"/> 156 </assert_contents>
100 <output_collection name="excel" type="list" count="2"> 157 </element>
101 <element name="Mbovis-01D_snps_newick_cascade_table" file="Mbovis-01D_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 158 <element name="Mbovis-01D_snps_cascade_table" ftype="xlsx">
102 <element name="Mbovis-01D_snps_newick_sort_table" file="Mbovis-01D_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 159 <assert_contents>
103 </output_collection> 160 <has_size value="6854" delta="100"/>
104 </test> 161 </assert_contents>
105 <test> 162 </element>
106 <param name="input_snps_json" value="Mbovis-01D6_snps.json" ftype="json" dbkey="89"/> 163 <element name="Mbovis-01D_snps_sort_table" ftype="xlsx">
107 <param name="input_newick" value="Mbovis-01D6_snps.newick" ftype="newick" dbkey="89"/> 164 <assert_contents>
108 <param name="input_avg_mq_json" value="Mbovis-01D6_avg_mq.json" ftype="json" dbkey="89"/> 165 <has_size value="6847" delta="100"/>
109 <param name="gbk_param" value="no"/> 166 </assert_contents>
110 <output_collection name="excel" type="list" count="2"> 167 </element>
111 <element name="Mbovis-01D6_snps_newick_cascade_table" file="Mbovis-01D6_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 168 <element name="Mbovis-01_snps_cascade_table" ftype="xlsx">
112 <element name="Mbovis-01D6_snps_newick_sort_table" file="Mbovis-01D6_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 169 <assert_contents>
170 <has_size value="6853" delta="100"/>
171 </assert_contents>
172 </element>
173 <element name="Mbovis-01_snps_sort_table" ftype="xlsx">
174 <assert_contents>
175 <has_size value="6847" delta="100"/>
176 </assert_contents>
177 </element>
113 </output_collection> 178 </output_collection>
114 </test> 179 </test>
115 </tests> 180 </tests>
116 <help> 181 <help>
117 **What it does** 182 **What it does**
142 207
143 .. _vSNP documentation: https://github.com/USDA-VS/vSNP/blob/master/docs/detailed_usage.md 208 .. _vSNP documentation: https://github.com/USDA-VS/vSNP/blob/master/docs/detailed_usage.md
144 209
145 **Required Options** 210 **Required Options**
146 211
212 * **Choose the category for the files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single SNPs json, average MQ json and newick files, or collections of each) based on the selected option.
147 * **Use Genbank file** - Select "yes" to annotate the tables using the information in the Genbank file. Locally cached files, if available, provide the most widely used annotations, but more custom Genbank files can be chosen from the current history. 213 * **Use Genbank file** - Select "yes" to annotate the tables using the information in the Genbank file. Locally cached files, if available, provide the most widely used annotations, but more custom Genbank files can be chosen from the current history.
148 </help> 214 </help>
149 <expand macro="citations"/> 215 <expand macro="citations"/>
150 </tool> 216 </tool>
151 217