Mercurial > repos > jjohnson > sqlite_to_tabular
annotate sqlite_to_tabular.xml @ 3:f079ea3884b3 draft default tip
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
author | jjohnson |
---|---|
date | Thu, 21 Jan 2016 09:34:45 -0500 |
parents | bc50a7b7f246 |
children |
rev | line source |
---|---|
0 | 1 <?xml version="1.0"?> |
2 <tool id="sqlite_to_tabular" name="SQLite to tabular" version="0.0.1"> | |
2 | 3 <description>for SQL query</description> |
4 <stdio> | |
5 <exit_code range="1:" level="fatal" description="Error" /> | |
6 </stdio> | |
3
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
7 <command interpreter="python"><![CDATA[ |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
8 sqlite_to_tabular.py |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
9 --sqlitedb="$sqlitedb" |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
10 --query_file="$query_file" |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
11 $no_header |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
12 --output="$query_results" |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
13 ]]></command> |
2 | 14 <configfiles> |
15 <configfile name="query_file"> | |
16 $sqlquery | |
17 </configfile> | |
18 </configfiles> | |
19 <inputs> | |
20 <param name="sqlitedb" type="data" format="sqlite" label="SQLite Database"/> | |
21 <param name="sqlquery" type="text" area="True" size="120x20" label="SQL query"> | |
22 <validator type="regex">^(?im)\s*SELECT\s.*\sFROM\s.*$</validator> | |
23 <sanitizer sanitize="False"/> | |
24 </param> | |
25 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers"/> | |
26 </inputs> | |
27 <outputs> | |
28 <data name="query_results" format="tabular" /> | |
29 </outputs> | |
30 <tests> | |
31 <test> | |
32 <param name="sqlitedb" ftype="sqlite" value="testdb.sqlite" /> | |
33 <param name="sqlquery" value="SELECT first_name, last_name, age FROM contacts WHERE first_name = 'Sam'" /> | |
34 <output name="query_results"> | |
35 <assert_contents> | |
36 <has_text text="Smith" /> | |
37 <not_has_text text="Doe" /> | |
38 </assert_contents> | |
39 </output> | |
40 </test> | |
41 </tests> | |
3
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
42 <help><![CDATA[ |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
43 Outputs the results of a query on a SQLite_ Database as a tabular file. |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
44 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
45 In addition to the standard SQLite_functions_ regular_expression_ functions are included. |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
46 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
47 For example, with SQLite table "customers": |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
48 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
49 =========== ========== ========== ===================== ========== ============ |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
50 #CustomerID FirstName LastName Email BirthDate Phone |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
51 =========== ========== ========== ===================== ========== ============ |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
52 1 John Smith John.Smith@yahoo.com 1968-02-04 626 222-2222 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
53 2 Steven Goldfish goldfish@fishhere.net 1974-04-04 323 455-4545 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
54 3 Paula Brown pb@herowndomain.org 1978-05-24 416 323-3232 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
55 4 James Smith jim@supergig.co.uk 1980-10-20 416 323-8888 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
56 =========== ========== ========== ===================== ========== ============ |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
57 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
58 :: |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
59 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
60 matching: re_match('pattern',column) |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
61 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
62 SELECT FirstName, LastName |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
63 FROM customers |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
64 WHERE re_match('^.*\.(net|org)$',Email) |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
65 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
66 Results: |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
67 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
68 =========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
69 #FirstName LastName |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
70 =========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
71 Steven Goldfish |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
72 Paula Brown |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
73 =========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
74 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
75 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
76 :: |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
77 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
78 searching: re_search('pattern',column) |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
79 substituting: re_sub('pattern','replacement,column) |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
80 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
81 SELECT FirstName, LastName, re_sub('^\d{2}(\d{2})-(\d\d)-(\d\d)','\3/\2/\1',BirthDate) as "DOB" |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
82 FROM customers |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
83 WHERE re_search('[hp]er',Email) |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
84 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
85 Results: |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
86 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
87 =========== ========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
88 #FirstName LastName DOB |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
89 =========== ========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
90 Steven Goldfish 04/04/74 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
91 Paula Brown 24/05/78 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
92 James Smith 20/10/80 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
93 =========== ========== ========== |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
94 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
95 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
96 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
97 .. _Regular_expression: https://docs.python.org/release/2.7/library/re.html |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
98 .. _SQLite: http://www.sqlite.org/index.html |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
99 .. _SQLite_functions: http://www.sqlite.org/docs.html |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
100 |
f079ea3884b3
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit 64a950cafd655311c99a54f96a27b49f0bdf2731-dirty
jjohnson
parents:
2
diff
changeset
|
101 ]]></help> |
0 | 102 </tool> |