comparison gemini_macros.xml @ 5:c63b7eefb07a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/gemini commit 62ed732cba355e695181924a8ed4cce49ca21c59
author iuc
date Fri, 11 Jan 2019 17:51:37 -0500
parents 69b5327a1f88
children 9551b3da9f5d
comparison
equal deleted inserted replaced
4:69b5327a1f88 5:c63b7eefb07a
1 <macros> 1 <macros>
2 <!-- gemini version to be used --> 2 <!-- gemini version to be used -->
3 <token name="@VERSION@">0.18.1</token> 3 <token name="@VERSION@">0.20.1</token>
4 <!-- minimal annotation files version required by this version of gemini --> 4 <!-- minimal annotation files version required by this version of gemini -->
5 <token name="@DB_VERSION@">181</token> 5 <token name="@DB_VERSION@">200</token>
6 6
7 <xml name="requirements"> 7 <xml name="requirements">
8 <requirements> 8 <requirements>
9 <requirement type="package" version="@VERSION@">gemini</requirement> 9 <requirement type="package" version="@VERSION@">gemini</requirement>
10 <requirement type="package" version="0.2.6">tabix</requirement>
11 <!-- for conda useage -->
12 <!--requirement type="package" version="1.3.1">htslib</requirement-->
13 <yield /> 10 <yield />
14 </requirements> 11 </requirements>
15 </xml> 12 </xml>
16 13
17 <xml name="version_command"> 14 <xml name="version_command">
22 <stdio> 19 <stdio>
23 <exit_code range="1:" /> 20 <exit_code range="1:" />
24 <exit_code range=":-1" /> 21 <exit_code range=":-1" />
25 <regex match="Error:" /> 22 <regex match="Error:" />
26 <regex match="Exception:" /> 23 <regex match="Exception:" />
24 <yield />
27 </stdio> 25 </stdio>
26 </xml>
27
28 <xml name="citations">
29 <citations>
30 <citation type="doi">10.1371/journal.pcbi.1003153</citation>
31 <yield />
32 </citations>
28 </xml> 33 </xml>
29 34
30 <xml name="annotation_dir"> 35 <xml name="annotation_dir">
31 <param name="annotation_databases" type="select" label="Choose a gemini annotation source"> 36 <param name="annotation_databases" type="select" label="Choose a gemini annotation source">
32 <options from_data_table="gemini_versioned_databases"> 37 <options from_data_table="gemini_versioned_databases">
34 <filter type="static_value" column="2" value="@DB_VERSION@" /> 39 <filter type="static_value" column="2" value="@DB_VERSION@" />
35 </options> 40 </options>
36 </param> 41 </param>
37 </xml> 42 </xml>
38 43
44 <xml name="infile">
45 <param name="infile" type="data" format="gemini.sqlite" label="GEMINI database" help="Only files with version @VERSION@ are accepted." >
46 <options options_filter_attribute="metadata.gemini_version" >
47 <filter type="add_value" value="@VERSION@" />
48 </options>
49 </param>
50 </xml>
51
39 <xml name="add_header_column"> 52 <xml name="add_header_column">
40 <param name="header" type="boolean" truevalue="--header" falsevalue="" checked="False" 53 <param argument="--header" name="header" type="boolean" truevalue="--header" falsevalue="" checked="True"
41 label="Add a header of column names to the output" help="(--header)"/> 54 label="Add a header of column names to the output" />
42 </xml> 55 </xml>
43 56
44 <xml name="radius"> 57 <xml name="column_filter" token_help="" token_minimalset="variant_id, gene">
45 <param name="radius" type="integer" value="3" label="Set filter for Breadth-first search (BFS) in the Protein-Protein Interaction network" help="(-r)" >
46 <validator type="in_range" min="0"/>
47 </param>
48 </xml>
49 <xml name="variant_mode">
50 <param name="variant_mode" type="boolean" truevalue="--var" falsevalue="" checked="False"
51 label="Returns variant info (e.g. impact, biotype) for interacting genes" help="(--var)"/>
52 </xml>
53
54 <xml name="column_filter">
55 <conditional name="report"> 58 <conditional name="report">
56 <param name="report_selector" type="select" label="Columns to include in the report" 59 <param name="report_selector" type="select"
57 help="By default, this tool reports all columns in the variants table. One may choose to report only a subset of the columns."> 60 label="Set of columns to include in the variant report table"
58 <option value="all" selected="True">all</option> 61 help="@HELP@">
59 <option value="column_filter">User given columns</option> 62 <option value="minimal">Minimal (report only a preconfigured minimal set of columns)</option>
60 </param> 63 <option value="full">Full (report all columns defined in the GEMINI database variants table)</option>
61 <when value="all"/> 64 <option value="custom">Custom (report user-specified columns)</option>
62 <when value="column_filter"> 65 </param>
63 <param name="columns" type="select" display="checkboxes" multiple="True" label="Choose columns to include in the report" help="(--columns)"> 66 <when value="full" />
67 <when value="minimal">
68 <param name="columns" type="hidden" value="@MINIMALSET@" />
69 <param name="extra_cols" type="hidden" value="" />
70 </when>
71 <when value="custom">
72 <param name="columns" type="select" display="checkboxes" multiple="true" optional="true"
73 label="Choose columns to include in the report" help="(--columns)">
64 <option value="gene">gene</option> 74 <option value="gene">gene</option>
65 <option value="chrom">chrom</option> 75 <option value="chrom">chrom</option>
66 <option value="start">start</option> 76 <option value="start">start</option>
67 <option value="end">end</option> 77 <option value="end">end</option>
68 <option value="ref">ref</option> 78 <option value="ref">ref</option>
69 <option value="alt">alt</option> 79 <option value="alt">alt</option>
70 <option value="impact">impact</option> 80 <option value="impact">impact</option>
71 <option value="impact_severity">impact_severity</option> 81 <option value="impact_severity">impact_severity</option>
72 <option value="max_aaf_all">alternative allele frequency</option> 82 <option value="max_aaf_all">alternative allele frequency (max_aaf_all)</option>
73 </param> 83 </param>
74 <param name="extra_cols" type="text" label="Additional columns." help="Separate by whitespace"/> 84 <param name="extra_cols" type="text"
75 </when> 85 label="Additional columns (comma-separated)"
76 </conditional> 86 help="Column must be specified by the exact name they have in the GEMINI database, e.g., is_exonic or num_hom_alt, but, for genotype columns, GEMINI wildcard syntax is supported. The order of columns in the list is maintained in the output.">
77 </xml>
78
79 <xml name="filter">
80 <conditional name="filter">
81 <param name="filter_selector" type="select" label="Apply additional constraints"
82 help="By default, this tool will report all variants regardless of their putative functional impact. In order to apply additional constraints on the variants returned, you can this optional filter.">
83 <option value="no">No additional constraints</option>
84 <option value="yes">Apply additional constraints</option>
85 </param>
86 <when value="no"/>
87 <when value="yes">
88 <param name="filter" type="text" label="Contraints in SQL syntax" help="Conditions applied here will become WHERE clauses in the query issued to the GEMINI database. E.g. alt='G' or impact_severity = 'HIGH'. (--filter)">
89 <expand macro="sanitize_query" /> 87 <expand macro="sanitize_query" />
90 </param> 88 </param>
91 </when> 89 </when>
92 </conditional> 90 </conditional>
91 </xml>
92
93 <xml name="filter" token_argument="--filter">
94 <param argument="@ARGUMENT@" name="filter" type="text"
95 label="Additional constraints expressed in SQL syntax"
96 help="Constraints defined here will become the WHERE clause of the SQL query issued to the GEMINI database. E.g. alt='G' or impact_severity = 'HIGH'.">
97 <expand macro="sanitize_query" />
98 </param>
93 </xml> 99 </xml>
94 100
95 <xml name="sanitize_query"> 101 <xml name="sanitize_query">
96 <sanitizer invalid_char=""> 102 <sanitizer invalid_char="">
97 <valid initial="string.printable"> 103 <valid initial="string.printable">
101 <add source="&apos;" target="&apos;&quot;&apos;&quot;&apos;" /> 107 <add source="&apos;" target="&apos;&quot;&apos;&quot;&apos;" />
102 </mapping> 108 </mapping>
103 </sanitizer> 109 </sanitizer>
104 </xml> 110 </xml>
105 111
112 <xml name="lenient" token_argument="--lenient" token_truevalue="--lenient" token_help="The exact consequence of this setting depends on the type of inheritance pattern you are looking for (see the tool help below).">
113 <param argument="@ARGUMENT@" name="lenient" type="boolean" truevalue="@TRUEVALUE@" falsevalue="" checked="False"
114 label="Include hits with less convincing inheritance patterns"
115 help= "@HELP@" />
116 </xml>
117
118 <xml name="unaffected">
119 <param argument="--allow-unaffected" name="allow_unaffected" type="boolean" truevalue="--allow-unaffected" falsevalue="" checked="False"
120 label="Report candidates shared by unaffected samples"
121 help="Activating this option will enable the reporting of variants as candidate causative even if they are shared by unaffected samples in the family tree. The default will only report variants that are unique to affected samples."/>
122 </xml>
123
124 <xml name="min_kindreds" token_label="Minimum number of families with a candidate variant for a gene to be reported" token_help="This is the number of families required to have a variant fitting the inheritance model in the same gene in order for the gene and its variants to be reported. For example, we may only be interested in candidates where at least 4 families have a variant (with a fitting inheritance pattern) in that gene.">
125 <param argument="--min-kindreds" name="min_kindreds" type="integer" value="1" min="1"
126 label="@LABEL@"
127 help="@HELP@" />
128 </xml>
129
130 <xml name="insert_constraint" token_max_repeat="1">
131 <repeat name="constraint" title="Additional constraints on variants" default="0" max="@MAX_REPEAT@">
132 <expand macro="filter" />
133 <yield />
134 </repeat>
135 </xml>
136
137 <xml name="overwritable_where_default" token_default_where="">
138 <param name="overwrite_default_filter" type="boolean" checked="false"
139 label="Overwrite the default constraint of this tool"
140 help="By default, this tool restricts its analysis to @DEFAULT_WHERE@ and this constraint is applied on top of any constraint expressed above. With this option here selected, your custom constraint, if given, will overwrite the default instead." />
141 </xml>
142
143 <xml name="gt_filter" token_default_repeat="0" token_min_repeat="0" token_max_repeat="1">
144 <repeat name="filter_by_genotype" title="Genotype filter expression" default="@DEFAULT_REPEAT@" min="@MIN_REPEAT@" max="@MAX_REPEAT@">
145 <param argument="--gt-filter" name="gt_filter" type="text" value="" area="True" size="5x50"
146 label="Restrictions to apply to genotype values" help="">
147 <expand macro="sanitize_query" />
148 <validator type="expression" message="Genotype filter expression cannot be empty">value.strip()</validator>
149 </param>
150 <yield />
151 </repeat>
152 </xml>
153
154 <xml name="sample_filter">
155 <repeat name="filter_by_sample" title="Sample filter expression" default="0" max="1">
156 <param argument="--sample-filter" name="sample_filter" type="text" area="True" size="5x50"
157 label="SQL filter to use to filter the sample table" help="">
158 <expand macro="sanitize_query" />
159 <validator type="expression" message="Sample filter expression cannot be empty">value.strip()</validator>
160 </param>
161 <param argument="--in" name="in" type="select"
162 label="A variant must be in either all, none or any samples passing the sample-query filter"
163 help="">
164 <option value="">Return a variant if it is found in any sample passing the sample filter. (default) </option>
165 <option value="--in all">Return a variant if it is found in ALL samples passing the sample filter. (all)</option>
166 <option value="--in none">Return a variant if it is found in NO sample passing the sample filter. (none)</option>
167 <option value="--in only">Return a variant if it is found in any sample passing the sample filter, and in NO sample NOT passing it. (only)</option>
168 <option value="--in only all">Return a variant if is found in ALL samples passing the sample filter, and in NO sample NOT passing it. (only all)</option>
169 </param>
170 <expand macro="min_kindreds"
171 label="Minimum number of families in which a variant must pass the sample filter" help=""/>
172 <param argument="--family-wise" name="family_wise" type="boolean" truevalue="--family-wise" falsevalue="" checked="False"
173 label="Apply the sample-filter on a family-wise basis" help="If a variant passes the sample filter in at least the minimum number of families specified above it is retained." />
174 </repeat>
175 </xml>
176
177 <xml name="region_filter">
178 <repeat name="regions" title="Region Filter" default="0" min="0"
179 help="Filter variant sites by their position in the genome. If multiple Region Filters are specified, all variants that fall in ONE of the regions are reported.">
180 <param name="chrom" type="text" label="Chromosome">
181 <validator type="expression" message="A chromosome identifier is required when specifying a region filter">value.strip()</validator>
182 </param>
183 <param name="start" type="text" label="Region Start">
184 <validator type="expression" message="an integer number is required">not value or value.isdigit()</validator>
185 </param>
186 <param name="stop" type="text" label="Region End">
187 <validator type="expression" message="an integer number is required">not value or value.isdigit()</validator>
188 </param>
189 </repeat>
190 </xml>
191
106 <token name="@PROVIDE_ANNO_DATA@"><![CDATA[ 192 <token name="@PROVIDE_ANNO_DATA@"><![CDATA[
107 mkdir gemini && 193 mkdir gemini &&
108 ln -s "${annotation_databases.fields.path}/gemini/data" gemini/data && 194 ln -s '${annotation_databases.fields.path}/gemini/data' gemini/data &&
109 export GEMINI_CONFIG="${annotation_databases.fields.path}" && 195 export GEMINI_CONFIG='${annotation_databases.fields.path}' &&
110 ]]></token> 196 ]]></token>
111 197
112 <token name="@MULTILN_SQL_EXPR_TO_CMDLN@"> 198 <token name="@MULTILN_SQL_EXPR_TO_CMDLN@">
113 #set $sql_expr = str($multiline_sql_expr).strip() 199 #set $sql_expr = str($multiline_sql_expr).strip()
114 #if str($sql_expr): 200 #if str($sql_expr):
117 #set $sql_expr = $sql_expr.replace('\\\n', ' ') 203 #set $sql_expr = $sql_expr.replace('\\\n', ' ')
118 $cmdln_param '$sql_expr' 204 $cmdln_param '$sql_expr'
119 #end if 205 #end if
120 </token> 206 </token>
121 207
122 <token name="@CMDLN_SQL_FILTER_FILTER_OPTION@"> 208 <token name="@SET_COLS@">
123 #if str($filter.filter_selector) == 'yes' and $filter.filter: 209 #if str($report.report_selector) == 'full':
124 --filter '${ str( $filter.filter ) }' 210 #set cols = "*"
211 #else:
212 #if $report.columns and str($report.columns) != '':
213 #set $cols = str($report.columns)
214 #else
215 #set $cols = ''
216 #end if
217 #if str($report.extra_cols).strip():
218 #if $cols:
219 #set $cols = $cols + ', ' + str($report.extra_cols)
220 #else:
221 #set $cols = str($report.extra_cols)
222 #end if
223 #end if
224 #if not $cols:
225 #set $cols = "variant_id, gene"
226 #end if
125 #end if 227 #end if
126 </token> 228 </token>
127 229
128 <token name="@COLUMN_SELECT@"> 230 <token name="@COLUMN_SELECT@">
129 #if $report.report_selector != 'all': 231 @SET_COLS@
130 --columns "${report.columns} 232 #if $cols != "*"
131 #if str($report.extra_cols).strip() 233 --columns '$cols'
132 #echo ','+','.join(str($report.extra_cols).split())
133 #end if
134 "
135 #end if 234 #end if
136 </token> 235 </token>
137 236
138 <xml name="family"> 237 <token name="@PARSE_REGION_ELEMENTS@"><![CDATA[
139 <param name="families" type="text" value="" label="Comma seperated list of families to restrict the analysis to." help="e.g. Family1,Family3 (--families)"/> 238 #set $region_elements = []
140 </xml> 239 #for $r in $regions:
141 240 ## The actual chromosome name needs to be single-quoted
142 <xml name="lenient"> 241 ## in SQL, so we need to quote the single quotes like the
143 <param name="lenient" type="boolean" truevalue="--lenient" falsevalue="" checked="False" label="Loosen the restrictions on family structure"/> 242 ## sanitize_query macro would if the whole was a parameter.
144 </xml> 243 #set $r_elements = ["chrom = '\"'\"'%s'\"'\"'" % str($r.chrom).strip()]
145 244 #if str($r.start).strip():
146 <xml name="unaffected"> 245 #silent $r_elements.append("start >= %d" % int($r.start))
147 <param name="allow_unaffected" type="boolean" truevalue="--allow-unaffected" falsevalue="" checked="False" label="Report candidates that also impact samples labeled as unaffected." help="(--allow-unaffected)"/> 246 #end if
148 </xml> 247 #if str($r.stop).strip():
149 248 #silent $r_elements.append("end <= %d" % int($r.stop))
150 <xml name="min_kindreds"> 249 #end if
151 <param name="min_kindreds" type="integer" value="1" label="The min. number of kindreds that must have a candidate variant in a gene" help="default: 1 (--min-kindreds)" /> 250 #silent $region_elements.append("(%s)" % " AND ".join($r_elements))
152 </xml> 251 #end for
153 252 ]]>
154 <xml name="min_sequence_depth"> 253 </token>
155 <param name="d" type="integer" value="0" min="0" label="The minimum aligned sequence depth (genotype DP) required for each sample"
156 help="default: 0 (-d)" />
157 </xml>
158
159 <xml name="min_gq">
160 <param name="min_gq" type="integer" value="0" label="the minimum genotype quality required for each sample in a family" help="default: 0 (--min-gq)">
161 <validator type="in_range" min="0"/>
162 </param>
163 </xml>
164
165 <xml name="gt_pl_max">
166 <param name="gt_pl_max" type="integer" value="-1" min="-1" label="The maximum phred-scaled genotype likelihod (PL) allowed for each sample in a family" help="default: -1 (not set) (--gt-pl-max)" />
167 </xml>
168
169 <xml name="citations">
170 <citations>
171 <citation type="doi">10.1371/journal.pcbi.1003153</citation>
172 <yield />
173 </citations>
174 </xml>
175
176 <xml name="infile">
177 <param name="infile" type="data" format="gemini.sqlite" label="GEMINI database" help="Only files with version @VERSION@ are accepted." >
178 <options options_filter_attribute="metadata.gemini_version" >
179 <filter type="add_value" value="@VERSION@" />
180 </options>
181 <validator type="expression" message="This version of Gemini will only work with Gemini files that are for version @VERSION@.">value is not None and value.metadata.gemini_version == "@VERSION@"</validator>
182 </param>
183 </xml>
184
185 </macros> 254 </macros>