comparison vsnp_build_tables.xml @ 4:efb86aade548 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 2e312886647244b416c64eca91e1a61dd1be939b"
author iuc
date Thu, 10 Dec 2020 15:25:53 +0000
parents 0bc0009f9ea0
children b08cc87b2888
comparison
equal deleted inserted replaced
3:85587c8eb25f 4:efb86aade548
1 <tool id="vsnp_build_tables" name="vSNP: build tables" version="@WRAPPER_VERSION@.0" profile="@PROFILE@"> 1 <tool id="vsnp_build_tables" name="vSNP: build tables" version="@WRAPPER_VERSION@.1" 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>
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 <requirement type="package" version="1.2.8">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 #set output_excel_dir = 'output_excel_dir' 13
14 #set input_type = $input_type_cond.input_type 14 mkdir 'output_excel_dir' &&
15 mkdir $output_excel_dir && 15
16 #if $input_type == "collection": 16 ## The input_snps_json and input_avg_mq_json identifiers
17 #set input_newick_dir = 'input_newick_dir' 17 ## are typically the same string, so we append a uniquq
18 mkdir $input_newick_dir && 18 ## extension to enable the links.
19 #set input_json_avg_mq_dir = 'input_json_avg_mq_dir' 19 #set input_snps_json_identifier = re.sub('[^\s\w\-]', '_', str($input_snps_json.element_identifier)) + '.snps'
20 mkdir $input_json_avg_mq_dir && 20 ln -s '${input_snps_json}' '${input_snps_json_identifier}' &&
21 #set input_json_dir = 'input_json_dir' 21 #set input_avg_mq_json_identifier = re.sub('[^\s\w\-]', '_', str($input_avg_mq_json.element_identifier)) + '.avg_mq'
22 mkdir $input_json_dir && 22 ln -s '${input_avg_mq_json}' '${input_avg_mq_json_identifier}' &&
23 #for $i in $input_type_cond.input_avg_mq_json_collection: 23 #set input_newick_identifier = re.sub('[^\s\w\-]', '_', str($input_newick.element_identifier))
24 #set file_name = $i.file_name 24 ln -s '${input_newick}' '${input_newick_identifier}' &&
25 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier)) 25
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
39 python '$__tool_directory__/vsnp_build_tables.py' 26 python '$__tool_directory__/vsnp_build_tables.py'
40 --processes \${GALAXY_SLOTS:-4} 27 --input_snps_json '${input_snps_json_identifier}'
41 #if $input_type == "single": 28 --input_avg_mq_json '${input_avg_mq_json_identifier}'
42 --input_avg_mq_json '$input_avg_mq_json' 29 --input_newick '${input_newick_identifier}'
43 --input_snps_json '$input_snps_json' 30 #if str($gbk_cond.gbk_param) == 'yes':
44 --input_newick '$input_newick' 31 #if str($gbk_cond.gbk_source_cond.gbk_source) == 'cached':
45 #end if: 32 --gbk_file '$gbk_cond.gbk_source_cond.gbk_file.fields.path'
46 #if str($gbk_cond.gbk_param) == "yes":
47 #set gbk_source_cond = $gbk_cond.gbk_source_cond
48 #set gbk_source = $gbk_source_cond.gbk_source
49 #if str($gbk_source) == "cached":
50 --gbk_file '$gbk_source_cond.gbk_file.fields.path'
51 #else: 33 #else:
52 --gbk_file '$gbk_source_cond.gbk_file' 34 --gbk_file '$gbk_cond.gbk_source_cond.gbk_file'
53 #end if 35 #end if
54 #end if 36 #end if
55 ]]></command> 37 ]]></command>
56 <inputs> 38 <inputs>
57 <conditional name="input_type_cond"> 39 <param name="input_snps_json" type="data" format="json" label="SNPs json file"/>
58 <expand macro="param_input_type"/> 40 <param name="input_avg_mq_json" type="data" format="json" label="Average MQ json file"/>
59 <when value="single"> 41 <param name="input_newick" type="data" format="newick" label="Best-scoring ML tree file"/>
60 <param name="input_snps_json" type="data" format="json" label="SNPs json file">
61 <validator type="unspecified_build"/>
62 </param>
63 <param name="input_avg_mq_json" type="data" format="json" label="Average MQ json file">
64 <validator type="unspecified_build"/>
65 </param>
66 <param name="input_newick" type="data" format="newick" label="Best-scoring ML tree file">
67 <validator type="unspecified_build"/>
68 </param>
69 </when>
70 <when value="collection">
71 <param name="input_snps_json_collection" format="json" type="data_collection" collection_type="list" label="Collection of SNPs json files">
72 <validator type="unspecified_build"/>
73 </param>
74 <param name="input_avg_mq_json_collection" format="json" type="data_collection" collection_type="list" label="Collection of average MQ json files">
75 <validator type="unspecified_build"/>
76 </param>
77 <param name="input_newick_collection" format="newick" type="data_collection" collection_type="list" label="Collection of best-scoring ML tree files">
78 <validator type="unspecified_build"/>
79 </param>
80 </when>
81 </conditional>
82 <conditional name="gbk_cond"> 42 <conditional name="gbk_cond">
83 <param name="gbk_param" type="select" label="Use Genbank file?"> 43 <param name="gbk_param" type="select" label="Use Genbank file?">
84 <option value="yes" selected="true">yes</option> 44 <option value="yes" selected="true">yes</option>
85 <option value="no">No</option> 45 <option value="no">No</option>
86 </param> 46 </param>
91 <option value="history">from history</option> 51 <option value="history">from history</option>
92 </param> 52 </param>
93 <when value="cached"> 53 <when value="cached">
94 <param name="gbk_file" type="select" label="Genbank file"> 54 <param name="gbk_file" type="select" label="Genbank file">
95 <options from_data_table="vsnp_genbank"> 55 <options from_data_table="vsnp_genbank">
96 <!-- No filter here! --> 56 <filter type="data_meta" column="value" key="value" 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"/>
97 </options> 58 </options>
98 <validator type="no_options" message="A cached Genbank file is not available for the build associated with the selected average MQ json file"/>
99 </param> 59 </param>
100 </when> 60 </when>
101 <when value="history"> 61 <when value="history">
102 <param name="gbk_file" type="data" format="genbank" label="Genbank file"> 62 <param name="gbk_file" type="data" format="genbank" label="Genbank file">
103 <validator type="no_options" message="The current history does not include a genbank dataset"/> 63 <validator type="no_options" message="The current history does not include a genbank dataset"/>
107 </when> 67 </when>
108 <when value="no"/> 68 <when value="no"/>
109 </conditional> 69 </conditional>
110 </inputs> 70 </inputs>
111 <outputs> 71 <outputs>
112 <collection name="excel" type="list"> 72 <collection name="excel" type="list" label="${tool.name} on ${on_string}">
113 <discover_datasets pattern="__name__" directory="output_excel_dir" format="xlsx" /> 73 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;xlsx)" directory="output_excel_dir"/>
114 </collection> 74 </collection>
115 </outputs> 75 </outputs>
116 <tests> 76 <tests>
117 <test> 77 <test>
118 <param name="input_snps_json" value="input_snps_json.json" ftype="json" dbkey="89"/> 78 <param name="input_snps_json" value="input_snps_json.json" ftype="json" dbkey="89"/>
119 <param name="input_newick" value="input_newick.newick" ftype="newick" dbkey="89"/> 79 <param name="input_newick" value="input_newick.newick" ftype="newick" dbkey="89"/>
120 <param name="input_avg_mq_json" value="input_avg_mq_json.json" ftype="json" dbkey="89"/> 80 <param name="input_avg_mq_json" value="input_avg_mq_json.json" ftype="json" dbkey="89"/>
121 <param name="gbk_param" value="no"/> 81 <param name="gbk_param" value="no"/>
122 <output_collection name="excel" type="list"> 82 <output_collection name="excel" type="list" count="2">
123 <element name="cascade_table.xlsx" file="cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 83 <element name="input_newick_newick_cascade_table" file="cascade_table.xlsx" ftype="xlsx" compare="sim_size"/>
124 <element name="sort_table.xlsx" file="sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 84 <element name="input_newick_newick_sort_table" file="sort_table.xlsx" ftype="xlsx" compare="sim_size"/>
125 </output_collection> 85 </output_collection>
126 </test> 86 </test>
127 <test> 87 <test>
128 <param name="input_type" value="collection"/> 88 <param name="input_snps_json" value="Mbovis-01_snps.json" ftype="json" dbkey="89"/>
129 <param name="input_snps_json_collection"> 89 <param name="input_newick" value="Mbovis-01_snps.newick" ftype="newick" dbkey="89"/>
130 <collection type="list"> 90 <param name="input_avg_mq_json" value="Mbovis-01_avg_mq.json" ftype="json" dbkey="89"/>
131 <element name="Mbovis-01_snps.json" value="Mbovis-01_snps.json" dbkey="89"/>
132 <element name="Mbovis-01D_snps.json" value="Mbovis-01D_snps.json" dbkey="89"/>
133 <element name="Mbovis-01D6_snps.json" value="Mbovis-01D6_snps.json" dbkey="89"/>
134 </collection>
135 </param>
136 <param name="input_newick_collection">
137 <collection type="list">
138 <element name="Mbovis-01_snps.newick" value="Mbovis-01_snps.newick" dbkey="89"/>
139 <element name="Mbovis-01D_snps.newick" value="Mbovis-01D_snps.newick" dbkey="89"/>
140 <element name="Mbovis-01D6_snps.newick" value="Mbovis-01D6_snps.newick" dbkey="89"/>
141 </collection>
142 </param>
143 <param name="input_avg_mq_json_collection">
144 <collection type="list">
145 <element name="Mbovis-01_snps.json" value="Mbovis-01_avg_mq.json" dbkey="89"/>
146 <element name="Mbovis-01D_snps.json" value="Mbovis-01D_avg_mq.json" dbkey="89"/>
147 <element name="Mbovis-01D6_snps.json" value="Mbovis-01D6_avg_mq.json" dbkey="89"/>
148 </collection>
149 </param>
150 <param name="gbk_param" value="no"/> 91 <param name="gbk_param" value="no"/>
151 <output_collection name="excel" type="list"> 92 <output_collection name="excel" type="list" count="2">
152 <element name="Mbovis-01D6_snps_cascade_table.xlsx" file="Mbovis-01D6_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 93 <element name="Mbovis-01_snps_cascade_table" file="Mbovis-01_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/>
153 <element name="Mbovis-01D6_snps_sort_table.xlsx" file="Mbovis-01D6_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 94 <element name="Mbovis-01_snps_sort_table" file="Mbovis-01_sort_table.xlsx" ftype="xlsx" compare="sim_size"/>
154 <element name="Mbovis-01D_snps_cascade_table.xlsx" file="Mbovis-01D_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 95 </output_collection>
155 <element name="Mbovis-01D_snps_sort_table.xlsx" file="Mbovis-01D_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 96 </test>
156 <element name="Mbovis-01_snps_cascade_table.xlsx" file="Mbovis-01_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/> 97 <test>
157 <element name="Mbovis-01_snps_sort_table.xlsx" file="Mbovis-01_sort_table.xlsx" ftype="xlsx" compare="sim_size"/> 98 <param name="input_snps_json" value="Mbovis-01D_snps.json" ftype="json" dbkey="89"/>
99 <param name="input_newick" value="Mbovis-01D_snps.newick" ftype="newick" dbkey="89"/>
100 <param name="input_avg_mq_json" value="Mbovis-01D_avg_mq.json" ftype="json" dbkey="89"/>
101 <param name="gbk_param" value="no"/>
102 <output_collection name="excel" type="list" count="2">
103 <element name="Mbovis-01D_snps_cascade_table" file="Mbovis-01D_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/>
104 <element name="Mbovis-01D_sort_table" file="Mbovis-01D_sort_table.xlsx" ftype="xlsx" compare="sim_size"/>
105 </output_collection>
106 </test>
107 <test>
108 <param name="input_snps_json" value="Mbovis-01D6_snps.json" ftype="json" dbkey="89"/>
109 <param name="input_newick" value="Mbovis-01D6_snps.newick" ftype="newick" dbkey="89"/>
110 <param name="input_avg_mq_json" value="Mbovis-01D6_avg_mq.json" ftype="json" dbkey="89"/>
111 <param name="gbk_param" value="no"/>
112 <output_collection name="excel" type="list" count="2">
113 <element name="Mbovis-01D6_cascade_table" file="Mbovis-01D6_cascade_table.xlsx" ftype="xlsx" compare="sim_size"/>
114 <element name="Mbovis-01D6_sort_table" file="Mbovis-01D6_sort_table.xlsx" ftype="xlsx" compare="sim_size"/>
158 </output_collection> 115 </output_collection>
159 </test> 116 </test>
160 </tests> 117 </tests>
161 <help> 118 <help>
162 **What it does** 119 **What it does**
187 144
188 .. _vSNP documentation: https://github.com/USDA-VS/vSNP/blob/master/docs/detailed_usage.md 145 .. _vSNP documentation: https://github.com/USDA-VS/vSNP/blob/master/docs/detailed_usage.md
189 146
190 **Required Options** 147 **Required Options**
191 148
192 * **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.
193 * **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. 149 * **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.
194 </help> 150 </help>
195 <expand macro="citations"/> 151 <expand macro="citations"/>
196 </tool> 152 </tool>
197 153