annotate query_tabular.xml @ 19:9d9ab2c69014 draft

Deleted selected files
author jjohnson
date Wed, 05 Jul 2017 11:51:50 -0400
parents b9f797bf4f38
children ab27c4bd14b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
1 <tool id="query_tabular" name="Query Tabular" version="4.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'
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
97 #set $filter_dict['pattern'] = '^(%s).*$' % '|'.join([chr(int(x)).replace('|','[|]') for x in (str($fi.filter.comment_char)).split(',')])
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
98 #set $filter_dict['action'] = 'exclude_match'
11
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)
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
106 #elif $fi.filter.filter_type == 'select_columns':
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
107 #set $filter_dict = dict()
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
108 #set $filter_dict['filter'] = str($fi.filter.filter_type)
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
109 #set $filter_dict['columns'] = [int(str($ci).replace('c','')) for $ci in str($fi.filter.columns).split(',')]
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
110 #silent $input_filters.append($filter_dict)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
111 #elif $fi.filter.filter_type == 'replace':
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
112 #set $filter_dict = dict()
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
113 #set $filter_dict['filter'] = str($fi.filter.filter_type)
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
114 #set $filter_dict['column'] = int(str($fi.filter.column).replace('c',''))
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
115 #set $filter_dict['pattern'] = str($fi.filter.regex_pattern)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
116 #set $filter_dict['replace'] = str($fi.filter.regex_replace)
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
117 #silent $input_filters.append($filter_dict)
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
118 #elif str($fi.filter.filter_type).endswith('pend_line_num'):
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
119 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
120 #set $filter_dict['filter'] = str($fi.filter.filter_type)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
121 #silent $input_filters.append($filter_dict)
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
122 #elif str($fi.filter.filter_type).endswith('pend_text'):
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
123 #set $filter_dict = dict()
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
124 #set $filter_dict['filter'] = str($fi.filter.filter_type)
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
125 #set $filter_dict['column_text'] = str($fi.filter.column_text)
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
126 #silent $input_filters.append($filter_dict)
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
127 #elif $fi.filter.filter_type == 'normalize':
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
128 #set $filter_dict = dict()
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
129 #set $filter_dict['filter'] = str($fi.filter.filter_type)
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
130 #set $filter_dict['columns'] = [int(str($ci).replace('c','')) for $ci in str($fi.filter.columns).split(',')]
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
131 #set $filter_dict['separator'] = str($fi.filter.separator)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
132 #silent $input_filters.append($filter_dict)
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
133 #end if
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
134 #end for
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
135 #if $input_filters:
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
136 #set $jtbl['filters'] = $input_filters
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
137 #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
138 #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
139 #end for
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
140 #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
141 </configfile>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
142 </configfiles>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
143 <inputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
144 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
145 <section name="add_to_database" expanded="false" title="Add tables to an existing database">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
146 <param name="withdb" type="data" format="sqlite" optional="true" label="Add tables to this Database"
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
147 help="Make sure your added table names are not already in this database"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
148 </section>
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
149 <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
150 <param name="table" type="data" format="tabular" label="Tabular Dataset for Table"/>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
151 <section name="input_opts" expanded="false" title="Filter Dataset Input">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
152 <repeat name="linefilters" title="Filter Tabular Input Lines">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
153 <conditional name="filter">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
154 <param name="filter_type" type="select" label="Filter By">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
155 <option value="skip">skip leading lines</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
156 <option value="comment">comment char</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
157 <option value="regex">by regex expression matching</option>
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
158 <option value="select_columns">select columns</option>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
159 <option value="replace">regex replace value in column</option>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
160 <option value="prepend_line_num">prepend a line number column</option>
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
161 <option value="append_line_num">append a line number column</option>
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
162 <option value="prepend_text">prepend a column with the given text</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
163 <option value="append_text">append a column with the given text</option>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
164 <option value="normalize">normalize list columns, replicates row for each item in list</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
165 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
166 <when value="skip">
8
ae27dab228b8 Uploaded
jjohnson
parents: 6
diff changeset
167 <param name="skip_lines" type="integer" value="" min="0" optional="true" label="Skip lines"
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
168 help="Leave blank to use the comment lines metadata for this dataset" />
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
169 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
170 <when value="comment">
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
171 <param name="comment_char" type="select" display="checkboxes" multiple="True" label="Ignore lines beginning with these characters" help="lines beginning with these are skipped">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
172 <option value="62">&gt;</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
173 <option value="64">@</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
174 <option value="43">+</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
175 <option value="60">&lt;</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
176 <option value="42">*</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
177 <option value="45">-</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
178 <option value="61">=</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
179 <option value="124">|</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
180 <option value="63">?</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
181 <option value="36">$</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
182 <option value="46">.</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
183 <option value="58">:</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
184 <option value="38">&amp;</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
185 <option value="37">%</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
186 <option value="94">^</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
187 <option value="35">&#35;</option>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
188 <option value="33">!</option>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
189 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
190 </when>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
191 <when value="prepend_line_num"/>
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
192 <when value="append_line_num"/>
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
193 <when value="prepend_text">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
194 <param name="column_text" type="text" value="" label="text for column">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
195 </param>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
196 </when>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
197 <when value="append_text">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
198 <param name="column_text" type="text" value="" label="text for column">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
199 </param>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
200 </when>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
201 <when value="regex">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
202 <param name="regex_pattern" type="text" value="" label="regex pattern">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
203 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
204 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
205 <param name="regex_action" type="select" label="action for regex match">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
206 <option value="exclude_match">exclude line on pattern match</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
207 <option value="include_match">include line on pattern match</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
208 <option value="exclude_find">exclude line if pattern found</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
209 <option value="include_find">include line if pattern found</option>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
210 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
211 </when>
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
212 <when value="select_columns">
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
213 <param name="columns" type="text" value="" label="enter column numbers to keep"
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
214 help="example: 1,4,2 or c1,c4,c2(selects the first,fourth, and second columns)">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
215 <validator type="regex" message="Column ordinal positions separated by commas">^(c?[1-9]\d*)(,c?[1-9]\d*)*$</validator>
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
216 </param>
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
217 </when>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
218 <when value="replace">
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
219 <param name="column" type="text" value="" label="enter column number to replace"
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
220 help="example: 1 or c1 (selects the first column)">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
221 <validator type="regex" message="Column ordinal position separated by commas">^(c?[1-9]\d*)$</validator>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
222 </param>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
223 <param name="regex_pattern" type="text" value="" label="regex pattern">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
224 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
225 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
226 <param name="regex_replace" type="text" value="" label="replacement expression">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
227 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
228 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
229 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
230 <when value="normalize">
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
231 <param name="columns" type="text" value="" label="enter column numbers to normalize">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
232 <help><![CDATA[
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
233 example: 2,4 or c2,c4 (selects the second, and fourth columns)
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
234 If multiple columns are selected, they should have the same length and separator on each line
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
235 ]]></help>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
236 <validator type="regex" message="Column ordinal positions separated by commas">^(c?[1-9]\d*)(,c?[1-9]\d*)*$</validator>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
237 </param>
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
238 <param name="separator" type="text" value="," label="List item delimiter in column">
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
239 <sanitizer sanitize="False"/>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
240 <validator type="regex" message="Anything but TAB or Newline">^[^\t\n\r\f\v]+$</validator>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
241 </param>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
242 </when>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
243 </conditional>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
244 </repeat>
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
245 </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
246 <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
247 <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
248 <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
249 <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
250 </param>
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
251 <param name="col_names" type="text" value="" optional="true" label="Specify Column Names (comma-separated list)">
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
252 <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
253 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
254 </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
255 <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
256 <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
257 </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
258 <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
259 <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
260 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
261 <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
262 </param>
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
263 <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
264 <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
265 <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
266 <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
267 <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
268 </param>
9d73dca48178 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents: 3
diff changeset
269 </repeat>
9d73dca48178 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9893037a046e4f4c1e7ba859e05f49378c398cb1-dirty
jjohnson
parents: 3
diff changeset
270 </section>
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
271 </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
272 <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
273 <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
274 <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
275 <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
276 <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
277 </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
278 <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
279 </inputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
280 <outputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
281 <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
282 <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
283 </data>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
284 <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
285 <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
286 </data>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
287 </outputs>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
288 <tests>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
289
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
290 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
291 <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
292 <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
293 <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
294 <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
295 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
296 <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
297 <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
298 <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
299 <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
300 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
301 <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
302 <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
303 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
304
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
305 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
306 <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
307 <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
308 <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
309 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
310 <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
311 <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
312 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
313 <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
314 <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
315 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
316
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
317 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
318 <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
319 <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
320 <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
321 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
322 <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
323 <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
324 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
325
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
326 <test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
327 <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
328 <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
329 <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
330 <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
331 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
332 <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
333 <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
334 <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
335 <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
336 </repeat>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
337 <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
338 <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
339 </test>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
340
18
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
341 <test>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
342 <repeat name="tables">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
343 <param name="table" ftype="tabular" value="pets.tsv"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
344 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
345 <param name="filter_type" value="comment"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
346 <param name="comment_char" value="35"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
347 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
348 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
349 <param name="filter_type" value="append_line_num"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
350 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
351 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
352 <param name="filter_type" value="select_columns"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
353 <param name="columns" value="7,2,3,4,1"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
354 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
355 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
356 <param name="filter_type" value="replace"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
357 <param name="column" value="c4"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
358 <param name="regex_pattern" value="(\d+)/(\d+)/(\d+)"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
359 <param name="regex_replace" value="19\3-\2-\1"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
360 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
361 <param name="table_name" value="people"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
362 <param name="col_names" value="id,first,last,dob,pets"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
363
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
364 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
365 <repeat name="tables">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
366 <param name="table" ftype="tabular" value="pets.tsv"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
367 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
368 <param name="filter_type" value="comment"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
369 <param name="comment_char" value="35"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
370 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
371 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
372 <param name="filter_type" value="append_line_num"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
373 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
374 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
375 <param name="filter_type" value="select_columns"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
376 <param name="columns" value="c7,c5,c6"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
377 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
378 <repeat name="linefilters">
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
379 <param name="filter_type" value="normalize"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
380 <param name="columns" value="c2,c3"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
381 <param name="separator" value=","/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
382 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
383 <param name="table_name" value="pet"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
384 <param name="col_names" value="id,name,animal"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
385 </repeat>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
386 <param name="sqlquery" value="SELECT people.id,first,last,dob,name,animal,pets FROM people JOIN pet ON people.id = pet.id WHERE animal = 'cat'"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
387 <output name="output" file="pet_normalized_query_results.tsv"/>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
388 </test>
b9f797bf4f38 Uploaded
jjohnson
parents: 16
diff changeset
389
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
390 </tests>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
391 <help><![CDATA[
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 Query Tabular
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
394 =============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
395
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
396 **Inputs**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
397
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
398 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
399
6
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
400 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
401
03842a4f71c6 Uploaded
jjohnson
parents: 5
diff changeset
402
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
403 **Input Line Filters**
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
404
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
405 As a tabular file is being read, line filters may be applied.
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
406
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
407 ::
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
408
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
409 - skip leading lines skip the first *number* of lines
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
410 - comment char omit any lines that start with the specified comment character
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
411 - by regex expression matching *include/exclude* lines the match the regex expression
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
412 - select columns choose to include only selected columns in the order specified
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
413 - 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
414 - 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
415 - 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
416 - normalize list columns replicates the line for each item in the specified list *columns*
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
417
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
418
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
419 **Outputs**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
420
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
421 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
422
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
423 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
424
5
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
425 *(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
426
19ae309ec53c planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 29288f94a382686e263623cf6ddcd235ed5f2310-dirty
jjohnson
parents: 4
diff changeset
427
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
428 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
429
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
430 **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
431
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
432 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
433
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
434 **Example**
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
435
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
436 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
437
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
438 Dataset *customers*
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
439
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
440 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
441
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
442 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
443
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
444 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
445 #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
446 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
447 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
448 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
449 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
450 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
451 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
452
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
453 Dataset *sales*
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
454
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
455 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
456
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
457 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
458
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
459 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
460 #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
461 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
462 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
463 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
464 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
465 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
466 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
467 ============= ============ ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
468
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
469 The query
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
470
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
471 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
472
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
473 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
474 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
475 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
476
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
477 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
478
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
479 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
480 #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
481 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
482 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
483 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
484 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
485 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
486 ========== ======== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
487
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
488
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
489 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
490
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
491 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
492
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
493 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
494 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
495 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
496
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
497 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
498
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
499 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
500
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
501 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
502
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
503 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
504 #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
505 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
506 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
507 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
508 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
509 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
510 =========== ========== ========== ===================== ========== ============
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
511
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
512
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
513 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
514
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
515 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
516
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
517 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
518
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
519 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
520 FROM t1
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
521 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
522
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
523 Results:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
524
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
525 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
526 #FirstName LastName
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
527 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
528 Steven Goldfish
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
529 Paula Brown
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
530 =========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
531
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
532
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
533 ::
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
534
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
535 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
536 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
537
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
538 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
539 FROM t1
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
540 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
541
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
542 Results:
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
543
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
544
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
545 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
546 #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
547 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
548 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
549 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
550 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
551 =========== ========== ==========
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
552
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
553
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
554 **Line Filtering Example**
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
555 *(Six filters are applied as the following file is read)*
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
556
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
557 ::
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
558
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
559 Input Tabular File:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
560
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
561 #People with pets
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
562 Pets FirstName LastName DOB PetNames PetType
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
563 2 Paula Brown 24/05/78 Rex,Fluff dog,cat
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
564 1 Steven Jones 04/04/74 Allie cat
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
565 0 Jane Doe 24/05/78
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
566 1 James Smith 20/10/80 Spot
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
567
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
568
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
569 Filter 1 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
570
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
571 #People with pets 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
572 Pets FirstName LastName DOB PetNames PetType 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
573 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
574 1 Steven Jones 04/04/74 Allie cat 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
575 0 Jane Doe 24/05/78 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
576 1 James Smith 20/10/80 Spot 6
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
577
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
578 Filter 2 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
579
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
580 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
581 1 Steven Jones 04/04/74 Allie cat 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
582 0 Jane Doe 24/05/78 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
583 1 James Smith 20/10/80 Spot 6
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
584
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
585 Filter 3 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
586
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
587 2 Paula Brown 24/05/78 Rex,Fluff dog,cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
588 1 Steven Jones 04/04/74 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
589 0 Jane Doe 24/05/78 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
590 1 James Smith 20/10/80 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
591
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
592 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
593
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
594 2 Paula Brown 1978-05-24 Rex,Fluff dog,cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
595 1 Steven Jones 1974-04-04 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
596 0 Jane Doe 1978-05-24 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
597 1 James Smith 1980-10-20 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
598
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
599 Filter 5 - normalize list columns[5,6]:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
600
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
601 2 Paula Brown 1978-05-24 Rex dog 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
602 2 Paula Brown 1978-05-24 Fluff cat 3 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
603 1 Steven Jones 1974-04-04 Allie cat 4 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
604 0 Jane Doe 1978-05-24 5 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
605 1 James Smith 1980-10-20 Spot 6 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
606
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
607 Filter 6 - append a line number column:
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
608
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
609 2 Paula Brown 1978-05-24 Rex dog 3 1 1
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
610 2 Paula Brown 1978-05-24 Fluff cat 3 1 2
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
611 1 Steven Jones 1974-04-04 Allie cat 4 2 3
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
612 0 Jane Doe 1978-05-24 5 3 4
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
613 1 James Smith 1980-10-20 Spot 6 4 5
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
614
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
615
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
616 Table name: pets
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
617
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
618 Table columns: Pets,FirstName,LastName,Birthdate,PetNames,PetType,line_num,entry_num,row_num
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
619
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
620 Query: SELECT * FROM pets
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
621
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
622 Result:
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
623
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
624 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
625 #Pets FirstName LastName BirthDate PetNames PetType line_num entry_num row_num
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
626 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
627 2 Paula Brown 1978-05-24 Rex dog 3 1 1
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
628 2 Paula Brown 1978-05-24 Fluff cat 3 1 2
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
629 1 Steven Jones 1974-04-04 Allie cat 4 2 3
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
630 0 Jane Doe 1978-05-24 5 3 4
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
631 1 James Smith 1980-10-20 Spot 6 4 5
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
632 ====== ========== ======== ========== ========= ======== ========= ========== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
633
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
634
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
635 **Normalizing by Line Filtering into 2 Tables**
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
636
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
637 *People Table*
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
638
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
639 ::
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
640
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
641 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
642 Filter 2 - append a line number column:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
643 Filter 3 - regex replace value in column[4]: '(\d+)/(\d+)/(\d+)' '19\3-\2-\1' (convert dates to sqlite format)
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
644 Filter 4 - select columns 7,2,3,4,1
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
645
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
646 Table: People
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
647 Columns: id,FirstName,LastName,DOB,Pets
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
648
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
649 == ========= ======== ========== ====
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
650 id FirstName LastName DOB Pets
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
651 == ========= ======== ========== ====
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
652 1 Paula Brown 1978-05-24 2
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
653 2 Steven Jones 1974-04-04 1
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
654 3 Jane Doe 1978-05-24 0
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
655 4 James Smith 1980-10-20 1
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
656 == ========= ======== ========== ====
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
657
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
658
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
659 *Pet Table*
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
660
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
661 ::
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
662
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
663 Filter 1 - by regex expression matching [include]: '^\d+' (include lines that start with a number)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
664 Filter 2 - append a line number column:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
665 Filter 3 - by regex expression matching [exclude]: '^0\t' (exclude lines with no pets)
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
666 Filter 4 - normalize list columns[5,6]:
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
667 Filter 5 - select columns 7,5,6
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
668
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
669 Table: Pet
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
670 Columns: id,PetName,PetType
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
671
16
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
672 == ======== ========
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
673 id PetName PetType
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
674 == ======== ========
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
675 1 Rex dog
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
676 1 Fluff cat
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
677 2 Allie cat
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
678 4 Spot
5b4f6cf857cf Uploaded
jjohnson
parents: 14
diff changeset
679 == ======== ========
14
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
680
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
681
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
682 Query: SELECT FirstName,LastName,PetName FROM People join Pet on People.id = Pet.id WHERE PetType = 'cat';
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
683
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
684 Result:
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
685
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
686 ========= ======== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
687 FirstName LastName PetName
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
688 ========= ======== ========
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
689 Paula Brown Fluff
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
690 Steven Jones Allie
3003fe70f297 Uploaded
jjohnson
parents: 11
diff changeset
691 ========= ======== ========
11
fd16243931d6 Uploaded
jjohnson
parents: 8
diff changeset
692
0
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
693 .. _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
694 .. _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
695
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
696 ]]></help>
926c62f7fa09 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 9ae87502ea7c3da33ecc453872c4eb2f41ecea4a-dirty
jjohnson
parents:
diff changeset
697 </tool>