annotate query_tabular.xml @ 14:3003fe70f297 draft

Uploaded
author jjohnson
date Fri, 09 Jun 2017 11:24:56 -0400
parents fd16243931d6
children 5b4f6cf857cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
1 <tool id="query_tabular" name="Query Tabular" version="3.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
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
4 <requirements>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
5 </requirements>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
6 <stdio>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
7 <exit_code range="1:" />
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
8 </stdio>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
9 <command><![CDATA[
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
10 cat $query_file &&
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
11 #if $add_to_database.withdb:
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
12 #if $save_db:
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
13 cp "$add_to_database.withdb" "$sqlitedb" &&
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
14 #else:
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
15 cp "$add_to_database.withdb" "$workdb" &&
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
16 #end if
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
17 #end if
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
18 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
19 #if $save_db
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
20 -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
21 #else
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
22 -s $workdb
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
23 #end if
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
24 -j $table_json
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
25 #if $sqlquery:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
26 -Q "$query_file"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
27 $no_header
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
28 -o $output
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
29 #end if
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
30 ]]></command>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
31 <configfiles>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
32 <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
33 $sqlquery
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
34 </configfile>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
35 <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
36 #import json
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
37 #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
38 #set $jtbls = []
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['tables'] = $jtbls
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
40 #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
41 #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
42 #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
43 #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
44 #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
45 #else
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
46 #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
47 #end if
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
48 #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
49 ## #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
50 ## #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
51 ## #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
52 #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
53 #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
54 #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
55 #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
56 #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
57 #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
58 #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
59 #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
60 #else
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
61 #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
62 #end if
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
63 #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
64 #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
65 #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
66 #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
67 #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
68 #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
69 #else:
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_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
71 #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
72 #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
73 #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
74 #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
75 #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
76 #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
77 #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
78 #end if
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
79 #set $input_filters = []
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
80 #for $fi in $tbl.input_opts.linefilters:
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
81 #if $fi.filter.filter_type == 'skip':
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
82 #set $skip_lines = None
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
83 #if str($fi.filter.skip_lines) != '':
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
84 #set $skip_lines = int($fi.filter.skip_lines)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
85 #elif $tbl.table.metadata.comment_lines and $tbl.table.metadata.comment_lines > 0:
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
86 #set $skip_lines = int($tbl.table.metadata.comment_lines)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
87 #end if
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
88 #if $skip_lines is not None:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
89 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
90 #set $filter_dict['filter'] = str($fi.filter.filter_type)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
91 #set $filter_dict['count'] = $skip_lines
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
92 #silent $input_filters.append($filter_dict)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
93 #end if
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
94 #elif $fi.filter.filter_type == 'comment':
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
95 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
96 #set $filter_dict['filter'] = 'regex'
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
97 #set $filter_dict['pattern'] = '^' + str($fi.filter.comment_char)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
98 #set $filter_dict['action'] = 'exclude'
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
99 #silent $input_filters.append($filter_dict)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
100 #elif $fi.filter.filter_type == 'regex':
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
101 #set $filter_dict = dict()
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
102 #set $filter_dict['filter'] = str($fi.filter.filter_type)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
103 #set $filter_dict['pattern'] = str($fi.filter.regex_pattern)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
104 #set $filter_dict['action'] = str($fi.filter.regex_action)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
105 #silent $input_filters.append($filter_dict)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
106 #elif $fi.filter.filter_type == 'replace':
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
107 #set $filter_dict = dict()
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
108 #set $filter_dict['filter'] = str($fi.filter.filter_type)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
109 #set $filter_dict['column'] = int(str($fi.filter.column))
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
110 #set $filter_dict['pattern'] = str($fi.filter.regex_pattern)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
111 #set $filter_dict['replace'] = str($fi.filter.regex_replace)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
112 #silent $input_filters.append($filter_dict)
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
113 #elif str($fi.filter.filter_type).endswith('pend_line_num'):
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
114 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
115 #set $filter_dict['filter'] = str($fi.filter.filter_type)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
116 #silent $input_filters.append($filter_dict)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
117 #elif $fi.filter.filter_type == 'normalize':
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
118 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
119 #set $filter_dict['filter'] = str($fi.filter.filter_type)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
120 #set $filter_dict['columns'] = [int(str($ci)) for $ci in str($fi.filter.columns).split(',')]
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
121 #set $filter_dict['separator'] = str($fi.filter.separator)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
122 #silent $input_filters.append($filter_dict)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
123 #end if
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
124 #end for
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
125 #if $input_filters:
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
126 #set $jtbl['filters'] = $input_filters
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
127 #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
128 #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
129 #end for
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
130 #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
131 </configfile>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
132 </configfiles>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
133 <inputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
134 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
135 <section name="add_to_database" expanded="false" title="Add tables to an existing database">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
136 <param name="withdb" type="data" format="sqlite" optional="true" label="Add tables to this Database"
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
137 help="Make sure your added table names are not already in this database"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
138 </section>
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
139 <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
140 <param name="table" type="data" format="tabular" label="Tabular Dataset for Table"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
141 <section name="input_opts" expanded="false" title="Filter Dataset Input">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
142 <repeat name="linefilters" title="Filter Tabular Input Lines">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
143 <conditional name="filter">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
144 <param name="filter_type" type="select" label="Filter By">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
145 <option value="skip">skip leading lines</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
146 <option value="comment">comment char</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
147 <option value="regex">by regex expression matching</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
148 <option value="replace">regex replace value in column</option>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
149 <option value="prepend_line_num">prepend a line number column</option>
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
150 <option value="append_line_num">append a line number column</option>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
151 <option value="normalize">normalize list columns, replicates row for each item in list</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
152 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
153 <when value="skip">
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
154 <param name="skip_lines" type="integer" value="" min="0" optional="true" label="Skip lines"
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
155 help="Leave blank to use the comment lines metadata for this dataset" />
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
156 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
157 <when value="comment">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
158 <param name="comment_char" type="text" value="#" label="Comment line starting text">
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
159 <sanitizer sanitize="False"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
160 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
161 </when>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
162 <when value="prepend_line_num"/>
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
163 <when value="append_line_num"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
164 <when value="regex">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
165 <param name="regex_pattern" type="text" value="" label="regex pattern">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
166 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
167 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
168 <param name="regex_action" type="select" label="action for regex match">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
169 <option value="exclude_match">exclude line on pattern match</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
170 <option value="include_match">include line on pattern match</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
171 <option value="exclude_find">exclude line if pattern found</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
172 <option value="include_find">include line if pattern found</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
173 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
174 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
175 <when value="replace">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
176 <param name="column" type="data_column" data_ref="table" label="Column to replace text"
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
177 help=""/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
178 <param name="regex_pattern" type="text" value="" label="regex pattern">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
179 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
180 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
181 <param name="regex_replace" type="text" value="" label="replacement expression">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
182 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
183 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
184 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
185 <when value="normalize">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
186 <param name="columns" type="data_column" data_ref="table" multiple="True" label="Columns to split"
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
187 help="If multiple columns are selected, they should have the same length and separator on each line"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
188 <param name="separator" type="text" value="," label="List item delimiter in column">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
189 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
190 <validator type="regex" message="Anything but TAB or Newline">^[^\t\n\r\f\v]+$</validator>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
191 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
192 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
193 </conditional>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
194 </repeat>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
195 </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
196 <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
197 <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
198 <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
199 <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
200 </param>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
201 <param name="col_names" type="text" value="" optional="true" label="Specify Column Names (comma-separated list)">
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
202 <help>By default, table columns will be named: c1,c2,c3,...,cn (column names for a table must be unique)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
203 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.
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
204 </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
205 <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
206 <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
207 </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
208 <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
209 <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
210 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
211 <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
212 </param>
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
213 <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
214 <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
215 <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
216 <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
217 <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
218 </param>
9d73dca48178 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents: 3
diff changeset
219 </repeat>
9d73dca48178 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents: 3
diff changeset
220 </section>
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
221 </repeat>
5
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
222 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database in your history"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
223 <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
224 <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
225 <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
226 <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
227 </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
228 <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
229 </inputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
230 <outputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
231 <data format="sqlite" name="sqlitedb" label="sqlite db of ${on_string}">
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
232 <filter>save_db or not (sqlquery and len(sqlquery) > 0)</filter>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
233 </data>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
234 <data format="tabular" name="output" label="query results on ${on_string}">
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
235 <filter>sqlquery and len(sqlquery) > 0</filter>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
236 </data>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
237 </outputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
238 <tests>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
239
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
240 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
241 <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
242 <param name="table" ftype="tabular" value="customers.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
243 <param name="table_name" value="customers"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
244 <param name="col_names" value="CustomerID,FirstName,LastName,Email,DOB,Phone"/>
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="sales.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
248 <param name="table_name" value="sales"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
249 <param name="col_names" value="CustomerID,Date,SaleAmount"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
250 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
251 <param name="sqlquery" value="SELECT FirstName,LastName,sum(SaleAmount) as &quot;TotalSales&quot; 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
252 <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
253 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
254
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
255 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
256 <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
257 <param name="table" ftype="tabular" value="customers.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
258 <param name="col_names" value=",FirstName,LastName,,DOB,"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
259 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
260 <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
261 <param name="table" ftype="tabular" value="sales.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
262 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
263 <param name="sqlquery" value="SELECT FirstName,LastName,sum(t2.c3) as &quot;TotalSales&quot; 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
264 <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
265 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
266
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
267 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
268 <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
269 <param name="table" ftype="tabular" value="customers.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
270 <param name="col_names" value=",FirstName,LastName,,BirthDate,"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
271 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
272 <param name="sqlquery" value="select FirstName,LastName,re_sub('^\d{2}(\d{2})-(\d\d)-(\d\d)','\3/\2/\1',BirthDate) as &quot;DOB&quot; 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
273 <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
274 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
275
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
276 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
277 <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
278 <param name="table" ftype="tabular" value="IEDB.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
279 <param name="table_name" value="iedb"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
280 <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"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
281 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
282 <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
283 <param name="table" ftype="tabular" value="netMHC_summary.tsv"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
284 <param name="table_name" value="mhc_summary"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
285 <param name="col_names" value="pos,peptide,logscore,affinity,Bind_Level,Protein,Allele"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
286 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
287 <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"/>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
288 <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
289 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
290
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
291 </tests>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
292 <help><![CDATA[
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
293 =============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
294 Query Tabular
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
295 =============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
296
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
297 **Inputs**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
298
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
299 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
300
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
301 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.
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
302
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
303
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
304 **Input Line Filters**
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
305
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
306 As a tabular file is being read, line filters may be applied.
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
307
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
308 ::
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
309
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
310 - skip leading lines skip the first *number* of lines
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
311 - comment char omit any lines that start with the specified comment character
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
312 - by regex expression matching *include/exclude* lines the match the regex expression
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
313 - regex replace value in column replace a field in a column using a regex substitution (good for date reformatting)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
314 - prepend a line number column each line has the ordinal value of the line read by this filter as the first column
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
315 - append a line number column each line has the ordinal value of the line read by this filter as the last column
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
316 - normalize list columns replicates the line for each item in the specified list *columns*
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
317
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
318
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
319 **Outputs**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
320
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
321 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
322
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
323 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
324
5
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
325 *(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
326
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
327
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
328 For help in using SQLite_ see: http://www.sqlite.org/docs.html
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
329
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
330 **NOTE:** input for SQLite dates input field must be in the format: *YYYY-MM-DD* for example: 2015-09-30
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
331
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
332 See: http://www.sqlite.org/lang_datefunc.html
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
333
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
334 **Example**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
335
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
336 Given 2 tabular datasets: *customers* and *sales*
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
337
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
338 Dataset *customers*
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
339
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
340 Table name: "customers"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
341
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
342 Column names: "CustomerID,FirstName,LastName,Email,DOB,Phone"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
343
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
344 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
345 #CustomerID FirstName LastName Email DOB Phone
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
346 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
347 1 John Smith John.Smith@yahoo.com 1968-02-04 626 222-2222
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
348 2 Steven Goldfish goldfish@fishhere.net 1974-04-04 323 455-4545
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
349 3 Paula Brown pb@herowndomain.org 1978-05-24 416 323-3232
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
350 4 James Smith jim@supergig.co.uk 1980-10-20 416 323-8888
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
351 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
352
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
353 Dataset *sales*
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
354
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
355 Table name: "sales"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
356
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
357 Column names: "CustomerID,Date,SaleAmount"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
358
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
359 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
360 #CustomerID Date SaleAmount
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
361 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
362 2 2004-05-06 100.22
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
363 1 2004-05-07 99.95
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
364 3 2004-05-07 122.95
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
365 3 2004-05-13 100.00
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
366 4 2004-05-22 555.55
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
367 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
368
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
369 The query
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
370
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
371 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
372
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
373 SELECT FirstName,LastName,sum(SaleAmount) as "TotalSales"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
374 FROM customers join sales on customers.CustomerID = sales.CustomerID
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
375 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
376
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
377 Produces this tabular output:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
378
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
379 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
380 #FirstName LastName TotalSales
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
381 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
382 James Smith 555.55
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
383 Paula Brown 222.95
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
384 Steven Goldfish 100.22
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
385 John Smith 99.95
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
386 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
387
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
388
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
389 If the optional Table name and Column names inputs are not used, the query would be:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
390
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
391 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
392
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
393 SELECT t1.c2 as "FirstName", t1.c3 as "LastName", sum(t2.c3) as "TotalSales"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
394 FROM t1 join t2 on t1.c1 = t2.c1
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
395 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
396
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
397 You can selectively name columns, e.g. on the customers input you could just name columns 2,3, and 5:
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 Column names: ,FirstName,LastName,,BirthDate
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
400
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
401 Results in the following data base table
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
402
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
403 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
404 #c1 FirstName LastName c4 BirthDate c6
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
405 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
406 1 John Smith John.Smith@yahoo.com 1968-02-04 626 222-2222
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
407 2 Steven Goldfish goldfish@fishhere.net 1974-04-04 323 455-4545
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
408 3 Paula Brown pb@herowndomain.org 1978-05-24 416 323-3232
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
409 4 James Smith jim@supergig.co.uk 1980-10-20 416 323-8888
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
410 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
411
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
412
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
413 Regular_expression_ functions are included for:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
414
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
415 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
416
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
417 matching: re_match('pattern',column)
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
418
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
419 SELECT t1.FirstName, t1.LastName
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
420 FROM t1
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
421 WHERE re_match('^.*\.(net|org)$',c4)
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
422
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
423 Results:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
424
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
425 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
426 #FirstName LastName
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
427 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
428 Steven Goldfish
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
429 Paula Brown
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
430 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
431
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
432
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
433 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
434
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
435 searching: re_search('pattern',column)
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
436 substituting: re_sub('pattern','replacement,column)
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
437
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
438 SELECT t1.FirstName, t1.LastName, re_sub('^\d{2}(\d{2})-(\d\d)-(\d\d)','\3/\2/\1',BirthDate) as "DOB"
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
439 FROM t1
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
440 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
441
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
442 Results:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
443
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
444
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
445 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
446 #FirstName LastName DOB
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
447 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
448 Steven Goldfish 04/04/74
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
449 Paula Brown 24/05/78
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
450 James Smith 20/10/80
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
451 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
452
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
453
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
454 **Line Filtering Example**
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
455 *(Six filters are applied as the following file is read)*
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
456
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
457 ::
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
458
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
459 Input Tabular File:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
460
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
461 #People with pets
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
462 Pets FirstName LastName DOB PetNames PetType
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
463 2 Paula Brown 24/05/78 Rex,Fluff dog,cat
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
464 1 Steven Jones 04/04/74 Allie cat
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
465 0 Jane Doe 24/05/78
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
466 1 James Smith 20/10/80 Spot
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
467
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
468
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
469 Filter 1 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
470
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
471 #People with pets 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
472 Pets FirstName LastName DOB PetNames PetType 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
473 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
474 1 Steven Jones 04/04/74 Allie cat 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
475 0 Jane Doe 24/05/78 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
476 1 James Smith 20/10/80 Spot 6
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
477
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
478 Filter 2 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
479
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
480 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
481 1 Steven Jones 04/04/74 Allie cat 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
482 0 Jane Doe 24/05/78 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
483 1 James Smith 20/10/80 Spot 6
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
484
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
485 Filter 3 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
486
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
487 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
488 1 Steven Jones 04/04/74 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
489 0 Jane Doe 24/05/78 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
490 1 James Smith 20/10/80 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
491
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
492 Filter 4 - regex replace value in column[4]: '(\d+)/(\d+)/(\d+)' '19\3-\2-\1' (convert dates to sqlite format)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
493
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
494 2 Paula Brown 1978-05-24 Rex,Fluff dog,cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
495 1 Steven Jones 1974-04-04 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
496 0 Jane Doe 1978-05-24 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
497 1 James Smith 1980-10-20 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
498
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
499 Filter 5 - normalize list columns[5,6]:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
500
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
501 2 Paula Brown 1978-05-24 Rex dog 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
502 2 Paula Brown 1978-05-24 Fluff cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
503 1 Steven Jones 1974-04-04 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
504 0 Jane Doe 1978-05-24 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
505 1 James Smith 1980-10-20 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
506
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
507 Filter 6 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
508
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
509 2 Paula Brown 1978-05-24 Rex dog 3 1 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
510 2 Paula Brown 1978-05-24 Fluff cat 3 1 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
511 1 Steven Jones 1974-04-04 Allie cat 4 2 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
512 0 Jane Doe 1978-05-24 5 3 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
513 1 James Smith 1980-10-20 Spot 6 4 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
514
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
515
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
516 Table name: pets
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
517
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
518 Table columns: Pets,FirstName,LastName,Birthdate,PetNames,PetType,line_num,entry_num,row_num
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
519
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
520 Query: SELECT * FROM pets
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
521
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
522 Result:
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
523
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
524 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
525 #Pets FirstName LastName BirthDate PetNames PetType line_num entry_num row_num
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
526 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
527 2 Paula Brown 1978-05-24 Rex dog 3 1 1
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
528 2 Paula Brown 1978-05-24 Fluff cat 3 1 2
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
529 1 Steven Jones 1974-04-04 Allie cat 4 2 3
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
530 0 Jane Doe 1978-05-24 5 3 4
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
531 1 James Smith 1980-10-20 Spot 6 4 5
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
532 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
533
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
534
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
535 **Normalizing by Line Filtering into 2 Tables**
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
536
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
537 *People Table*
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
538
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
539 ::
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
540
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
541 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
542 Filter 2 - append a line number column:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
543 Filter 3 - regex replace value in column[4]: '(\d+)/(\d+)/(\d+)' '19\3-\2-\1' (convert dates to sqlite format)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
544
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
545 Table: People
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
546 Columns: Pets,FirstName,LastName,DOB,,,id
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
547
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
548 ==== ========= ======== ========== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
549 Pets FirstName LastName DOB id
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
550 ==== ========= ======== ========== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
551 2 Paula Brown 1978-05-24 1
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
552 1 Steven Jones 1974-04-04 2
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
553 0 Jane Doe 1978-05-24 3
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
554 1 James Smith 1980-10-20 4
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
555 ==== ========= ======== ========== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
556
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
557
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
558 *Pet Table*
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
559
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
560 ::
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
561
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
562 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
563 Filter 2 - append a line number column:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
564 Filter 3 - by regex expression matching [exclude]: '^0\t' (exclude lines with no pets)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
565 Filter 4 - normalize list columns[5,6]:
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
566
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
567 Table: Pet
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
568 Columns: ,,,,PetName,PetType,id
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
569
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
570 ======== ======== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
571 PetName PetType id
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
572 ======== ======== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
573 Rex dog 1
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
574 Fluff cat 1
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
575 Allie cat 2
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
576 Spot 4
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
577 ======== ======== ==
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
578
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
579
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
580 Query: SELECT FirstName,LastName,PetName FROM People join Pet on People.id = Pet.id WHERE PetType = 'cat';
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
581
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
582 Result:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
583
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
584 ========= ======== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
585 FirstName LastName PetName
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
586 ========= ======== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
587 Paula Brown Fluff
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
588 Steven Jones Allie
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
589 ========= ======== ========
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
590
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
591 .. _Regular_expression: https://docs.python.org/release/2.7/library/re.html
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
592 .. _SQLite: http://www.sqlite.org/index.html
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
593
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
594 ]]></help>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
595 </tool>