|
0
|
1 <tool id="vl_tools_query" name="VLT.query">
|
|
|
2 <description>
|
|
|
3 Provides a simplified environment to perform complex queries to
|
|
|
4 BIOBANK.
|
|
|
5 </description>
|
|
|
6 <command interpreter="bash">
|
|
|
7 launcher.sh
|
|
|
8 --interpreter=python
|
|
|
9 --runner=kb_query.py
|
|
|
10 --host=$__user_omero_host__
|
|
|
11 --user=$__user_omero_user__
|
|
|
12 --passwd=$__user_omero_password__
|
|
|
13 --operator=$__user_email__
|
|
|
14 --ofile=${output1}
|
|
|
15 --logfile=${logfile}
|
|
|
16 query
|
|
|
17 --group=$study
|
|
|
18 --code-file=$code_file
|
|
|
19 </command>
|
|
|
20 <inputs>
|
|
|
21 <param name="study" type="select" label="study label"
|
|
|
22 help="Choose one of the available groups/studies.
|
|
|
23 See below.">
|
|
|
24 <options from_parameter="tool.app.known_studies"
|
|
|
25 transform_lines="[ "%s%s%s:%s"
|
|
|
26 % ( l[0], self.separator, l[0], l[1][:40] )
|
|
|
27 for l in obj ]">
|
|
|
28 <column name="value" index="0"/>
|
|
|
29 <column name="name" index="1"/>
|
|
|
30 <filter type="sort_by" column="0"/>
|
|
|
31 </options>
|
|
|
32 </param>
|
|
|
33 <param name="query_code" type="text" area="True" size="10x60"
|
|
|
34 optional="False"
|
|
|
35 value=""
|
|
|
36 />
|
|
|
37 <!-- ************************************************** -->
|
|
|
38
|
|
|
39 </inputs>
|
|
|
40
|
|
|
41 <configfiles>
|
|
|
42 <configfile name="code_file">${str($query_code).replace('__sq__', "'").replace('__cr____cn__', '\n')}</configfile>
|
|
|
43 </configfiles>
|
|
|
44
|
|
|
45 <outputs>
|
|
|
46 <data format="tabular" name="output1" label="${tool.name}.mapped"/>
|
|
|
47 <data format="txt" name="logfile" label="${tool.name}.logfile"/>
|
|
|
48 </outputs>
|
|
|
49
|
|
|
50 <help>
|
|
|
51 The following is an example of a query that will dump family relations
|
|
|
52 within the group::
|
|
|
53
|
|
|
54 writeheader('study', 'id', 'gender', 'father', 'mother')
|
|
|
55 for i in Individuals(group):
|
|
|
56 writerow(group.id, enum_label(i.gender),
|
|
|
57 i.father.id if i.father else 'None',
|
|
|
58 i.mother.id if i.mother else 'None')
|
|
|
59
|
|
|
60
|
|
|
61 The next example will prepare a file that could be used to define a
|
|
|
62 data collection and then as the input for a genotyping run::
|
|
|
63
|
|
|
64 writeheader('dc_id', 'gender', 'data_sample',
|
|
|
65 'path', 'mimetype', 'size', 'sha1')
|
|
|
66 for i in Individuals(group):
|
|
|
67 for d in DataSamples(i, 'AffymetrixCel'):
|
|
|
68 for o in DataObjects(d):
|
|
|
69 writerow(group.id, enum_label(i.gender), d.id,
|
|
|
70 o.path, o.mimetype, o.size, o.sha1)
|
|
|
71
|
|
|
72 In the examples above, '''group''' (actually a study) corresponds to
|
|
|
73 the group whose label is assigned by the '''--group''' flag.
|
|
|
74
|
|
|
75 **Note** This is clearly an extremely dangerous tool.
|
|
|
76
|
|
|
77 </help>
|
|
|
78
|
|
|
79 </tool> |