comparison uniprotxml_downloader.xml @ 7:4ddc8da62671 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/uniprotxml_downloader commit 91705a9789b30878a55d1044c654e39a7726cf60
author galaxyp
date Wed, 11 Dec 2024 13:34:54 +0000
parents a371252a2cf6
children
comparison
equal deleted inserted replaced
6:a371252a2cf6 7:4ddc8da62671
1 <tool id="uniprotxml_downloader" name="UniProt" version="2.4.0" profile="21.01"> 1 <tool id="uniprotxml_downloader" name="UniProt" version="2.5.0" profile="23.1">
2 <description>download proteome as XML or fasta</description> 2 <description>download proteome as XML or fasta</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <xml name="query_field">
5 <param name="field" type="select" label="Field">
6 <option value="taxonomy_name">Taxonomy Name</option>
7 <option value="taxonomy_id">Taxonomy ID</option>
8 <option value="accession">Accession</option>
9 </param>
10 </xml>
5 </macros> 11 </macros>
6 <requirements> 12 <requirements>
7 <requirement type="package" version="2.25.1">requests</requirement> 13 <requirement type="package" version="2.25.1">requests</requirement>
8 </requirements> 14 </requirements>
9 <stdio> 15 <stdio>
26 #elif $input_method.input_choice == 'history': 32 #elif $input_method.input_choice == 'history':
27 --field $input_method.field 33 --field $input_method.field
28 --input='${input_method.id_file}' 34 --input='${input_method.id_file}'
29 --column=#echo int(str($input_method.column)) - 1# 35 --column=#echo int(str($input_method.column)) - 1#
30 #end if 36 #end if
31 --format $format 37 --format $format_cond.format
38 #if $format_cond.format == "tsv"
39 --output_columns #echo ','.join($format_cond.columns)
40 #end if
32 --output '${proteome}' 41 --output '${proteome}'
33 ]]> 42 ]]>
34 </command> 43 </command>
35 <inputs> 44 <inputs>
36 <conditional name="input_method"> 45 <conditional name="input_method">
37 <param name="input_choice" type="select" label="Select"> 46 <param name="input_choice" type="select" label="Select">
38 <option value="common">A Common Organism</option> 47 <option value="common">A Common Organism</option>
39 <option value="enter_ids">A manually entered list of Uniprot IDs</option> 48 <option value="enter_ids">A manually entered list of accessions or taxonomy IDs/names</option>
40 <option value="history">A history dataset with a column containing Uniprot IDs</option> 49 <option value="history">A history dataset with a column containing accessions or taxonomy IDs/names</option>
41 </param> 50 </param>
42 <when value="common"> 51 <when value="common">
43 <param name="organism" type="select" label="Common Organisms" 52 <param name="organism" type="select" label="Common Organisms"
44 help="select species for protein database"> 53 help="select species for protein database">
45 <options from_file="uniprot_taxons.loc"> 54 <options from_file="uniprot_taxons.loc">
70 <param name="id_file" type="data" format="tabular,txt" label="Dataset (tab separated) with ID column"/> 79 <param name="id_file" type="data" format="tabular,txt" label="Dataset (tab separated) with ID column"/>
71 <param name="column" type="data_column" data_ref="id_file" label="Column with ID"/> 80 <param name="column" type="data_column" data_ref="id_file" label="Column with ID"/>
72 <expand macro="query_field"/> 81 <expand macro="query_field"/>
73 </when> 82 </when>
74 </conditional> 83 </conditional>
75 <param name="format" type="select" label="uniprot output format"> 84 <conditional name="format_cond">
76 <option value="xml">xml</option> 85 <param name="format" type="select" label="uniprot output format">
77 <option value="fasta">fasta</option> 86 <option value="fasta">fasta</option>
78 </param> 87 <option value="tsv">TSV</option>
88 <option value="xml">xml</option>
89 </param>
90 <when value="fasta"/>
91 <when value="xml"/>
92 <when value="tsv">
93 <param name="columns" type="select" multiple="true">
94 <options from_url="https://rest.uniprot.org/configure/uniprotkb/result-fields">
95 <postprocess_expression type="ecma5.1"><![CDATA[${
96 var options = [];
97 inputs.forEach(function(group) {
98 var groupName = group.groupName;
99 group.fields.forEach(function(field) {
100 var D = ["accession", "id", "reviewed", "protein_name", "gene_names", "organism_name", "length"];
101 var selected = D.includes(field.name);
102 options.push([group.groupName + " - " + field.label, field.name, selected]);
103 });
104 });
105 return options;
106 }]]></postprocess_expression>
107 </options>
108 </param>
109 </when>
110 </conditional>
79 </inputs> 111 </inputs>
80 <outputs> 112 <outputs>
81 <data format="uniprotxml" name="proteome" label="UniProt.${format}"> 113 <data format="uniprotxml" name="proteome">
82 <change_format> 114 <change_format>
83 <when input="format" value="fasta" format="fasta" /> 115 <when input="format_cond.format" value="fasta" format="fasta" />
116 <when input="format_cond.format" value="tsv" format="tsv" />
84 </change_format> 117 </change_format>
85 </data> 118 </data>
86 </outputs> 119 </outputs>
87 <tests> 120 <tests>
88 <test> 121 <test>
89 <param name="input_choice" value="enter_ids"/> 122 <conditional name="input_method">
90 <param name="ids" value="1566990"/> 123 <param name="input_choice" value="enter_ids"/>
91 <param name="format" value="xml"/> 124 <param name="ids" value="1566990"/>
125 </conditional>
126 <conditional name="format_cond">
127 <param name="format" value="xml"/>
128 </conditional>
129 <output name="proteome" ftype="uniprotxml">
130 <assert_contents>
131 <has_text text="&lt;/uniprot&gt;" />
132 </assert_contents>
133 </output>
134 <assert_stdout>
135 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
136 <has_line line="Entries:0"/> <!-- searching by name using an ID -->
137 </assert_stdout>
138 </test>
139 <test>
140 <conditional name="input_method">
141 <param name="input_choice" value="enter_ids"/>
142 <param name="ids" value="765963,512562"/>
143 <param name="field" value="taxonomy_id"/>
144 </conditional>
145 <conditional name="format_cond">
146 <param name="format" value="fasta"/>
147 </conditional>
148 <output name="proteome" ftype="fasta">
149 <assert_contents>
150 <has_text text="Shi470" />
151 <has_text text="PeCan4" />
152 </assert_contents>
153 </output>
154 <assert_stdout>
155 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
156 <has_text_matching expression="Entries:\d+"/>
157 <has_line line="Entries:0" negate="true"/>
158 </assert_stdout>
159 </test>
160 <test>
161 <conditional name="input_method">
162 <param name="input_choice" value="enter_ids"/>
163 <param name="ids" value="Shi470,PeCan4"/>
164 <param name="field" value="taxonomy_name"/>
165 </conditional>
166 <conditional name="format_cond">
167 <param name="format" value="fasta" ftype="fasta"/>
168 </conditional>
92 <output name="proteome"> 169 <output name="proteome">
93 <assert_contents> 170 <assert_contents>
94 <has_text text="&lt;/uniprot&gt;" /> 171 <has_text text="Shi470" />
95 </assert_contents> 172 <has_text text="PeCan4" />
96 </output> 173 </assert_contents>
97 </test> 174 </output>
98 <test> 175 </test>
99 <param name="input_choice" value="enter_ids"/> 176 <test>
100 <param name="ids" value="765963,512562"/> 177 <conditional name="input_method">
101 <param name="field" value="taxonomy_id"/> 178 <param name="input_choice" value="enter_ids"/>
102 <param name="format" value="fasta"/> 179 <param name="ids" value="E1Q2I0,E1Q3C4"/>
103 <output name="proteome"> 180 <param name="field" value="accession"/>
104 <assert_contents> 181 </conditional>
105 <has_text text="Shi470" /> 182 <conditional name="format_cond">
106 <has_text text="PeCan4" /> 183 <param name="format" value="fasta"/>
107 </assert_contents> 184 </conditional>
108 </output> 185 <output name="proteome" ftype="fasta">
109 </test>
110 <test>
111 <param name="input_choice" value="enter_ids"/>
112 <param name="ids" value="Shi470,PeCan4"/>
113 <param name="field" value="taxonomy_name"/>
114 <param name="format" value="fasta"/>
115 <output name="proteome">
116 <assert_contents>
117 <has_text text="Shi470" />
118 <has_text text="PeCan4" />
119 </assert_contents>
120 </output>
121 </test>
122 <test>
123 <param name="input_choice" value="enter_ids"/>
124 <param name="ids" value="E1Q2I0,E1Q3C4"/>
125 <param name="field" value="accession"/>
126 <param name="format" value="fasta"/>
127 <output name="proteome">
128 <assert_contents> 186 <assert_contents>
129 <has_text text="E1Q2I0" /> 187 <has_text text="E1Q2I0" />
130 <has_text text="E1Q3C4" /> 188 <has_text text="E1Q3C4" />
131 </assert_contents> 189 </assert_contents>
132 </output> 190 </output>
133 </test> 191 <assert_stdout>
134 <test> 192 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
135 <param name="input_choice" value="history"/> 193 <has_text_matching expression="Entries:\d+"/>
136 <param name="id_file" value="Helicobacter_strains.tsv" ftype="tabular"/> 194 <has_line line="Entries:0" negate="true"/>
137 <param name="column" value="1"/> 195 </assert_stdout>
138 <param name="field" value="taxonomy_name"/> 196 </test>
197 <test>
198 <conditional name="input_method">
199 <param name="input_choice" value="history"/>
200 <param name="id_file" value="Helicobacter_strains.tsv" ftype="tabular"/>
201 <param name="column" value="1"/>
202 <param name="field" value="taxonomy_name"/>
203 </conditional>
204 <conditional name="format_cond">
205 <param name="format" value="fasta"/>
206 </conditional>
207 <output name="proteome" ftype="fasta">
208 <assert_contents>
209 <has_text text="Shi470" />
210 <has_text text="PeCan4" />
211 </assert_contents>
212 </output>
213 <assert_stdout>
214 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
215 <has_text_matching expression="Entries:\d+"/>
216 <has_line line="Entries:0" negate="true"/>
217 </assert_stdout>
218 </test>
219 <test>
220 <conditional name="input_method">
221 <param name="input_choice" value="history"/>
222 <param name="id_file" value="Helicobacter_strains_ids.tsv" ftype="tabular"/>
223 <param name="column" value="2"/>
224 <param name="field" value="taxonomy_id"/>
225 </conditional>
226 <conditional name="format_cond">
139 <param name="format" value="fasta"/> 227 <param name="format" value="fasta"/>
140 <output name="proteome"> 228 </conditional>
141 <assert_contents> 229 <output name="proteome" ftype="fasta">
142 <has_text text="Shi470" /> 230 <assert_contents>
143 <has_text text="PeCan4" /> 231 <has_text text="Shi470" />
144 </assert_contents> 232 <has_text text="PeCan4" />
145 </output> 233 </assert_contents>
146 </test> 234 </output>
147 <test> 235 <assert_stdout>
148 <param name="input_choice" value="history"/> 236 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
149 <param name="id_file" value="Helicobacter_strains_ids.tsv" ftype="tabular"/> 237 <has_text_matching expression="Entries:\d+"/>
150 <param name="column" value="2"/> 238 <has_line line="Entries:0" negate="true"/>
151 <param name="field" value="taxonomy_id"/> 239 </assert_stdout>
152 <param name="format" value="fasta"/> 240 </test>
153 <output name="proteome"> 241 <test>
154 <assert_contents> 242 <conditional name="input_method">
155 <has_text text="Shi470" /> 243 <param name="input_choice" value="history"/>
156 <has_text text="PeCan4" /> 244 <param name="id_file" value="Helicobacter_protein_accessions.tsv" ftype="tabular"/>
157 </assert_contents> 245 <param name="column" value="1"/>
158 </output> 246 <param name="field" value="accession"/>
159 </test> 247 </conditional>
160 <test> 248 <conditional name="format_cond">
161 <param name="input_choice" value="history"/> 249 <param name="format" value="fasta"/>
162 <param name="id_file" value="Helicobacter_protein_accessions.tsv" ftype="tabular"/> 250 </conditional>
163 <param name="column" value="1"/> 251 <output name="proteome" ftype="fasta">
164 <param name="field" value="accession"/>
165 <param name="format" value="fasta"/>
166 <output name="proteome">
167 <assert_contents> 252 <assert_contents>
168 <has_text text="E1Q2I0" /> 253 <has_text text="E1Q2I0" />
169 <has_text text="E1Q3C4" /> 254 <has_text text="E1Q3C4" />
170 </assert_contents> 255 </assert_contents>
171 </output> 256 </output>
257 <assert_stdout>
258 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
259 <has_text_matching expression="Entries:\d+"/>
260 <has_line line="Entries:0" negate="true"/>
261 </assert_stdout>
262 </test>
263 <!-- tsv output -->
264 <test>
265 <conditional name="input_method">
266 <param name="input_choice" value="enter_ids"/>
267 <param name="ids" value="765963,512562"/>
268 <param name="field" value="taxonomy_id"/>
269 </conditional>
270 <conditional name="format_cond">
271 <param name="format" value="tsv"/>
272 </conditional>
273 <output name="proteome" ftype="tsv">
274 <assert_contents>
275 <has_n_columns n="7" />
276 <has_text text="Shi470" />
277 <has_text text="PeCan4" />
278 </assert_contents>
279 </output>
280 <assert_stdout>
281 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
282 <has_text_matching expression="Entries:\d+"/>
283 <has_line line="Entries:0" negate="true"/>
284 </assert_stdout>
285 </test>
286 <!-- tsv output non default columns-->
287 <test>
288 <conditional name="input_method">
289 <param name="input_choice" value="enter_ids"/>
290 <param name="ids" value="765963,512562"/>
291 <param name="field" value="taxonomy_id"/>
292 </conditional>
293 <conditional name="format_cond">
294 <param name="format" value="tsv"/>
295 <param name="columns" value="accession,sequence"/>
296 </conditional>
297 <output name="proteome" ftype="tsv">
298 <assert_contents>
299 <has_n_columns n="2" />
300 <has_text text="Shi470" negate="true"/>
301 <has_text text="B2US14" />
302 </assert_contents>
303 </output>
304 <assert_stdout>
305 <has_text_matching expression="UniProt-Release:\d{4}_\d{2}"/>
306 <has_text_matching expression="Entries:\d+"/>
307 <has_line line="Entries:0" negate="true"/>
308 </assert_stdout>
172 </test> 309 </test>
173 </tests> 310 </tests>
174 <help> 311 <help>
175 <![CDATA[ 312 <![CDATA[
176 **UniProt Downloader** 313 **UniProt Downloader**