comparison query_tabular.xml @ 8:6d9c91071884 draft

planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/query_tabular commit 60d1a49c09f87c1c1ec6fecbe54aa226bdc695a7-dirty
author jjohnson
date Fri, 15 Apr 2016 16:29:51 -0400
parents aa2409ae9dc0
children b7f149b4792f
comparison
equal deleted inserted replaced
7:aa2409ae9dc0 8:6d9c91071884
1 <tool id="query_tabular" name="Query Tabular" version="0.1.1"> 1 <tool id="query_tabular" name="Query Tabular" version="0.1.2">
2 <description>using sqlite sql</description> 2 <description>using sqlite sql</description>
3 3
4 <requirements> 4 <requirements>
5 </requirements> 5 </requirements>
6 <stdio> 6 <stdio>
30 #set $jtbls = [] 30 #set $jtbls = []
31 #set $jtbldef['tables'] = $jtbls 31 #set $jtbldef['tables'] = $jtbls
32 #for $i,$tbl in enumerate($tables): 32 #for $i,$tbl in enumerate($tables):
33 #set $jtbl = dict() 33 #set $jtbl = dict()
34 #set $jtbl['file_path'] = str($tbl.table) 34 #set $jtbl['file_path'] = str($tbl.table)
35 #if $tbl.table_name 35 #if $tbl.tbl_opts.table_name:
36 #set $tname = str($tbl.table_name) 36 #set $tname = str($tbl.tbl_opts.table_name)
37 #else 37 #else
38 #set $tname = 't' + str($i + 1) 38 #set $tname = 't' + str($i + 1)
39 #end if 39 #end if
40 #set $jtbl['table_name'] = $tname 40 #set $jtbl['table_name'] = $tname
41 #if $tbl.col_names: 41 ## #if $tbl.tbl_opts.sel_cols:
42 #set $col_names = str($tbl.col_names) 42 ## #set $jtbl['sel_cols'] = $tbl.tbl_opts.sel_cols el_cols
43 #if $tbl.load_named_columns: 43 ## #end if
44 #if $tbl.tbl_opts.col_names:
45 #set $col_names = str($tbl.tbl_opts.col_names)
46 #if $tbl.tbl_opts.load_named_columns:
44 #set $jtbl['load_named_columns'] = True 47 #set $jtbl['load_named_columns'] = True
45 #end if 48 #end if
46 #else 49 #else
47 #set $col_names = '' 50 #set $col_names = ''
48 #end if 51 #end if
49 #set $jtbl['column_names'] = $col_names 52 #set $jtbl['column_names'] = $col_names
50 #if str($tbl.skip_lines) != '': 53 #if str($tbl.tbl_opts.skip_lines) != '':
51 #set $jtbl['comment_lines'] = int($tbl.skip_lines) 54 #set $jtbl['comment_lines'] = int($tbl.tbl_opts.skip_lines)
52 #elif $tbl.table.metadata.comment_lines > 0: 55 #elif $tbl.table.metadata.comment_lines and $tbl.table.metadata.comment_lines > 0:
53 #set $jtbl['comment_lines'] = int($tbl.table.metadata.comment_lines) 56 #set $jtbl['comment_lines'] = int($tbl.table.metadata.comment_lines)
57 #end if
58 #set $idx_unique = []
59 #set $idx_non = []
60 #for $idx in $tbl.tbl_opts.indexes:
61 #if $idx.unique:
62 #silent $idx_unique.append(str($idx.index_columns))
63 #else:
64 #silent $idx_non.append(str($idx.index_columns))
65 #end if
66 #end for
67 #if len($idx_unique) > 0:
68 #set $jtbl['unique'] = $idx_unique
69 #end if
70 #if len($idx_non) > 0:
71 #set $jtbl['index'] = $idx_unique
54 #end if 72 #end if
55 #set $jtbls += [$jtbl] 73 #set $jtbls += [$jtbl]
56 #end for 74 #end for
57 #echo $json.dumps($jtbldef) 75 #echo $json.dumps($jtbldef)
58 </configfile> 76 </configfile>
59 </configfiles> 77 </configfiles>
60 <inputs> 78 <inputs>
61 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/> 79 <param name="workdb" type="hidden" value="workdb.sqlite" label=""/>
62 <repeat name="tables" title="Add tables" min="1"> 80 <repeat name="tables" title="Add tables" min="1">
63 <param name="table" type="data" format="tabular" label="Dataset"/> 81 <param name="table" type="data" format="tabular" label="Dataset"/>
64 <param name="table_name" type="text" value="" optional="true" label="Table name"> 82 <section name="tbl_opts" expanded="false" title="Table Options">
65 <help>By default, tables will be named: t1,t2,...,tn</help> 83 <param name="table_name" type="text" value="" optional="true" label="Table name">
66 <validator type="regex" message="Table name should start with a letter and may contain additional letters, digits, and underscores">^[A-Za-z]\w*$</validator> 84 <help>By default, tables will be named: t1,t2,...,tn</help>
67 </param> 85 <validator type="regex" message="Table name should start with a letter and may contain additional letters, digits, and underscores">^[A-Za-z]\w*$</validator>
68 <param name="col_names" type="text" value="" optional="true" label="Column names"> 86 </param>
69 <help>By default, table columns will be named: c1,c2,c3,...,cn</help> 87 <param name="col_names" type="text" value="" optional="true" label="Column names">
70 <sanitizer sanitize="False"/> 88 <help>By default, table columns will be named: c1,c2,c3,...,cn</help>
71 <validator type="regex" message="A List of names separated by commas: Column names should start with a letter and may contain additional letters, digits, and underscores. Otherwise, the name must be eclosed in: double quotes, back quotes, or square brackets.">^([A-Za-z]\w*|"\S+[^,"]*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?(,([A-Za-z]\w*|"\S+.*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?)*$</validator> 89 <sanitizer sanitize="False"/>
72 </param> 90 <validator type="regex" message="A List of names separated by commas: Column names should start with a letter and may contain additional letters, digits, and underscores. Otherwise, the name must be eclosed in: double quotes, back quotes, or square brackets.">^([A-Za-z]\w*|"\S+[^,"]*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?(,([A-Za-z]\w*|"\S+.*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?)*$</validator>
73 <param name="load_named_columns" type="boolean" truevalue="load_named_columns" falsevalue="" checked="false" label="Only load named columns into database"/> 91 </param>
74 <param name="skip_lines" type="integer" value="" min="0" optional="true" label="Skip lines" help="Leave blank to use the datatype comment lines metadata" /> 92 <param name="load_named_columns" type="boolean" truevalue="load_named_columns" falsevalue="" checked="false" label="Only load named columns into database"/>
93 <param name="skip_lines" type="integer" value="" min="0" optional="true" label="Skip lines" help="Leave blank to use the datatype comment lines metadata" />
94 <repeat name="indexes">
95 <param name="unique" type="boolean" truevalue="yes" falsevalue="no" checked="False" label="This is a unique index"/>
96 <param name="index_columns" type="text" value="" label="Index on Columns">
97 <help>Create an index on the column names: e,g, c1 or c2,c4</help>
98 <validator type="regex" message="Column name, separated by commes if more than one">^([A-Za-z]\w*|"\S+[^,"]*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])(,([A-Za-z]\w*|"\S+.*"|`\S+[^,`]*`|[[]\S+[^,"]*[]])?)*$</validator>
99 </param>
100 </repeat>
101 </section>
75 </repeat> 102 </repeat>
76 <param name="sqlquery" type="text" area="true" size="10x80" value="" optional="true" label="SQL Query"> 103 <param name="sqlquery" type="text" area="true" size="10x80" value="" optional="true" label="SQL Query">
77 <help>By default, tables will be named: t1,t2,...,tn</help> 104 <help>By default, tables will be named: t1,t2,...,tn</help>
78 <sanitizer sanitize="False"/> 105 <sanitizer sanitize="False"/>
79 <validator type="regex" message="">^(?im)\s*select\s+.*\s+from\s+.*$</validator> 106 <validator type="regex" message="">^(?ims)\s*select\s+.*\s+from\s+.*$</validator>
80 </param> 107 </param>
81 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers"/> 108 <param name="no_header" type="boolean" truevalue="-n" falsevalue="" checked="False" label="Omit column headers"/>
82 109
83 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database"/> 110 <param name="save_db" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Save the sqlite database"/>
84 </inputs> 111 </inputs>