comparison gmql_rest_queries_editor.xml @ 0:c74a1c7121ec 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:49 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c74a1c7121ec
1 <tool id="gmql_queries_editor" name="GMLQ Query Editor" version="0.1.1">
2 <description>Compile and run GMQL queries (Advanced Mode)</description>
3 <macros>
4 <import>gmql_rest_macros.xml</import>
5 </macros>
6 <command><![CDATA[
7 #if $mode.exec_mode == "execute" :
8 python $__tool_directory__/gmql_rest_queries.py
9 -user=$authToken
10 -cmd=execute
11 -name=$query_name
12 #if $query_create.create == "yes" :
13 -query=$query_text
14 #else :
15 -query=$query_file
16 #end if
17 -log=$log
18 -format=$mode.out_format
19 -importFlag=$mode.import
20 -add_output=$updated_list
21 #else :
22 python $__tool_directory__/gmql_rest_queries.py
23 -user=$authToken
24 -cmd=$mode.exec_mode
25 -name=$query_name
26 #if $query_create.create == "yes" :
27 -query=$query_text
28 #else :
29 -query=$query_file
30 #end if
31 -log=$log
32 #end if
33 ]]></command>
34 <configfiles>
35 <configfile name="query_text" >#if $query_create.create == 'yes' :
36 #echo '%s'%($query_create.query)
37 #end if</configfile>
38 </configfiles>
39 <code file="dynamic_utils.py">
40 <hook validate_input="validate" />
41 </code>
42 <inputs>
43 <param format="gmql_user" name="authToken" type="data" label="Select user" />
44 <param name="query_name" type="text" label="Query Name" >
45 <validator type="regex" message="Only alphanumeric characters and underscore allowed. It must begin with
46 letter or underscore.">[a-zA-Z_]([\w]+)?$</validator>
47 </param>
48 <conditional name="query_create">
49 <param name="create" type="select" display="radio" label="Write a new query or execute an existing one." >
50 <option value="yes">Write new one</option>
51 <option value="no">Run/Compile existing one</option>
52 </param>
53 <when value="yes">
54 <param name="query" type="text" area="true" label="Query" >
55 <sanitizer>
56 <valid initial="default">
57 <add value=";"/>
58 </valid>
59 <mapping initial="default">
60 <add source="X" target="__cn__" />
61 </mapping>
62 </sanitizer>
63 </param>
64 </when>
65 <when value="no">
66 <param label="Select GMQL Query" type="data" format="gmql_query" name="query_file" />
67 </when>
68 </conditional>
69 <conditional name="mode">
70 <param name="exec_mode" type="select" label="Compile or run query">
71 <option value="compile">Compile query</option>
72 <option value="execute">Execute query</option>
73 </param>
74 <when value="execute">
75 <param name="out_format" type="select" label="Output format">
76 <option value="gdm">TAB Delimited (GDM)</option>
77 <option value="gtf">GTF</option>
78 </param>
79 <param name="import" type="boolean" checked="true" label="Import result automatically into Galaxy?"
80 help="Otherwise it will be possible to import it later using GMQL Import Dataset tool." />
81 </when>
82 </conditional>
83 </inputs>
84 <outputs>
85 <data format="txt" name="log" label="${query_name} query log" />
86 <collection name="query_results_m" type="list" label="${query_name} results metadata">
87 <discover_datasets pattern="(?P&lt;identifier_0&gt;[\w]+)\.(?P&lt;ext&gt;[^\._]+)?"
88 directory="metadata"/>
89 <filter>mode['exec_mode'] == 'execute' and mode['import'] is True</filter>
90 </collection>
91 <collection name="query_results_s" type="list" label="${query_name} results">
92 <discover_datasets pattern="(?P&lt;identifier_0&gt;[\w]+)\.(?P&lt;ext&gt;[^\._]+)?"
93 directory="samples"/>
94 <filter>mode['exec_mode'] == 'execute' and mode['import'] is True</filter>
95 </collection>
96 <data format="gmql_repository" name="updated_list" label="${authToken.name.split()[0].rstrip('')} GMQL Datasets">
97 <filter>mode['exec_mode'] == 'execute'</filter>
98 <actions>
99 <action name="column_names" type="metadata" default="dataset,owner" />
100 </actions>
101 </data>
102 </outputs>
103 <tests>
104 <test>
105 <param name="authToken" value="guest.gmql_user"/>
106 <param name="query_name" value="testexec"/>
107 <conditional name="query_create">
108 <param name="create" value="yes"/>
109 <param name="query"
110 value="VAR = SELECT (grant == __sq__Stam__sq__) Example_Dataset_1 ;__cn__MATERIALIZE VAR INTO TG;"/>
111 </conditional>
112 <conditional name="mode">
113 <param name="exec_mode" value="execute"/>
114 <param name="out_format" value="gdm"/>
115 <param name="import" value="true"/>
116 </conditional>
117 <output name="log" ftype="txt">
118 <assert_contents>
119 <has_text text="SUCCESS"/>
120 </assert_contents>
121 </output>
122 <output name="updated_list" ftype="gmql_repository">
123 <assert_contents>
124 <has_text_matching expression="testexec_\d+_\d+_TG"/>
125 </assert_contents>
126 </output>
127 <collection name="query_results_s" type="list">
128 <metadata name="name" value="testexec results"/>
129 <discovered_dataset designation="S00000" file="TG/S_00000.gdm"/>
130 <discovered_dataset designation="S00001" file="TG/S_00001.gdm"/>
131 <discovered_dataset designation="S00002" file="TG/S_00002.gdm"/>
132 </collection>
133 <collection name="query_results_m" type="list">
134 <metadata name="name" value="testexec results metadata"/>
135 <discovered_dataset designation="S00000" file="TG/S_00000.gdm.meta"/>
136 <discovered_dataset designation="S00001" file="TG/S_00001.gdm.meta"/>
137 <discovered_dataset designation="S00002" file="TG/S_00002.gdm.meta"/>
138 </collection>
139 </test>
140 <test>
141 <param name="authToken" value="guest.gmql_user" />
142 <param name="query_name" value="testcompile" />
143 <conditional name="query_create">
144 <param name="create" value="no" />
145 <param name="query_file" value="query.gmql_query" />
146 </conditional>
147 <conditional name="mode">
148 <param name="exec_mode" value="compile" />
149 </conditional>
150 <output name="log" ftype="txt">
151 <assert_contents>
152 <has_text text="COMPILE_SUCCESS" />
153 </assert_contents>
154 </output>
155 </test>
156 </tests>
157 <help>
158 It allows writing a GMQL query directly in text form and send it to the GMQL system to be compiled and executed,
159 and in this second case it imports the resulting dataset into the current history. This has been thought as a tool for
160 advanced users who already knows GMQL and its syntax. See the linked GMQL documentation about it.
161
162 ----
163
164 **What it does**
165
166 Given a GMQL query in plain text, or a GMQL query saved in the current Galaxy history (gmql_query), requires its
167 compilation or execution.
168
169 - **Compile query**: send the query to be compiled on the GMQL system. It returns the compilation log.
170 - **Run query**: send the query to be run on the GMQL system. User can choose to automatically import the resulting dataset or not, and the output format. It returns the log generated by the system, an updated list of the user dataset, and the two collections corresponding to the result datasets samples and metadata, respectively.
171
172 .. class:: warningmark
173
174 A gmql_user authentication token is required for every action.
175
176 ----
177
178 .. class:: infomark
179
180 **Output formats**
181
182 - **GTF**: General feature format, fields are: seqname, source, feature, start (1-based), end, score, strand, frame, attribute
183 - **GDM** (Tab Delimited): the Genomic Data Model developed within the GMQL project. Fields are at least: chr, start (0-based), stop, strand (regions coordinates) plus an arbitrary set of additional attributes.
184
185 </help>
186 <expand macro="citations" />
187 </tool>