Mercurial > repos > iuc > query_tabular
comparison query_tabular.xml @ 4:7be49fd649f7 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
| author | iuc |
|---|---|
| date | Thu, 03 May 2018 10:15:10 -0400 |
| parents | 53c9f76c0788 |
| children | 5b557716b4b3 |
comparison
equal
deleted
inserted
replaced
| 3:ffbbc95b5654 | 4:7be49fd649f7 |
|---|---|
| 1 <tool id="query_tabular" name="Query Tabular" version="2.0.0"> | 1 <tool id="query_tabular" name="Query Tabular" version="3.0.0"> |
| 2 <description>using sqlite sql</description> | 2 <description>using sqlite sql</description> |
| 3 | 3 |
| 4 <macros> | 4 <macros> |
| 5 <import>macros.xml</import> | 5 <import>macros.xml</import> |
| 6 </macros> | 6 </macros> |
| 15 cp '$add_to_database.withdb' '$sqlitedb' && | 15 cp '$add_to_database.withdb' '$sqlitedb' && |
| 16 #else: | 16 #else: |
| 17 cp '$add_to_database.withdb' '$workdb' && | 17 cp '$add_to_database.withdb' '$workdb' && |
| 18 #end if | 18 #end if |
| 19 #end if | 19 #end if |
| 20 python '$__tool_directory__/query_tabular.py' | 20 python '$__tool_directory__/query_tabular.py' -d |
| 21 #if $save_db | 21 #if $save_db |
| 22 -s '$sqlitedb' | 22 -s '$sqlitedb' |
| 23 #else | 23 #else |
| 24 -s '$workdb' | 24 -s '$workdb' |
| 25 #end if | 25 #end if |
| 86 #if $input_filters: | 86 #if $input_filters: |
| 87 #set $jtbl['filters'] = $input_filters | 87 #set $jtbl['filters'] = $input_filters |
| 88 #end if | 88 #end if |
| 89 #set $jtbls += [$jtbl] | 89 #set $jtbls += [$jtbl] |
| 90 #end for | 90 #end for |
| 91 #set $jstmts = [] | |
| 92 #for $i,$stmt in enumerate($modify_database.sql_stmts): | |
| 93 #set $jstmts += [str($stmt.sqlstmt)] | |
| 94 #end for | |
| 95 #if len($jstmts) > 0: | |
| 96 #set $jtbldef['sql_stmts'] = $jstmts | |
| 97 #end if | |
| 98 #set $jqueries = [] | |
| 99 #for $i,$query in enumerate($addqueries.queries): | |
| 100 #set $jquery = dict() | |
| 101 #set $jquery['query'] = str($query.sqlquery) | |
| 102 #set $jquery['result_file'] = 'results' + str($i) + '.tsv' | |
| 103 #if $query.query_result.header == 'yes': | |
| 104 #set $header_prefix = '' | |
| 105 #if $query.query_result.header_prefix: | |
| 106 #set $header_prefix = chr(int(str($query.query_result.header_prefix))) | |
| 107 #end if | |
| 108 #set $jquery['header'] = $header_prefix | |
| 109 #end if | |
| 110 #set $jqueries += [$jquery] | |
| 111 #end for | |
| 112 #if len($jqueries) > 0: | |
| 113 #set $jtbldef['queries'] = $jqueries | |
| 114 #end if | |
| 91 #echo $json.dumps($jtbldef) | 115 #echo $json.dumps($jtbldef) |
| 92 </configfile> | 116 </configfile> |
| 93 </configfiles> | 117 </configfiles> |
| 94 <inputs> | 118 <inputs> |
| 95 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/> | 119 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/> |
| 130 <sanitizer sanitize="False"/> | 154 <sanitizer sanitize="False"/> |
| 131 </param> | 155 </param> |
| 132 </repeat> | 156 </repeat> |
| 133 </section> | 157 </section> |
| 134 </repeat> | 158 </repeat> |
| 159 <section name="modify_database" expanded="false" title="Modify the database"> | |
| 160 <repeat name="sql_stmts" title="Database Manipulation SQL Statements" min="0"> | |
| 161 <param name="sqlstmt" type="text" area="true" size="20x80" value="" optional="true" label="SQL Query to modify the database"> | |
| 162 <help>These modify the SQLite database</help> | |
| 163 <sanitizer sanitize="False"/> | |
| 164 </param> | |
| 165 </repeat> | |
| 166 </section> | |
| 135 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database in your history" | 167 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database in your history" |
| 136 help="SQLite to tabular tool can run additional queries on this database"/> | 168 help="SQLite to tabular tool can run additional queries on this database"/> |
| 137 <param name="sqlquery" type="text" area="true" size="20x80" value="" optional="true" label="SQL Query to generate tabular output"> | 169 <expand macro="sql_query_input"/> |
| 138 <help>By default: tables are named: t1,t2,...,tn and columns in each table: c1,c2,...,cn</help> | |
| 139 <sanitizer sanitize="False"/> | |
| 140 <validator type="regex" message="">^(?ims)\s*select\s+.*\s+from\s+.*$</validator> | |
| 141 </param> | |
| 142 <expand macro="result_results_header_line" /> | 170 <expand macro="result_results_header_line" /> |
| 171 <section name="addqueries" expanded="false" title="Additional Queries"> | |
| 172 <repeat name="queries" title="Database Manipulation SQL Statements" min="0" max="3"> | |
| 173 <expand macro="sql_query_input"/> | |
| 174 <expand macro="result_results_header_line" /> | |
| 175 </repeat> | |
| 176 </section> | |
| 143 </inputs> | 177 </inputs> |
| 144 <outputs> | 178 <outputs> |
| 145 <data format="sqlite" name="sqlitedb" label="sqlite db of ${on_string}"> | 179 <data format="sqlite" name="sqlitedb" label="sqlite db of ${on_string}"> |
| 146 <filter>save_db</filter> | 180 <filter>save_db</filter> |
| 147 </data> | 181 </data> |
| 148 <data format="tabular" name="output" label="query results on ${on_string}"> | 182 <data format="tabular" name="output" label="query results on ${on_string}"> |
| 149 <filter>not save_db or (sqlquery and len(sqlquery.strip()) > 0)</filter> | 183 <filter>not save_db or (sqlquery and len(sqlquery.strip()) > 0)</filter> |
| 150 </data> | 184 </data> |
| 185 <data format="tabular" name="output1" label="query 1 results on ${on_string}" from_work_dir="results0.tsv"> | |
| 186 <filter>len(addqueries['queries']) > 0</filter> | |
| 187 </data> | |
| 188 <data format="tabular" name="output2" label="query 2 results on ${on_string}" from_work_dir="results1.tsv"> | |
| 189 <filter>len(addqueries['queries']) > 1</filter> | |
| 190 </data> | |
| 191 <data format="tabular" name="output3" label="query 3 results on ${on_string}" from_work_dir="results2.tsv"> | |
| 192 <filter>len(addqueries['queries']) > 2</filter> | |
| 193 </data> | |
| 151 </outputs> | 194 </outputs> |
| 152 <tests> | 195 <tests> |
| 153 <test> | 196 <test> |
| 154 <repeat name="tables"> | 197 <repeat name="tables"> |
| 155 <param name="table" ftype="tabular" value="customers.tsv"/> | 198 <param name="table" ftype="tabular" value="customers.tsv"/> |
| 444 <conditional name="query_result"> | 487 <conditional name="query_result"> |
| 445 <param name="header" value="yes"/> | 488 <param name="header" value="yes"/> |
| 446 <param name="header_prefix" value=""/> | 489 <param name="header_prefix" value=""/> |
| 447 </conditional> | 490 </conditional> |
| 448 <output name="output" file="psm_report_out2.tsv"/> | 491 <output name="output" file="psm_report_out2.tsv"/> |
| 492 </test> | |
| 493 | |
| 494 <test> | |
| 495 <repeat name="tables"> | |
| 496 <param name="table" ftype="tabular" value="psm_report.tsv"/> | |
| 497 <section name="input_opts"> | |
| 498 <repeat name="linefilters"> | |
| 499 <conditional name="filter"> | |
| 500 <param name="filter_type" value="select_columns"/> | |
| 501 <param name="columns" value="1,3,2,6,14,19,23"/> | |
| 502 </conditional> | |
| 503 </repeat> | |
| 504 </section> | |
| 505 <section name="tbl_opts"> | |
| 506 <param name="table_name" value="PSMs"/> | |
| 507 <param name="column_names_from_first_line" value="True"/> | |
| 508 <param name="col_names" value="scan,,,,,,confidence"/> | |
| 509 </section> | |
| 510 </repeat> | |
| 511 <section name="modify_database"> | |
| 512 <repeat name="sql_stmts"> | |
| 513 <param name="sqlstmt" value="UPDATE psms SET confidence = 99.999 WHERE confidence = 100.0"/> | |
| 514 </repeat> | |
| 515 </section> | |
| 516 <param name="sqlquery" value="SELECT scan,"m/z", "Precursor m/z Error [ppm]", Sequence, "Protein(s)", confidence FROM PSMs WHERE NOT re_search(', ',"Protein(s)")"/> | |
| 517 <conditional name="query_result"> | |
| 518 <param name="header" value="yes"/> | |
| 519 <param name="header_prefix" value="#"/> | |
| 520 </conditional> | |
| 521 <section name="addqueries"> | |
| 522 <repeat name="queries"> | |
| 523 <param name="sqlquery" value="SELECT * FROM psms WHERE confidence > 97.0"/> | |
| 524 <conditional name="query_result"> | |
| 525 <param name="header" value="yes"/> | |
| 526 <param name="header_prefix" value=""/> | |
| 527 </conditional> | |
| 528 </repeat> | |
| 529 </section> | |
| 530 <output name="output" file="psm_dbmod_output.tsv"/> | |
| 531 <output name="output1" file="psm_dbmod_output1.tsv"/> | |
| 449 </test> | 532 </test> |
| 450 | 533 |
| 451 </tests> | 534 </tests> |
| 452 <help><