forked from BimberLab/DiscvrLabKeyModules
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsequenceAnalysisDetails.html
More file actions
123 lines (109 loc) · 4.72 KB
/
sequenceAnalysisDetails.html
File metadata and controls
123 lines (109 loc) · 4.72 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
<script type="text/javascript" nonce="<%=scriptNonce%>">
Ext4.onReady(function (){
var analysisId = LABKEY.ActionURL.getParameter('id');
if (!analysisId){
alert('Must Provide Analysis Id');
return;
}
var webpart = <%=webpartContext%>;
Ext4.get(webpart.wrapperDivId).update(
'<div id="analysisDetails_'+webpart.wrapperDivId+'"></div>' +
'<div style="margin-bottom: 10px;"></div>' +
'<div id="sampleDetails_'+webpart.wrapperDivId+'"></div>' +
'<div style="margin-bottom: 10px;"></div>' +
//'<div id="analysisNav_'+webpart.wrapperDivId+'"></div>' +
//'<br>' +
'<div id="outputs_'+webpart.wrapperDivId+'"></div>' +
'<div id="qualityMetrics_'+webpart.wrapperDivId+'"></div>' +
'<div style="margin-bottom: 10px;"></div>' +
'<div id="readsetDiv_'+webpart.wrapperDivId+'"/>'
);
Ext4.create('LDK.panel.DetailsPanel', {
title: 'Analysis Run Details:',
showBackBtn: false,
renderTo: 'analysisDetails_'+webpart.wrapperDivId,
store: {
schemaName: 'sequenceanalysis',
queryName: 'sequence_analyses',
viewName: 'Detailed',
filterArray: [LABKEY.Filter.create('rowid', analysisId, LABKEY.Filter.Types.EQUAL)]
},
detailsConfig: {
buttons: [{
text: 'More Actions',
menu: [{
text: 'Edit Analysis Details',
href: LABKEY.ActionURL.buildURL('ldk', 'manageRecord', null, {schemaName: 'sequenceanalysis', queryName: 'sequence_analyses', keyField: 'rowid', key: analysisId}) + '&returnUrl=' + LDK.Utils.getReturnUrl()
}]
}]
}
});
LABKEY.Query.selectRows({
schemaName: 'sequenceanalysis',
queryName: 'sequence_analyses',
columns: 'rowid,readset,runid,runid/name',
filterArray: [LABKEY.Filter.create('rowid', analysisId, LABKEY.Filter.Types.EQUAL)],
scope: this,
successCallback: onSuccess
});
LDK.Utils.getReadOnlyQWP({
title: 'Outputs',
schemaName: 'sequenceanalysis',
queryName: 'outputfiles',
maxRows: 20,
containerPath: Laboratory.Utils.getQueryContainerPath(),
filterArray: [LABKEY.Filter.create('analysis_id', analysisId, LABKEY.Filter.Types.EQUAL)]
}).render('outputs_'+webpart.wrapperDivId);
LDK.Utils.getReadOnlyQWP({
title: 'Quality Metrics',
schemaName: 'sequenceanalysis',
queryName: 'quality_metrics',
maxRows: 20,
containerPath: Laboratory.Utils.getQueryContainerPath(),
columns: 'dataid,metricname,metricvalue,qualvalue,comment,workbook,readset,runid',
filterArray: [LABKEY.Filter.create('analysis_id', analysisId, LABKEY.Filter.Types.EQUAL)]
}).render('qualityMetrics_'+webpart.wrapperDivId);
function onSuccess(data){
if (!data.rows.length)
return;
var row = data.rows[0];
if (row.readset){
var panel = Ext4.create('LDK.panel.DetailsPanel', {
title: 'Readset Details:',
showBackBtn: false,
renderTo: 'sampleDetails_' + webpart.wrapperDivId,
store: {
containerPath: Laboratory.Utils.getQueryContainerPath(),
schemaName: 'sequenceanalysis',
queryName: 'sequence_readsets',
filterArray: [LABKEY.Filter.create('rowid', row.readset, LABKEY.Filter.Types.EQUAL)]
},
detailsConfig: {
buttons: [{
text: 'More Actions',
menu: [{
text: 'Edit Readset Details',
href: LABKEY.ActionURL.buildURL('ldk', 'manageRecord', null, {schemaName: 'sequenceanalysis', queryName: 'sequence_readsets', keyField: 'rowid', key: row.readset}) + '&returnUrl=' + LDK.Utils.getReturnUrl()
}]
}]
}
});
}
if (row['runid/name']){
LABKEY.Query.selectRows({
schemaName: 'pipeline',
queryName: 'job',
containerPath: Laboratory.Utils.getQueryContainerPath(),
columns: '*',
filterArray: [LABKEY.Filter.create('description', row['runid/name'], LABKEY.Filter.Types.EQUAL)],
scope: this,
successCallback: function(results){
if(results && results.rows && results.rows[0]){
var jobId = results.rows[0].RowId;
}
}
});
}
}
});
</script>