Mercurial > repos > jjohnson > query_tabular
annotate query_tabular.xml @ 23:5bb148ee644a draft default tip
Deleted selected files
| author | jjohnson |
|---|---|
| date | Mon, 17 Jul 2017 15:22:38 -0400 |
| parents | bed5018e7ae3 |
| children |
| rev | line source |
|---|---|
| 22 | 1 <tool id="query_tabular" name="Query Tabular" version="5.0.0"> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
2 <description>using sqlite sql</description> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
3 |
| 20 | 4 <macros> |
| 5 <import>macros.xml</import> | |
| 6 </macros> | |
| 7 | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
8 <requirements> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
9 </requirements> |
| 21 | 10 |
| 11 <command detect_errors="exit_code"><![CDATA[ | |
| 12 cat '$query_file' && | |
| 6 | 13 #if $add_to_database.withdb: |
| 14 #if $save_db: | |
| 21 | 15 cp '$add_to_database.withdb' '$sqlitedb' && |
| 6 | 16 #else: |
| 21 | 17 cp '$add_to_database.withdb' '$workdb' && |
| 6 | 18 #end if |
| 19 #end if | |
| 21 | 20 python '$__tool_directory__/query_tabular.py' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
21 #if $save_db |
| 21 | 22 -s '$sqlitedb' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
23 #else |
| 21 | 24 -s '$workdb' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
25 #end if |
| 21 | 26 -j '$table_json' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
27 #if $sqlquery: |
| 21 | 28 -Q '$query_file' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
29 $no_header |
| 21 | 30 -o '$output' |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
31 #end if |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
32 ]]></command> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
33 <configfiles> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
34 <configfile name="query_file"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
35 $sqlquery |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
36 </configfile> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
37 <configfile name="table_json"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
38 #import json |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
39 #set $jtbldef = dict() |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
40 #set $jtbls = [] |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
41 #set $jtbldef['tables'] = $jtbls |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
42 #for $i,$tbl in enumerate($tables): |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
43 #set $jtbl = dict() |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
44 #set $jtbl['file_path'] = str($tbl.table) |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
45 #if $tbl.tbl_opts.table_name: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
46 #set $tname = str($tbl.tbl_opts.table_name) |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
47 #else |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
48 #set $tname = 't' + str($i + 1) |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
49 #end if |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
50 #set $jtbl['table_name'] = $tname |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
51 ## #if $tbl.tbl_opts.sel_cols: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
52 ## #set $jtbl['sel_cols'] = $tbl.tbl_opts.sel_cols el_cols |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
53 ## #end if |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
54 #if $tbl.tbl_opts.pkey_autoincr: |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
55 #set $jtbl['pkey_autoincr'] = str($tbl.tbl_opts.pkey_autoincr) |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
56 #end if |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
57 #if $tbl.tbl_opts.col_names: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
58 #set $col_names = str($tbl.tbl_opts.col_names) |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
59 #if $tbl.tbl_opts.load_named_columns: |
|
3
3e3b3c883bec
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 60d1a49c09f87c1c1ec6fecbe54aa226bdc695a7-dirty
jjohnson
parents:
2
diff
changeset
|
60 #set $jtbl['load_named_columns'] = True |
|
3e3b3c883bec
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 60d1a49c09f87c1c1ec6fecbe54aa226bdc695a7-dirty
jjohnson
parents:
2
diff
changeset
|
61 #end if |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
62 #else |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
63 #set $col_names = '' |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
64 #end if |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
65 #set $jtbl['column_names'] = $col_names |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
66 #set $idx_unique = [] |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
67 #set $idx_non = [] |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
68 #for $idx in $tbl.tbl_opts.indexes: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
69 #if $idx.unique: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
70 #silent $idx_unique.append(str($idx.index_columns)) |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
71 #else: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
72 #silent $idx_non.append(str($idx.index_columns)) |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
73 #end if |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
74 #end for |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
75 #if len($idx_unique) > 0: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
76 #set $jtbl['unique'] = $idx_unique |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
77 #end if |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
78 #if len($idx_non) > 0: |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
79 #set $jtbl['index'] = $idx_non |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
80 #end if |
| 20 | 81 #set $linefilters = $tbl.input_opts.linefilters |
| 82 @LINEFILTERS@ | |
| 6 | 83 #if $input_filters: |
| 84 #set $jtbl['filters'] = $input_filters | |
| 85 #end if | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
86 #set $jtbls += [$jtbl] |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
87 #end for |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
88 #echo $json.dumps($jtbldef) |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
89 </configfile> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
90 </configfiles> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
91 <inputs> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
92 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/> |
| 6 | 93 <section name="add_to_database" expanded="false" title="Add tables to an existing database"> |
| 94 <param name="withdb" type="data" format="sqlite" optional="true" label="Add tables to this Database" | |
| 95 help="Make sure your added table names are not already in this database"/> | |
| 96 </section> | |
| 8 | 97 <repeat name="tables" title="Database Table" min="0"> |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
98 <param name="table" type="data" format="tabular" label="Tabular Dataset for Table"/> |
| 6 | 99 <section name="input_opts" expanded="false" title="Filter Dataset Input"> |
| 20 | 100 <expand macro="macro_line_filters" /> |
| 6 | 101 </section> |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
102 <section name="tbl_opts" expanded="false" title="Table Options"> |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
103 <param name="table_name" type="text" value="" optional="true" label="Specify Name for Table"> |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
104 <help>By default, tables will be named: t1,t2,...,tn (table names must be unique)</help> |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
105 <validator type="regex" message="Table name should start with a letter and may contain additional letters, digits, and underscores">^[A-Za-z]\w*$</validator> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
106 </param> |
| 11 | 107 <param name="col_names" type="text" value="" optional="true" label="Specify Column Names (comma-separated list)"> |
| 108 <help>By default, table columns will be named: c1,c2,c3,...,cn (column names for a table must be unique) | |
| 109 You can override the default names by entering a comma -separated list of names, e.g. ',name1,,,name2' would rename the second and fifth columns. | |
| 110 </help> | |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
111 <sanitizer sanitize="False"/> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
112 <validator type="regex" message="A List of names separated by commas: Column names should start with a letter and may contain additional letters, digits, and underscores. Otherwise, the name must be eclosed in: double quotes, back quotes, or square brackets.">^([A-Za-z]\w*|"\S+[^,"]*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?(,([A-Za-z]\w*|"\S+.*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?)*$</validator> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
113 </param> |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
114 <param name="load_named_columns" type="boolean" truevalue="load_named_columns" falsevalue="" checked="false" label="Only load the columns you have named into database"/> |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
115 <param name="pkey_autoincr" type="text" value="" optional="true" label="Add an auto increment primary key column with this name" |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
116 help="Only creates this additional column when a name is entered. (This can not be the same name as any of the other columns in this table.)"> |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
117 <validator type="regex" message="Column name">^([A-Za-z]\w*)?$</validator> |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
118 </param> |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
119 <repeat name="indexes" title="Table Index"> |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
120 <param name="unique" type="boolean" truevalue="yes" falsevalue="no" checked="False" label="This is a unique index"/> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
121 <param name="index_columns" type="text" value="" label="Index on Columns"> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
122 <help>Create an index on the column names: e,g, c1 or c2,c4</help> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
123 <validator type="regex" message="Column name, separated by commes if more than one">^([A-Za-z]\w*|"\S+[^,"]*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])(,([A-Za-z]\w*|"\S+.*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?)*$</validator> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
124 </param> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
125 </repeat> |
|
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
126 </section> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
127 </repeat> |
| 20 | 128 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database in your history" |
| 129 help="SQLite to tabular tool can run additional queries on this database"/> | |
| 6 | 130 <param name="sqlquery" type="text" area="true" size="20x80" value="" optional="true" label="SQL Query to generate tabular output"> |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
131 <help>By default: tables are named: t1,t2,...,tn and columns in each table: c1,c2,...,cn</help> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
132 <sanitizer sanitize="False"/> |
|
4
9d73dca48178
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents:
3
diff
changeset
|
133 <validator type="regex" message="">^(?ims)\s*select\s+.*\s+from\s+.*$</validator> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
134 </param> |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
135 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers from tabular output"/> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
136 </inputs> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
137 <outputs> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
138 <data format="sqlite" name="sqlitedb" label="sqlite db of ${on_string}"> |
| 20 | 139 <filter>save_db</filter> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
140 </data> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
141 <data format="tabular" name="output" label="query results on ${on_string}"> |
| 20 | 142 <filter>not save_db or (sqlquery and len(sqlquery.strip()) > 0)</filter> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
143 </data> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
144 </outputs> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
145 <tests> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
146 <test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
147 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
148 <param name="table" ftype="tabular" value="customers.tsv"/> |
| 21 | 149 <section name="input_opts"> |
| 150 <repeat name="linefilters"> | |
| 151 <conditional name="filter"> | |
| 152 <param name="filter_type" value="comment"/> | |
| 153 <param name="comment_char" value="35"/> | |
| 154 </conditional> | |
| 155 </repeat> | |
| 156 </section> | |
| 157 <section name="tbl_opts"> | |
| 158 <param name="table_name" value="customers"/> | |
| 159 <param name="col_names" value="CustomerID,FirstName,LastName,Email,DOB,Phone"/> | |
| 160 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
161 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
162 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
163 <param name="table" ftype="tabular" value="sales.tsv"/> |
| 21 | 164 <section name="input_opts"> |
| 165 <repeat name="linefilters"> | |
| 166 <conditional name="filter"> | |
| 167 <param name="filter_type" value="comment"/> | |
| 168 <param name="comment_char" value="35"/> | |
| 169 </conditional> | |
| 170 </repeat> | |
| 171 </section> | |
| 172 <section name="tbl_opts"> | |
| 173 <param name="table_name" value="sales"/> | |
| 174 <param name="col_names" value="CustomerID,Date,SaleAmount"/> | |
| 175 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
176 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
177 <param name="sqlquery" value="SELECT FirstName,LastName,sum(SaleAmount) as "TotalSales" FROM customers join sales on customers.CustomerID = sales.CustomerID GROUP BY customers.CustomerID ORDER BY TotalSales DESC"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
178 <output name="output" file="sales_results.tsv"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
179 </test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
180 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
181 <test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
182 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
183 <param name="table" ftype="tabular" value="customers.tsv"/> |
| 21 | 184 <section name="input_opts"> |
| 185 <repeat name="linefilters"> | |
| 186 <conditional name="filter"> | |
| 187 <param name="filter_type" value="comment"/> | |
| 188 <param name="comment_char" value="35"/> | |
| 189 </conditional> | |
| 190 </repeat> | |
| 191 </section> | |
| 192 <section name="tbl_opts"> | |
| 193 <param name="col_names" value=",FirstName,LastName,,DOB,"/> | |
| 194 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
195 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
196 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
197 <param name="table" ftype="tabular" value="sales.tsv"/> |
| 21 | 198 <section name="input_opts"> |
| 199 <repeat name="linefilters"> | |
| 200 <conditional name="filter"> | |
| 201 <param name="filter_type" value="skip"/> | |
| 202 <param name="skip_lines" value="1"/> | |
| 203 </conditional> | |
| 204 </repeat> | |
| 205 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
206 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
207 <param name="sqlquery" value="SELECT FirstName,LastName,sum(t2.c3) as "TotalSales" FROM t1 join t2 on t1.c1 = t2.c1 GROUP BY t1.c1 ORDER BY TotalSales DESC;"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
208 <output name="output" file="sales_results.tsv"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
209 </test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
210 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
211 <test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
212 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
213 <param name="table" ftype="tabular" value="customers.tsv"/> |
| 21 | 214 <section name="input_opts"> |
| 215 <repeat name="linefilters"> | |
| 216 <conditional name="filter"> | |
| 217 <param name="filter_type" value="skip"/> | |
| 218 <param name="skip_lines" value="1"/> | |
| 219 </conditional> | |
| 220 </repeat> | |
| 221 </section> | |
| 222 <section name="tbl_opts"> | |
| 223 <param name="col_names" value=",FirstName,LastName,,BirthDate,"/> | |
| 224 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
225 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
226 <param name="sqlquery" value="select FirstName,LastName,re_sub('^\d{2}(\d{2})-(\d\d)-(\d\d)','\3/\2/\1',BirthDate) as "DOB" from t1 WHERE re_search('[hp]er',c4)"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
227 <output name="output" file="regex_results.tsv"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
228 </test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
229 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
230 <test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
231 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
232 <param name="table" ftype="tabular" value="IEDB.tsv"/> |
| 21 | 233 <section name="input_opts"> |
| 234 <repeat name="linefilters"> | |
| 235 <conditional name="filter"> | |
| 236 <param name="filter_type" value="comment"/> | |
| 237 <param name="comment_char" value="35"/> | |
| 238 </conditional> | |
| 239 </repeat> | |
| 240 </section> | |
| 241 <section name="tbl_opts"> | |
| 242 <param name="table_name" value="iedb"/> | |
| 243 <param name="col_names" value="ID,allele,seq_num,start,end,length,peptide,method,percentile_rank,ann_ic50,ann_rank,smm_ic50,smm_rank,comblib_sidney2008_score,comblib_sidney2008_rank,netmhcpan_ic50,netmhcpan_rank"/> | |
| 244 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
245 </repeat> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
246 <repeat name="tables"> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
247 <param name="table" ftype="tabular" value="netMHC_summary.tsv"/> |
| 21 | 248 <section name="input_opts"> |
| 249 <repeat name="linefilters"> | |
| 250 <conditional name="filter"> | |
| 251 <param name="filter_type" value="skip"/> | |
| 252 <param name="skip_lines" value="1"/> | |
| 253 </conditional> | |
| 254 </repeat> | |
| 255 </section> | |
| 256 <section name="tbl_opts"> | |
| 257 <param name="table_name" value="mhc_summary"/> | |
| 258 <param name="col_names" value="pos,peptide,logscore,affinity,Bind_Level,Protein,Allele"/> | |
| 259 </section> | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
260 </repeat> |
| 21 | 261 <param name="sqlquery" value="select iedb.ID,iedb.peptide,iedb.start,iedb.end,iedb.percentile_rank,mhc_summary.logscore,mhc_summary.affinity,mhc_summary.Bind_Level from iedb left outer join mhc_summary on iedb.peptide = mhc_summary.peptide order by affinity,Bind_Level,percentile_rank"/> |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
262 <output name="output" file="query_results.tsv"/> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
263 </test> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
264 |
| 18 | 265 <test> |
| 21 | 266 <section name="add_to_database"> |
| 267 <param name="withdb" ftype="sqlite" value="testdb.sqlite"/> | |
| 268 </section> | |
| 269 <repeat name="tables"> | |
| 270 <param name="table" ftype="tabular" value="pets.tsv"/> | |
| 271 <section name="input_opts"> | |
| 272 <repeat name="linefilters"> | |
| 273 <conditional name="filter"> | |
| 274 <param name="filter_type" value="regex"/> | |
| 275 <param name="regex_pattern" value="^\d+"/> | |
| 276 <param name="regex_action" value="include_find"/> | |
| 277 </conditional> | |
| 278 </repeat> | |
| 279 <repeat name="linefilters"> | |
| 280 <conditional name="filter"> | |
| 281 <param name="filter_type" value="comment"/> | |
| 282 <param name="comment_char" value="35"/> | |
| 283 </conditional> | |
| 284 </repeat> | |
| 285 <repeat name="linefilters"> | |
| 286 <conditional name="filter"> | |
| 287 <param name="filter_type" value="append_line_num"/> | |
| 288 </conditional> | |
| 289 </repeat> | |
| 290 <repeat name="linefilters"> | |
| 291 <conditional name="filter"> | |
| 292 <param name="filter_type" value="select_columns"/> | |
| 293 <param name="columns" value="7,2,3,4,1"/> | |
| 294 </conditional> | |
| 295 </repeat> | |
| 296 <repeat name="linefilters"> | |
| 297 <conditional name="filter"> | |
| 298 <param name="filter_type" value="replace"/> | |
| 299 <param name="column" value="c4"/> | |
| 300 <param name="regex_pattern" value="(\d+)/(\d+)/(\d+)"/> | |
| 301 <param name="regex_replace" value="19\3-\2-\1"/> | |
| 302 </conditional> | |
| 303 </repeat> | |
| 304 </section> | |
| 305 <section name="tbl_opts"> | |
| 306 <param name="table_name" value="people"/> | |
| 307 <param name="col_names" value="id,first,last,dob,pets"/> | |
| 308 </section> | |
| 309 </repeat> | |
| 310 <param name="sqlquery" value="SELECT people.id,first,last,pets,quote FROM people JOIN contacts ON people.first = contacts.first_name"/> | |
| 311 <output name="output" file="add_to_db_results.tsv"/> | |
| 312 </test> | |
| 313 | |
| 314 <test> | |
| 18 | 315 <repeat name="tables"> |
| 316 <param name="table" ftype="tabular" value="pets.tsv"/> | |
| 21 | 317 <section name="input_opts"> |
| 318 <repeat name="linefilters"> | |
| 319 <conditional name="filter"> | |
| 320 <param name="filter_type" value="regex"/> | |
| 321 <param name="regex_pattern" value="^\d+"/> | |
| 322 <param name="regex_action" value="include_find"/> | |
| 323 </conditional> | |
| 324 </repeat> | |
| 325 <repeat name="linefilters"> | |
| 326 <conditional name="filter"> | |
| 327 <param name="filter_type" value="comment"/> | |
| 328 <param name="comment_char" value="35"/> | |
| 329 </conditional> | |
| 330 </repeat> | |
| 331 <repeat name="linefilters"> | |
| 332 <conditional name="filter"> | |
| 333 <param name="filter_type" value="append_line_num"/> | |
| 334 </conditional> | |
| 335 </repeat> | |
| 336 <repeat name="linefilters"> | |
| 337 <conditional name="filter"> | |
| 338 <param name="filter_type" value="select_columns"/> | |
| 339 <param name="columns" value="7,2,3,4,1"/> | |
| 340 </conditional> | |
| 341 </repeat> | |
| 342 <repeat name="linefilters"> | |
| 343 <conditional name="filter"> | |
| 344 <param name="filter_type" value="replace"/> | |
| 345 <param name="column" value="c4"/> | |
| 346 <param name="regex_pattern" value="(\d+)/(\d+)/(\d+)"/> | |
| 347 <param name="regex_replace" value="19\3-\2-\1"/> | |
| 348 </conditional> | |
| 349 </repeat> | |
| 350 </section> | |
| 351 <section name="tbl_opts"> | |
| 352 <param name="table_name" value="people"/> | |
| 353 <param name="col_names" value="id,first,last,dob,pets"/> | |
| 354 </section> | |
| 18 | 355 </repeat> |
| 356 <repeat name="tables"> | |
| 357 <param name="table" ftype="tabular" value="pets.tsv"/> | |
| 21 | 358 <section name="input_opts"> |
| 359 <repeat name="linefilters"> | |
| 360 <conditional name="filter"> | |
| 361 <param name="filter_type" value="regex"/> | |
| 362 <param name="regex_pattern" value="^\d+"/> | |
| 363 <param name="regex_action" value="include_find"/> | |
| 364 </conditional> | |
| 365 </repeat> | |
| 366 <repeat name="linefilters"> | |
| 367 <conditional name="filter"> | |
| 368 <param name="filter_type" value="append_line_num"/> | |
| 369 </conditional> | |
| 370 </repeat> | |
| 371 <repeat name="linefilters"> | |
| 372 <conditional name="filter"> | |
| 373 <param name="filter_type" value="select_columns"/> | |
| 374 <param name="columns" value="c7,c5,c6"/> | |
| 375 </conditional> | |
| 376 </repeat> | |
| 377 <repeat name="linefilters"> | |
| 378 <conditional name="filter"> | |
| 379 <param name="filter_type" value="normalize"/> | |
| 380 <param name="columns" value="c2,c3"/> | |
| 381 <param name="separator" value=","/> | |
| 382 </conditional> | |
| 383 </repeat> | |
| 384 </section> | |
| 385 <section name="tbl_opts"> | |
| 386 <param name="table_name" value="pet"/> | |
| 387 <param name="col_names" value="id,name,animal"/> | |
| 388 </section> | |
| 18 | 389 </repeat> |
| 390 <param name="sqlquery" value="SELECT people.id,first,last,dob,name,animal,pets FROM people JOIN pet ON people.id = pet.id WHERE animal = 'cat'"/> | |
| 391 <output name="output" file="pet_normalized_query_results.tsv"/> | |
| 392 </test> | |
| 393 | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
394 </tests> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
395 <help><![CDATA[ |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
396 ============= |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
397 Query Tabular |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
398 ============= |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
399 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
400 **Inputs** |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
401 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
402 Loads tabular datasets into a SQLite_ data base. |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
403 |
| 6 | 404 An existing SQLite_ data base can be used as input, and any selected tabular datasets will be added as new tables in that data base. |
| 405 | |
| 406 | |
| 20 | 407 @LINEFILTERS_HELP@ |
| 11 | 408 |
| 409 | |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
410 **Outputs** |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
411 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
412 The results of a SQL query are output to the history as a tabular file. |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
413 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
414 The SQLite_ data base can also be saved and output as a dataset in the history. |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
415 |
|
5
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
416 *(The* **SQLite to tabular** *tool can run additional queries on this database.)* |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
417 |
|
19ae309ec53c
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents:
4
diff
changeset
|
418 |
| 20 | 419 @QUERY_HELP@ |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
420 |
| 20 | 421 @LINEFILTERS_HELP_EXAMPLE@ |
| 11 | 422 |
| 423 | |
| 14 | 424 Table name: pets |
| 425 | |
| 426 Table columns: Pets,FirstName,LastName,Birthdate,PetNames,PetType,line_num,entry_num,row_num | |
| 11 | 427 |
| 14 | 428 Query: SELECT * FROM pets |
| 429 | |
| 430 Result: | |
| 11 | 431 |
| 14 | 432 ====== ========== ======== ========== ========= ======== ========= ========== ======== |
| 433 #Pets FirstName LastName BirthDate PetNames PetType line_num entry_num row_num | |
| 434 ====== ========== ======== ========== ========= ======== ========= ========== ======== | |
| 435 2 Paula Brown 1978-05-24 Rex dog 3 1 1 | |
| 436 2 Paula Brown 1978-05-24 Fluff cat 3 1 2 | |
| 437 1 Steven Jones 1974-04-04 Allie cat 4 2 3 | |
| 438 0 Jane Doe 1978-05-24 5 3 4 | |
| 439 1 James Smith 1980-10-20 Spot 6 4 5 | |
| 440 ====== ========== ======== ========== ========= ======== ========= ========== ======== | |
| 441 | |
| 11 | 442 |
| 14 | 443 **Normalizing by Line Filtering into 2 Tables** |
| 444 | |
| 20 | 445 *Relational database opertions work with single-valued column entries. |
| 446 To apply relational operations to tabular files that contain fields with lists of values, | |
| 447 we need to "normalize" those fields, duplicating lines for each item in the list. | |
| 448 In this example we create 2 tables, one for single-valued fields and a second with list-valued fields normalized. | |
| 449 Becauce we add a line number first for each table, we can join the 2 tables on the line number column.* | |
| 450 https://en.wikipedia.org/wiki/First_normal_form | |
| 451 | |
| 14 | 452 *People Table* |
| 453 | |
| 454 :: | |
| 455 | |
| 456 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number) | |
| 457 Filter 2 - append a line number column: | |
| 458 Filter 3 - regex replace value in column[4]: '(\d+)/(\d+)/(\d+)' '19\3-\2-\1' (convert dates to sqlite format) | |
| 16 | 459 Filter 4 - select columns 7,2,3,4,1 |
| 14 | 460 |
| 461 Table: People | |
| 16 | 462 Columns: id,FirstName,LastName,DOB,Pets |
| 11 | 463 |
| 16 | 464 == ========= ======== ========== ==== |
| 465 id FirstName LastName DOB Pets | |
| 466 == ========= ======== ========== ==== | |
| 467 1 Paula Brown 1978-05-24 2 | |
| 468 2 Steven Jones 1974-04-04 1 | |
| 469 3 Jane Doe 1978-05-24 0 | |
| 470 4 James Smith 1980-10-20 1 | |
| 471 == ========= ======== ========== ==== | |
| 14 | 472 |
| 473 | |
| 474 *Pet Table* | |
| 475 | |
| 476 :: | |
| 477 | |
| 478 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number) | |
| 479 Filter 2 - append a line number column: | |
| 480 Filter 3 - by regex expression matching [exclude]: '^0\t' (exclude lines with no pets) | |
| 481 Filter 4 - normalize list columns[5,6]: | |
| 16 | 482 Filter 5 - select columns 7,5,6 |
| 11 | 483 |
| 14 | 484 Table: Pet |
| 16 | 485 Columns: id,PetName,PetType |
| 14 | 486 |
| 16 | 487 == ======== ======== |
| 488 id PetName PetType | |
| 489 == ======== ======== | |
| 490 1 Rex dog | |
| 491 1 Fluff cat | |
| 492 2 Allie cat | |
| 493 4 Spot | |
| 494 == ======== ======== | |
| 14 | 495 |
| 496 | |
| 20 | 497 Query: SELECT FirstName,LastName,PetName FROM People JOIN Pet ON People.id = Pet.id WHERE PetType = 'cat'; |
| 14 | 498 |
| 499 Result: | |
| 500 | |
| 501 ========= ======== ======== | |
| 502 FirstName LastName PetName | |
| 503 ========= ======== ======== | |
| 504 Paula Brown Fluff | |
| 505 Steven Jones Allie | |
| 506 ========= ======== ======== | |
| 11 | 507 |
|
0
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
508 |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
509 ]]></help> |
|
926c62f7fa09
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff
changeset
|
510 </tool> |
