-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcellularLocalization.dst
More file actions
347 lines (315 loc) · 15.7 KB
/
Copy pathcellularLocalization.dst
File metadata and controls
347 lines (315 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
[templateStart]
name=geneImageGoTermQuestion
anchorFile=ApiCommonModel/Model/lib/wdk/model/questions/geneQuestions.xml
prop=datasetName
prop=datasetDisplayName
prop=datasetShortDisplayName
prop=buildNumberIntroduced
prop=includeProjects
>templateTextStart<
<question name="GenesByGoTermCL_${datasetName}"
displayName="${datasetDisplayName} Cellular Localization Imaging"
shortDisplayName="${datasetShortDisplayName} GO CL"
queryRef="GeneId.GenesByGoTermCLDataset"
recordClassRef="TranscriptRecordClasses.TranscriptRecordClass"
includeProjects="${includeProjects}"
newBuild="${buildNumberIntroduced}">
<paramRef ref="geneParams.cellularLocImageDataset" default="${datasetName}" visible="false"/>
<paramRef ref="geneParams.go_typeahead_cl"/>
<paramRef ref="geneParams.go_term"/>
<summary>
<![CDATA[
Find genes based on GO cellular component terms and view cellular localization images from ${datasetDisplayName}.
]]>
</summary>
<description>
<![CDATA[
Search for genes by GO cellular component terms and visualize their cellular localization using images from ${datasetDisplayName}.
]]>
</description>
</question>
>templateTextEnd<
[templateStart]
name=geneImageGoTermOntology
anchorFile=ApiCommonModel/Model/lib/wdk/ontology/individuals.txt
prop=datasetName
>templateTextStart<
TranscriptRecordClasses.TranscriptRecordClass.GeneQuestions.GenesByGoTermCL_${datasetName} searchCategory-cellular-localization-goassoc Protein targeting and localization TranscriptRecordClasses.TranscriptRecordClass search GeneQuestions.GenesByGoTermCL_${datasetName} webservice
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaQuestion
anchorFile=ApiCommonModel/Model/lib/wdk/model/questions/geneQuestions.xml
prop=presenterId
prop=datasetName
prop=datasetDisplayName
prop=datasetShortDisplayName
prop=buildNumberIntroduced
prop=includeProjects
prop=cellularLocalizationWdkAttributes
>templateTextStart<
<question name="GenesByCellularLocalizationEdaSubset_${datasetName}" includeProjects="${includeProjects}" newBuild="${buildNumberIntroduced}"
displayName="${datasetDisplayName} Cellular Localization"
shortDisplayName="${datasetShortDisplayName} (QCL)"
queryRef="GeneId.GenesByEdaSubsetGeneric"
recordClassRef="TranscriptRecordClasses.TranscriptRecordClass">
<paramRef ref="geneParams.eda_dataset_id" default="${presenterId}" visible="false"/>
<paramRef ref="geneParams.eda_analysis_spec" allowEmpty="true" prompt="Filter genes based on cellular localization data"/>
<!-- TODO - add in attributesList, when available: ${cellularLocalizationWdkAttributes} -->
<attributesList
summary="organism,gene_location_text,gene_product"
/>
<summary><![CDATA[
Filter genes by Cellular Localization Data.
]]>
</summary>
<description> <![CDATA[
Filter genes by Cellular Localization Data. Click on a filter on the left to view data and apply a filter. You can apply as many filters as you choose.
]]>
</description>
</question>
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaGeneTableSql
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/geneTableQueries.xml
prop=datasetName
prop=edaStudyStableId
prop=edaEntityAbbrev
>templateTextStart<
UNION
SELECT '${datasetName}' AS dataset_name , string_value AS source_id
FROM eda.ATTRIBUTEvalue_${edaStudyStableId}_${edaEntityAbbrev} av
WHERE av.attribute_stable_id = 'VEUPATHDB_GENE_ID'
>templateTextEnd<
[templateStart]
name=cellularLocalizationDataTableGeneTableSql
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/geneTableQueries.xml
prop=datasetName
prop=edaStudyStableId
prop=edaEntityAbbrev
>templateTextStart<
UNION
SELECT genes.string_value AS gene,
ag.display_name AS variable,
av.string_value,
av.number_value,
av.date_value,
'${datasetName}' AS dataset_id
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av,
eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev} ag,
(SELECT av.${edaEntityAbbrev}_stable_id, MIN(gi.gene) as string_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av
JOIN apidbtuning.GeneId gi ON gi.id = av.string_value
WHERE av.attribute_stable_id = 'VEUPATHDB_GENE_ID'
GROUP BY av.${edaEntityAbbrev}_stable_id) genes
WHERE av.attribute_stable_id = ag.stable_id
AND av.${edaEntityAbbrev}_stable_id = genes.${edaEntityAbbrev}_stable_id
AND av.attribute_stable_id != 'VEUPATHDB_GENE_ID'
>templateTextEnd<
[templateStart]
name=cellularLocalizationAllDataGeneTableSql
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/geneTableQueries.xml
prop=datasetName
prop=edaStudyStableId
prop=edaEntityAbbrev
prop=datasetDisplayName
prop=shortAttribution
>templateTextStart<
UNION
SELECT genes.string_value AS gene,
'${datasetName}' AS dataset_presenter_id,
'${datasetDisplayName}' AS dataset_presenter_display_name,
'${shortAttribution}' AS short_attribution,
ag.display_name AS variable,
coalesce(av.string_value, coalesce(round(av.number_value::numeric, 4)::text, av.date_value::text)) AS value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av,
eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev} ag,
(SELECT av.${edaEntityAbbrev}_stable_id, MIN(gi.gene) as string_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av
JOIN apidbtuning.GeneId gi ON gi.id = av.string_value
WHERE av.attribute_stable_id = 'VEUPATHDB_GENE_ID'
GROUP BY av.${edaEntityAbbrev}_stable_id) genes
WHERE av.attribute_stable_id = ag.stable_id
AND av.${edaEntityAbbrev}_stable_id = genes.${edaEntityAbbrev}_stable_id
AND av.attribute_stable_id != 'VEUPATHDB_GENE_ID'
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaAttributeQueriesNumeric
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/transcriptAttributeQueries.xml
prop=datasetName
prop=edaStudyStableId
prop=edaEntityAbbrev
prop=includeProjects
>templateTextStart<
<sqlQuery name="CellularLocalizationVariablesNumeric${datasetName}"
doNotTest="true"
attributeMetaQueryRef="TranscriptAttributes.MetaCellularLocalizationVariablesNumeric${datasetName}"
includeProjects="${includeProjects}">
<column name="source_id"/>
<column name="gene_source_id"/>
<column name="project_id"/>
<sql>
<![CDATA[
SELECT ta.source_id, ta.project_id, ta.gene_source_id, p.*
FROM apidbtuning.TranscriptAttributes ta
LEFT OUTER JOIN (
SELECT * FROM public.crosstab(
'SELECT genes.string_value as gene_id
, CONCAT(''${edaStudyStableId}_'', av.attribute_stable_id) as attribute_stable_id
, av.number_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av,
eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev} ag,
(SELECT av.${edaEntityAbbrev}_stable_id, MIN(gi.gene) as string_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av
JOIN apidbtuning.GeneId gi ON gi.id = av.string_value
WHERE av.attribute_stable_id = ''VEUPATHDB_GENE_ID''
GROUP BY av.${edaEntityAbbrev}_stable_id) genes
WHERE av.${edaEntityAbbrev}_stable_id = genes.${edaEntityAbbrev}_stable_id
AND av.attribute_stable_id != ''VEUPATHDB_GENE_ID''
AND av.attribute_stable_id = ag.stable_id
AND ag.has_values = 1
AND (ag.data_type = ''number'' OR ag.data_type = ''integer'')
AND (ag.hidden IS NULL OR NOT (ag.hidden::jsonb @> ''["variableTree"]''::jsonb))
ORDER BY 1, 2',
'SELECT CONCAT(''${edaStudyStableId}_'', stable_id) as stable_id
FROM eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev}
WHERE has_values = 1
AND stable_id != ''VEUPATHDB_GENE_ID''
AND (data_type = ''number'' OR data_type = ''integer'')
AND (hidden IS NULL OR NOT (hidden::jsonb @> ''["variableTree"]''::jsonb))
ORDER BY stable_id'
) AS ct(gene_id text, &&META_ATTRIBUTE_COLUMNS_FOR_CROSSTAB&&)
) p ON ta.gene_source_id = p.gene_id
]]>
</sql>
</sqlQuery>
<sqlQuery name="MetaCellularLocalizationVariablesNumeric${datasetName}" includeProjects="${includeProjects}">
<column name="name" />
<column name="display_name" />
<column name="help" />
<column name="reporter_name" />
<column name="reporter_display" />
<column name="reporter_description" />
<column name="reporter_implementation" />
<column name="reporter_properties" />
<sql>
<![CDATA[
SELECT CONCAT('${edaStudyStableId}_', stable_id) as name,
display_name,
'number' as column_type,
'Cellular Localization variable from ${datasetName}' as help,
'histogram' as reporter_name,
'Histogram' as reporter_display,
'Display a histogram of the values' as reporter_description,
'org.gusdb.wdk.model.report.reporter.HistogramAttributeReporter' as reporter_implementation,
null as reporter_properties
FROM eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev}
WHERE has_values = 1
AND (data_type = 'number' OR data_type = 'integer')
AND stable_id != 'VEUPATHDB_GENE_ID'
AND (hidden IS NULL OR NOT (hidden::jsonb @> '["variableTree"]'::jsonb))
ORDER BY stable_id
]]>
</sql>
</sqlQuery>
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaAttributeQueriesString
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/transcriptAttributeQueries.xml
prop=datasetName
prop=edaStudyStableId
prop=edaEntityAbbrev
prop=includeProjects
>templateTextStart<
<sqlQuery name="CellularLocalizationVariablesString${datasetName}"
doNotTest="true"
attributeMetaQueryRef="TranscriptAttributes.MetaCellularLocalizationVariablesString${datasetName}"
includeProjects="${includeProjects}">
<column name="source_id"/>
<column name="gene_source_id"/>
<column name="project_id"/>
<sql>
<![CDATA[
SELECT ta.source_id, ta.project_id, ta.gene_source_id, p.*
FROM apidbtuning.TranscriptAttributes ta
LEFT OUTER JOIN (
SELECT * FROM public.crosstab(
'SELECT genes.string_value as gene_id
, CONCAT(''${edaStudyStableId}_'', av.attribute_stable_id) as attribute_stable_id
, av.string_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av,
eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev} ag,
(SELECT av.${edaEntityAbbrev}_stable_id, MIN(gi.gene) as string_value
FROM eda.attributevalue_${edaStudyStableId}_${edaEntityAbbrev} av
JOIN apidbtuning.GeneId gi ON gi.id = av.string_value
WHERE av.attribute_stable_id = ''VEUPATHDB_GENE_ID''
GROUP BY av.${edaEntityAbbrev}_stable_id) genes
WHERE av.${edaEntityAbbrev}_stable_id = genes.${edaEntityAbbrev}_stable_id
AND av.attribute_stable_id != ''VEUPATHDB_GENE_ID''
AND av.attribute_stable_id = ag.stable_id
AND ag.has_values = 1
AND ag.data_type NOT IN (''number'', ''integer'')
AND (ag.hidden IS NULL OR NOT (ag.hidden::jsonb @> ''["variableTree"]''::jsonb))
ORDER BY 1, 2',
'SELECT CONCAT(''${edaStudyStableId}_'', stable_id) as stable_id
FROM eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev}
WHERE has_values = 1
AND stable_id != ''VEUPATHDB_GENE_ID''
AND data_type NOT IN (''number'', ''integer'')
AND (hidden IS NULL OR NOT (hidden::jsonb @> ''["variableTree"]''::jsonb))
ORDER BY stable_id'
) AS ct(gene_id text, &&META_ATTRIBUTE_COLUMNS_FOR_CROSSTAB&&)
) p ON ta.gene_source_id = p.gene_id
]]>
</sql>
</sqlQuery>
<sqlQuery name="MetaCellularLocalizationVariablesString${datasetName}" includeProjects="${includeProjects}">
<column name="name" />
<column name="display_name" />
<column name="help" />
<column name="reporter_name" />
<column name="reporter_display" />
<column name="reporter_description" />
<column name="reporter_implementation" />
<column name="reporter_properties" />
<sql>
<![CDATA[
SELECT CONCAT('${edaStudyStableId}_', stable_id) as name,
display_name,
'string' as column_type,
'Cellular Localization variable from ${datasetName}' as help,
'wordCloud' as reporter_name,
'Word Cloud' as reporter_display,
'Display a word cloud of the values' as reporter_description,
'org.eupathdb.common.model.report.EbrcWordCloudAttributeReporter' as reporter_implementation,
null as reporter_properties
FROM eda.attributegraph_${edaStudyStableId}_${edaEntityAbbrev}
WHERE has_values = 1
AND data_type NOT IN ('number', 'integer')
AND stable_id != 'VEUPATHDB_GENE_ID'
AND (hidden IS NULL OR NOT (hidden::jsonb @> '["variableTree"]'::jsonb))
ORDER BY stable_id
]]>
</sql>
</sqlQuery>
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaAttributeRef
anchorFile=ApiCommonModel/Model/lib/wdk/model/records/transcriptRecord.xml
prop=datasetName
prop=includeProjects
>templateTextStart<
<attributeQueryRef ref="TranscriptAttributes.CellularLocalizationVariablesNumeric${datasetName}" attributeMetaQueryRef="TranscriptAttributes.MetaCellularLocalizationVariablesNumeric${datasetName}" includeProjects="${includeProjects}">
</attributeQueryRef>
<attributeQueryRef ref="TranscriptAttributes.CellularLocalizationVariablesString${datasetName}" attributeMetaQueryRef="TranscriptAttributes.MetaCellularLocalizationVariablesString${datasetName}" includeProjects="${includeProjects}">
</attributeQueryRef>
>templateTextEnd<
[templateStart]
name=cellularLocalizationEdaAttributeCategory
anchorFile=ApiCommonModel/Model/lib/wdk/ontology/individuals.txt
prop=datasetName
prop=datasetDisplayName
>templateTextStart<
CellularLocalizationDataset_${datasetName} http://edamontology.org/topic_0140 Protein targeting and localization DatasetRecordClasses.DatasetRecordClass dataset ${datasetName} ${datasetDisplayName} results
TranscriptAttributes.MetaCellularLocalizationVariablesNumeric${datasetName} CellularLocalizationDataset_${datasetName} TranscriptRecordClasses.TranscriptRecordClass attributeMetaQuery MetaCellularLocalizationVariablesNumeric${datasetName} gene results download
TranscriptAttributes.MetaCellularLocalizationVariablesString${datasetName} CellularLocalizationDataset_${datasetName} TranscriptRecordClasses.TranscriptRecordClass attributeMetaQuery MetaCellularLocalizationVariablesString${datasetName} gene results download
>templateTextEnd<