annotate query_db.py @ 14:3a6b78c39dca draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit eb95b169fd23c0c5d75abd6e54042d2c9a882539
author iuc
date Wed, 13 Sep 2023 12:15:42 +0000
parents 623f3eb7aa48
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
1 #!/usr/bin/env python
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
2
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
3 from __future__ import print_function
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
4
12
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
5 import math
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
6 import re
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
7 import sqlite3 as sqlite
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
8 import sys
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
9
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
10
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
11 TABLE_QUERY = \
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
12 """
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
13 SELECT name, sql
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
14 FROM sqlite_master
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
15 WHERE type='table'
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
16 ORDER BY name
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
17 """
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
18
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
19
12
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
20 def msg(e):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
21 print(e, file=sys.stderr)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
22
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
23
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
24 def regex_match(expr, item):
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
25 return re.match(expr, item) is not None
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
26
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
27
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
28 def regex_search(expr, item):
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
29 return re.search(expr, item) is not None
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
30
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
31
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
32 def regex_sub(expr, replace, item):
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
33 return re.sub(expr, replace, item)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
34
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
35
12
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
36 def math_acos(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
37 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
38 return math.acos(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
39 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
40 msg('acos(%s): %s' % (x, ve))
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
41 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
42
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
43
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
44 def math_acosh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
45 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
46 return math.acosh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
47 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
48 msg(f'acosh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
49 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
50
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
51
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
52 def math_asin(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
53 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
54 return math.asin(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
55 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
56 msg(f'asin({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
57 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
58
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
59
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
60 def math_asinh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
61 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
62 return math.asinh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
63 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
64 msg(f'asinh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
65 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
66
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
67
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
68 def math_atan(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
69 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
70 return math.atan(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
71 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
72 msg(f'atan({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
73 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
74
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
75
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
76 def math_atanh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
77 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
78 return math.atanh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
79 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
80 msg(f'atanh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
81 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
82
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
83
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
84 def math_atan2(x, y):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
85 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
86 return math.atan2(x, y)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
87 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
88 msg(f'atan2({x}, {y}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
89 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
90
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
91
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
92 def math_ceil(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
93 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
94 return math.ceil(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
95 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
96 msg(f'ceil({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
97 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
98
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
99
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
100 def math_cos(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
101 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
102 return math.cos(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
103 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
104 msg(f'cos({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
105 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
106
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
107
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
108 def math_cosh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
109 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
110 return math.cosh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
111 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
112 msg(f'cosh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
113 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
114
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
115
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
116 def math_degrees(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
117 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
118 return math.degrees(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
119 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
120 msg(f'degrees({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
121 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
122
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
123
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
124 def math_exp(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
125 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
126 return math.exp(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
127 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
128 msg(f'exp({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
129 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
130
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
131
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
132 def math_expm1(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
133 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
134 return math.expm1(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
135 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
136 msg(f'expm1({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
137 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
138
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
139
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
140 def math_fabs(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
141 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
142 return math.fabs(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
143 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
144 msg(f'fabs({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
145 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
146
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
147
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
148 def math_floor(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
149 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
150 return math.floor(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
151 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
152 msg(f'floor({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
153 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
154
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
155
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
156 def math_fmod(x, y):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
157 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
158 return math.fmod(x, y)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
159 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
160 msg(f'fmod({x}, {y}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
161 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
162
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
163
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
164 def math_blog(b, x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
165 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
166 return math.log(b, x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
167 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
168 msg(f'log({b}, {x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
169 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
170
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
171
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
172 def math_log(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
173 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
174 return math.log(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
175 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
176 msg(f'log({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
177 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
178
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
179
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
180 def math_log10(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
181 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
182 return math.log10(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
183 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
184 msg(f'log10({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
185 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
186
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
187
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
188 def math_log1p(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
189 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
190 return math.log1p(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
191 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
192 msg(f'log1p({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
193 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
194
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
195
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
196 def math_log2(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
197 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
198 return math.log2(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
199 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
200 msg(f'log2({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
201 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
202
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
203
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
204 def math_mod(x, y):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
205 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
206 return x % y
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
207 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
208 msg(f'mod({x}, {y}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
209 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
210
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
211
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
212 def math_pow(x, y):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
213 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
214 return math.pow(x, y)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
215 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
216 msg(f'pow({x}, {y}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
217 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
218
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
219
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
220 def math_radians(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
221 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
222 return math.radians(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
223 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
224 msg(f'radians({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
225 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
226
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
227
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
228 def math_sin(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
229 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
230 return math.sin(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
231 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
232 msg(f'sin({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
233 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
234
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
235
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
236 def math_sinh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
237 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
238 return math.sinh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
239 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
240 msg(f'sinh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
241 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
242
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
243
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
244 def math_sqrt(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
245 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
246 return math.sqrt(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
247 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
248 msg(f'sqrt({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
249 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
250
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
251
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
252 def math_tan(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
253 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
254 return math.tan(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
255 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
256 msg(f'tan({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
257 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
258
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
259
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
260 def math_tanh(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
261 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
262 return math.tanh(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
263 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
264 msg(f'tanh({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
265 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
266
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
267
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
268 def math_trunc(x):
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
269 try:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
270 return math.trunc(x)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
271 except ValueError as ve:
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
272 msg(f'trunc({x}): {ve}')
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
273 return None
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
274
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
275
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
276 def get_connection(sqlitedb_path, addfunctions=True):
12
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
277 sqlite.enable_callback_tracebacks(addfunctions)
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
278 conn = sqlite.connect(sqlitedb_path)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
279 if addfunctions:
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
280 conn.create_function("re_match", 2, regex_match)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
281 conn.create_function("re_search", 2, regex_search)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
282 conn.create_function("re_sub", 3, regex_sub)
12
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
283 conn.create_function("acos", 1, math_acos)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
284 conn.create_function("acosh", 1, math_acosh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
285 conn.create_function("asin", 1, math_asin)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
286 conn.create_function("asinh", 1, math_asinh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
287 conn.create_function("atan", 1, math_atan)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
288 conn.create_function("atanh", 1, math_atanh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
289 conn.create_function("atan2", 2, math_atan2)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
290 conn.create_function("ceil", 1, math_ceil)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
291 conn.create_function("cos", 1, math_cos)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
292 conn.create_function("cosh", 1, math_cosh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
293 conn.create_function("degrees", 1, math_degrees)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
294 conn.create_function("exp", 1, math_exp)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
295 conn.create_function("expm1", 1, math_expm1)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
296 conn.create_function("fabs", 1, math_fabs)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
297 conn.create_function("floor", 1, math_floor)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
298 conn.create_function("fmod", 2, math_fmod)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
299 conn.create_function("log", 1, math_log)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
300 conn.create_function("log", 2, math_blog)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
301 conn.create_function("log10", 1, math_log10)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
302 conn.create_function("log2", 1, math_log2)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
303 conn.create_function("log1p", 1, math_log1p)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
304 conn.create_function("mod", 2, math_mod)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
305 conn.create_function("pow", 2, math_pow)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
306 conn.create_function("radians", 1, math_radians)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
307 conn.create_function("sin", 1, math_sin)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
308 conn.create_function("sinh", 1, math_sinh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
309 conn.create_function("sqrt", 1, math_sqrt)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
310 conn.create_function("tan", 1, math_tan)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
311 conn.create_function("tanh", 1, math_tanh)
623f3eb7aa48 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 4fd70e184fca17ad430c30eb286127c4a198ef11"
iuc
parents: 9
diff changeset
312 conn.create_function("trunc", 1, math_trunc)
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
313 return conn
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
314
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
315
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
316 def describe_tables(conn, outputFile):
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
317 try:
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
318 c = conn.cursor()
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
319 tables_query = TABLE_QUERY
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
320 rslt = c.execute(tables_query).fetchall()
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
321 for table, sql in rslt:
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
322 print("Table %s:" % table, file=outputFile)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
323 try:
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
324 col_query = 'SELECT * FROM %s LIMIT 0' % table
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
325 cur = conn.cursor().execute(col_query)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
326 cols = [col[0] for col in cur.description]
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
327 print(" Columns: %s" % cols, file=outputFile)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
328 except Exception as exc:
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
329 print("Warning: %s" % exc, file=sys.stderr)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
330 except Exception as e:
9
a3aab6045663 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit daa9af57fe07ee83a45ddc9f855716f9d14a8e12"
iuc
parents: 4
diff changeset
331 exit('describe_tables Error: %s' % (e))
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
332 exit(0)
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
333
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
334
1
8a33b442ecd9 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 81f69ad5f39223059c40501e55ac777d3feca845
iuc
parents: 0
diff changeset
335 def run_query(conn, query, outputFile, no_header=False, comment_char='#'):
0
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
336 cur = conn.cursor()
3708ff0198b7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 74915fc9cee746bbce1c4b507e13231259de177d
iuc
parents:
diff changeset
337 results = cur.execute(query)
4
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
338 if outputFile is not None:
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
339 if not no_header:
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
340 outputFile.write("%s%s\n" % (comment_char, '\t'.join(
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
341 [str(col[0]) for col in cur.description])))
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
342 for i, row in enumerate(results):
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
343 outputFile.write("%s\n" % '\t'.join(
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
344 [str(val) if val is not None else '' for val in row]))
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
345 else:
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
346 conn.commit()
973f03d82c86 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 6a362345c31764c28bb6328da1f0d81ef8f35d40
iuc
parents: 1
diff changeset
347 return results