comparison gmql_rest_datasets_upload.xml @ 0:078d77023c34 draft default tip

planemo upload for repository https://github.com/lu-brn/gmql-galaxy commit 953ee36ceda5814dc9baa03427bc0eb4ee2e93bd-dirty
author geco-team
date Tue, 26 Jun 2018 08:59:19 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:078d77023c34
1 <tool id="gmql_upload" name="GMLQ Upload Dataset" version="0.1.1">
2 <macros>
3 <import>gmql_rest_macros.xml</import>
4 </macros>
5 <command><![CDATA[
6 python $__tool_directory__/gmql_rest_datasets.py $output
7 -user=$authToken
8 -dataset=$name
9 #if $upload.source == 'remote'
10 -cmd=upload_url
11 #if $upload.schema.schema_type == "custom" :
12 -schema=$upload.schema.schema_url
13 #else :
14 -schema=$upload.schema.schema_type
15 #end if
16 -samples=$upload.samples_urls
17 #else:
18 -cmd=upload
19 #if $upload.schema_local.schema_type == "custom" :
20 -schema=$upload.schema_local.schema
21 #else :
22 -schema=$upload.schema_local.schema_type
23 #end if
24 -samples=$samples
25 #end if
26 -add_output=$updated_list
27 ]]></command>
28 <configfiles>
29 <configfile name="samples" >#if $upload.source == 'local' :
30 #if $upload.stype.st_flag == 'one' :
31 #echo '%s\t%s\n'%($upload.stype.samples.name,$upload.stype.samples)
32 #else :
33 #for $i in $upload.stype.samples :
34 #echo '%s\t%s\n'%($i.name,$i)
35 #end for
36 #end if
37 #end if
38 <!-- #if $upload.samples.is_collection :
39 #for $i in $upload.samples
40 #for $file in $i
41 #echo '%s\t%s\n'%($file.element_identifier,$file)
42 #end for
43 #else :
44 #echo '%s\t%s\n'%($i.name,$i)
45 #end if
46 #end for
47 #else :
48 #echo '%s\t%s\n'%($upload.samples.name,$upload.samples)
49 #end if
50 #end if -->
51 </configfile>
52 </configfiles>
53 <code file="dynamic_utils.py">
54 <hook validate_input="validate_upload" />
55 </code>
56 <inputs>
57 <param format="gmql_user" name="authToken" type="data" label="Select user" />
58 <param name="name" type="text" label="Name of the new dataset" >
59 <validator type="regex" message="Only alphanumeric characters and underscore are allowed">[\w]+$</validator>
60 </param>
61 <conditional name="upload">
62 <param name="source" type="select" label="Upload from local or another server" display="radio" multiple="false">
63 <option value="local">Local</option>
64 <option value="remote">Provide Urls</option>
65 </param>
66 <when value="remote">
67 <conditional name="schema">
68 <param name="schema_type" type="select" label="File type" >
69 <option value="bed">bed</option>
70 <option value="bedGraph">bedGraph</option>
71 <option value="NarrowPeak">NarrowPeak</option>
72 <option value="BroadPeak">BroadPeak</option>
73 <option value="vcf">vcf</option>
74 <option value="custom">Custom</option>
75 </param>
76 <when value="custom">
77 <param name="schema_url" type="text" format="text" size="80" label="Schema URL">
78 <validator type="regex" message="Does not look as a valid url">[\w:/\.\?@#+-=&amp;]+$</validator>
79 <sanitizer>
80 <valid initial="default">
81 <remove value="&amp;"/>
82 </valid>
83 <mapping initial="default">
84 <add source="&amp;" target="__amp__" />
85 </mapping>
86 </sanitizer>
87 </param>
88 </when>
89 </conditional>
90 <param name="samples_urls" type="text" format="text" area="True" size="10x80" label="Samples URLs">
91 <validator type="regex" message="Please one url per line">[\w:/\.\?@#+-=%&amp;]+(\n[\w:/\.\?@#+-=%&amp;]+)*$</validator>
92 <sanitizer>
93 <valid initial="default">
94 <remove value="&amp;"/>
95 </valid>
96 <mapping initial="default">
97 <add source="X" target="__cn__" />
98 <add source="&amp;" target="__amp__" />
99 </mapping>
100 </sanitizer>
101 </param>
102 </when>
103 <when value="local">
104 <conditional name="schema_local">
105 <param name="schema_type" type="select" label="File type" >
106 <option value="bed">bed</option>
107 <option value="bedGraph">bedGraph</option>
108 <option value="NarrowPeak">NarrowPeak</option>
109 <option value="BroadPeak">BroadPeak</option>
110 <option value="vcf">vcf</option>
111 <option value="custom">Custom</option>
112 </param>
113 <when value="custom">
114 <param name="schema" type="data" format="xml" label="Schema XML Definition" />
115 </when>
116 </conditional>
117 <conditional name="stype">
118 <param name="st_flag" type="select" display="radio" label="Single Sample or Collection?">
119 <option value="one">Single Sample</option>
120 <option value="more">Collection</option>
121 </param>
122 <when value="one">
123 <param name="samples" type="data" label="Data: " />
124 </when>
125 <when value="more">
126 <param name="samples" type="data_collection" collection_type="list" label="Data: "/>
127 </when>
128 </conditional>
129 </when>
130 </conditional>
131 </inputs>
132 <outputs>
133 <data format="tabular" name="output" label="${name} updated samples" >
134 <actions>
135 <action name="column_names" type="metadata" default="id,sample,ext" />
136 </actions>
137 </data>
138 <data format="gmql_repository" name="updated_list" label="${authToken.name.split()[0].rstrip('')} GMQL Datasets">
139 <actions>
140 <action name="column_names" type="metadata" default="dataset,owner" />
141 </actions>
142 </data>
143 </outputs>
144 <tests>
145 <test>
146 <param name="authToken" value="guest.gmql_user" />
147 <param name="name" value="test1" />
148 <conditional name="upload">
149 <param name="source" value="remote" />
150 <conditional name="schema">
151 <param name="schema_type" value="custom" />
152 <param name="schema_url" value="http://www.bioinformatics.deib.polimi.it/canakoglu/guest_data/HG19_ANN.schema" />
153 </conditional>
154 <param name="samples_urls" value="http://www.bioinformatics.deib.polimi.it/canakoglu/guest_data/VistaEnhancers_hg19.bed" />
155 </conditional>
156 <output name="updated_list" ftype="gmql_repository">
157 <assert_contents>
158 <has_n_columns n="2" />
159 <has_line_matching expression="test1\t.+" />
160 </assert_contents>
161 </output>
162 <output name="output" ftype="gmql_repository">
163 <metadata name="name" value="test1 updated samples" />
164 <assert_contents>
165 <has_n_columns n="3" />
166 <has_line_matching expression=".+\tVistaEnhancers_hg19\tbed.+" />
167 </assert_contents>
168 </output>
169 </test>
170 <test>
171 <param name="authToken" value="guest.gmql_user" />
172 <param name="name" value="test2" />
173 <conditional name="upload">
174 <param name="source" value="local" />
175 <conditional name="schema_local">
176 <param name="schema_type" value="bed" />
177 </conditional>
178 <conditional name="stype">
179 <param name="stflag" value="one" />
180 <param name="samples" value="sample2.bed" />
181 </conditional>
182 </conditional>
183 <output name="updated_list" ftype="gmql_repository">
184 <assert_contents>
185 <has_n_columns n="2" />
186 <has_line_matching expression="test2\t.+" />
187 </assert_contents>
188 </output>
189 <output name="output" ftype="gmql_repository">
190 <metadata name="name" value="test2 updated samples" />
191 <assert_contents>
192 <has_n_columns n="3" />
193 <has_text text="sample2" />
194 </assert_contents>
195 </output>
196 </test>
197 <test>
198 <param name="authToken" value="guest.gmql_user" />
199 <param name="name" value="test3" />
200 <conditional name="upload">
201 <param name="source" value="local" />
202 <conditional name="schema_local">
203 <param name="schema_type" value="bed" />
204 </conditional>
205 <conditional name="stype">
206 <param name="stflag" value="more" />
207 <param name="samples">
208 <collection type="list">
209 <element name="sample1" value="sample1.bed" />
210 <element name="sample2" value="sample2.bed" />
211 </collection>
212 </param>
213 </conditional>
214 </conditional>
215 <output name="updated_list" ftype="gmql_repository">
216 <assert_contents>
217 <has_n_columns n="2" />
218 <has_line_matching expression="test3\t.+" />
219 </assert_contents>
220 </output>
221 <output name="output" ftype="gmql_repository">
222 <metadata name="name" value="test3 updated samples" />
223 <assert_contents>
224 <has_n_columns n="3" />
225 <has_text text="sample1" />
226 <has_text text="sample2" />
227 </assert_contents>
228 </output>
229
230 </test>
231 </tests>
232 <help>
233 It allows uploading a new dataset on the user’s private space of the GMQL Repository.
234
235 ----
236
237 **What it does**
238
239 - **Upload local data**: data to upload are in the current galaxy history
240 - **Upload remote data**: data is on a remote location, URLs must be provided
241
242 The user must provide a name for the new dataset, the locations of the samples and their reference schema. Schema can
243 be a common type or custom. In this second case, schema xml or its location must be provided.
244
245 .. class:: warningmark
246
247 A gmql_user authentication token is required for every action.
248
249 ----
250
251 .. class:: infomark
252
253 **File formats**
254
255 Formats accepted for data are:
256
257 - bed
258 - bedGraph
259 - NarrowPeak
260 - BroadPeak
261 - vcf
262
263
264 </help>
265 <expand macro="citations" />
266 </tool>