6869 |
15 Nov 22 |
nicklas |
var Methylation = function() |
6869 |
15 Nov 22 |
nicklas |
2 |
{ |
6869 |
15 Nov 22 |
nicklas |
var meth = {}; |
6869 |
15 Nov 22 |
nicklas |
var debug = 0; |
6869 |
15 Nov 22 |
nicklas |
var selectionIsValid = false; |
6869 |
15 Nov 22 |
nicklas |
var subtypeMethylation = null; |
6869 |
15 Nov 22 |
nicklas |
var annotationTypePipeline = null; |
6869 |
15 Nov 22 |
nicklas |
8 |
|
6869 |
15 Nov 22 |
nicklas |
var clusterIsValid = false; |
6869 |
15 Nov 22 |
nicklas |
var manuallySelected = []; |
6869 |
15 Nov 22 |
nicklas |
11 |
|
6869 |
15 Nov 22 |
nicklas |
// Page initialization |
6869 |
15 Nov 22 |
nicklas |
meth.initPage = function() |
6869 |
15 Nov 22 |
nicklas |
14 |
{ |
6869 |
15 Nov 22 |
nicklas |
// Step 1 |
6869 |
15 Nov 22 |
nicklas |
Buttons.addClickHandler('btnSelectMethylation', meth.selectMethylationItems); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('methylationItems', 'base-selected', meth.setMethylationItemsCallback); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('methylationItems', 'change', meth.methylationItemsOnChange); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', meth.validateStep1); |
6869 |
15 Nov 22 |
nicklas |
20 |
|
6869 |
15 Nov 22 |
nicklas |
// Step 2 |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', meth.initializeStep2); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', meth.validateStep2); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('clusters', 'change', meth.clusterOnChange); |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('betaSoftware', 'change', meth.softwareOnChange); |
6869 |
15 Nov 22 |
nicklas |
26 |
|
6869 |
15 Nov 22 |
nicklas |
// Navigation |
6869 |
15 Nov 22 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
6869 |
15 Nov 22 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
6869 |
15 Nov 22 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
6869 |
15 Nov 22 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
6869 |
15 Nov 22 |
nicklas |
32 |
|
6869 |
15 Nov 22 |
nicklas |
// Final registration |
6869 |
15 Nov 22 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', meth.submit); |
6869 |
15 Nov 22 |
nicklas |
35 |
|
6869 |
15 Nov 22 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
6869 |
15 Nov 22 |
nicklas |
var url = '../Methylation.servlet?ID='+App.getSessionId(); |
6869 |
15 Nov 22 |
nicklas |
url += '&cmd=GetMethylationItemsForBetaAnalysis'; |
6869 |
15 Nov 22 |
nicklas |
Wizard.asyncJsonRequest(url, meth.initializeStep1); |
6869 |
15 Nov 22 |
nicklas |
40 |
} |
6869 |
15 Nov 22 |
nicklas |
41 |
|
6869 |
15 Nov 22 |
nicklas |
// --- Step 1 ----------------------------------- |
6869 |
15 Nov 22 |
nicklas |
meth.initializeStep1 = function(response) |
6869 |
15 Nov 22 |
nicklas |
44 |
{ |
6869 |
15 Nov 22 |
nicklas |
var methylationItems = response.methylationItems; |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
47 |
|
6869 |
15 Nov 22 |
nicklas |
if (methylationItems != null && methylationItems.length > 0) |
6869 |
15 Nov 22 |
nicklas |
49 |
{ |
6869 |
15 Nov 22 |
nicklas |
var firstChip = null; |
6869 |
15 Nov 22 |
nicklas |
for (var mNo=0; mNo < methylationItems.length; mNo++) |
6869 |
15 Nov 22 |
nicklas |
52 |
{ |
6869 |
15 Nov 22 |
nicklas |
var m = methylationItems[mNo]; |
6869 |
15 Nov 22 |
nicklas |
var beadChip = m.beadChip ? m.beadChip : null; |
6869 |
15 Nov 22 |
nicklas |
if (firstChip == null && beadChip != null) firstChip = beadChip.name; |
6869 |
15 Nov 22 |
nicklas |
var option = meth.createListOption(mNo+1, m, m.DO_NOT_USE == null && beadChip != null && beadChip.name==firstChip) |
6869 |
15 Nov 22 |
nicklas |
frm.methylationItems.options[frm.methylationItems.length] = option; |
6869 |
15 Nov 22 |
nicklas |
58 |
} |
6869 |
15 Nov 22 |
nicklas |
Events.sendChangeEvent('methylationItems'); |
6869 |
15 Nov 22 |
nicklas |
60 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
62 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems', 'invalid', 'No new methylation items available for processing'); |
6869 |
15 Nov 22 |
nicklas |
64 |
} |
6869 |
15 Nov 22 |
nicklas |
65 |
|
6869 |
15 Nov 22 |
nicklas |
Doc.show('step-1'); |
6869 |
15 Nov 22 |
nicklas |
Doc.show('gonext'); |
6869 |
15 Nov 22 |
nicklas |
68 |
|
6869 |
15 Nov 22 |
nicklas |
frm.methylationItems.focus(); |
6869 |
15 Nov 22 |
nicklas |
70 |
} |
6869 |
15 Nov 22 |
nicklas |
71 |
|
6869 |
15 Nov 22 |
nicklas |
meth.validateStep1 = function(event) |
6869 |
15 Nov 22 |
nicklas |
73 |
{ |
6869 |
15 Nov 22 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
6869 |
15 Nov 22 |
nicklas |
75 |
} |
6869 |
15 Nov 22 |
nicklas |
76 |
|
6869 |
15 Nov 22 |
nicklas |
meth.selectMethylationItems = function() |
6869 |
15 Nov 22 |
nicklas |
78 |
{ |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
if (frm.methylationItems.disabled) return; |
6869 |
15 Nov 22 |
nicklas |
81 |
|
6869 |
15 Nov 22 |
nicklas |
if (subtypeMethylation == null) |
6869 |
15 Nov 22 |
nicklas |
83 |
{ |
6869 |
15 Nov 22 |
nicklas |
subtypeMethylation = Reggie.getSubtypeInfo('METHYLATION'); |
6869 |
15 Nov 22 |
nicklas |
85 |
} |
6869 |
15 Nov 22 |
nicklas |
if (annotationTypePipeline == null) |
6869 |
15 Nov 22 |
nicklas |
87 |
{ |
6869 |
15 Nov 22 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
6869 |
15 Nov 22 |
nicklas |
89 |
} |
6869 |
15 Nov 22 |
nicklas |
90 |
|
6869 |
15 Nov 22 |
nicklas |
// Reset list |
6869 |
15 Nov 22 |
nicklas |
manuallySelected = []; |
6869 |
15 Nov 22 |
nicklas |
var url = '&resetTemporary=1'; |
6869 |
15 Nov 22 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeMethylation.id; |
6869 |
15 Nov 22 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'='+encodeURIComponent('DNA/Methylation'); |
6869 |
15 Nov 22 |
nicklas |
96 |
|
6869 |
15 Nov 22 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'methylationItems', 1, url); |
6869 |
15 Nov 22 |
nicklas |
98 |
} |
6869 |
15 Nov 22 |
nicklas |
99 |
|
6869 |
15 Nov 22 |
nicklas |
meth.setMethylationItemsCallback = function(event) |
6869 |
15 Nov 22 |
nicklas |
101 |
{ |
6869 |
15 Nov 22 |
nicklas |
var m = event.detail; |
6869 |
15 Nov 22 |
nicklas |
var opt = Reggie.getListOption('methylationItems', m.id); |
6869 |
15 Nov 22 |
nicklas |
if (opt) |
6869 |
15 Nov 22 |
nicklas |
105 |
{ |
6869 |
15 Nov 22 |
nicklas |
opt.selected = true; |
6869 |
15 Nov 22 |
nicklas |
107 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
109 |
{ |
6869 |
15 Nov 22 |
nicklas |
manuallySelected[manuallySelected.length] = m.id; |
6869 |
15 Nov 22 |
nicklas |
111 |
} |
6869 |
15 Nov 22 |
nicklas |
112 |
|
6869 |
15 Nov 22 |
nicklas |
if (m.remaining == 0 && manuallySelected.length > 0) |
6869 |
15 Nov 22 |
nicklas |
114 |
{ |
6869 |
15 Nov 22 |
nicklas |
var url = '../Methylation.servlet?ID='+App.getSessionId(); |
6869 |
15 Nov 22 |
nicklas |
url += '&cmd=GetMethylationItemsForBetaAnalysis'; |
6869 |
15 Nov 22 |
nicklas |
url += '&items='+manuallySelected.join(','); |
6869 |
15 Nov 22 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
6869 |
15 Nov 22 |
nicklas |
Wizard.asyncJsonRequest(url, meth.manuallySelected); |
6869 |
15 Nov 22 |
nicklas |
120 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
122 |
{ |
6869 |
15 Nov 22 |
nicklas |
Events.sendChangeEvent('methylationItems'); |
6869 |
15 Nov 22 |
nicklas |
124 |
} |
6869 |
15 Nov 22 |
nicklas |
125 |
} |
6869 |
15 Nov 22 |
nicklas |
126 |
|
6869 |
15 Nov 22 |
nicklas |
meth.manuallySelected = function(response) |
6869 |
15 Nov 22 |
nicklas |
128 |
{ |
6869 |
15 Nov 22 |
nicklas |
var methylationItems = response.methylationItems; |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
131 |
|
6869 |
15 Nov 22 |
nicklas |
if (methylationItems != null && methylationItems.length > 0) |
6869 |
15 Nov 22 |
nicklas |
133 |
{ |
6869 |
15 Nov 22 |
nicklas |
var offset = frm.methylationItems.length+1; |
6869 |
15 Nov 22 |
nicklas |
for (var mNo=0; mNo < methylationItems.length; mNo++) |
6869 |
15 Nov 22 |
nicklas |
136 |
{ |
6869 |
15 Nov 22 |
nicklas |
var m = methylationItems[mNo]; |
6869 |
15 Nov 22 |
nicklas |
var option = meth.createListOption(mNo+offset, m, m.DO_NOT_USE == null); |
6869 |
15 Nov 22 |
nicklas |
frm.methylationItems.options[frm.methylationItems.length] = option; |
6869 |
15 Nov 22 |
nicklas |
140 |
} |
6869 |
15 Nov 22 |
nicklas |
Events.sendChangeEvent('methylationItems'); |
6869 |
15 Nov 22 |
nicklas |
142 |
} |
6869 |
15 Nov 22 |
nicklas |
143 |
} |
6869 |
15 Nov 22 |
nicklas |
144 |
|
6869 |
15 Nov 22 |
nicklas |
meth.createListOption = function(index, methylationItem, selected) |
6869 |
15 Nov 22 |
nicklas |
146 |
{ |
6869 |
15 Nov 22 |
nicklas |
var dna = methylationItem.dna; |
6869 |
15 Nov 22 |
nicklas |
var chip = methylationItem.beadChip; |
6869 |
15 Nov 22 |
nicklas |
149 |
|
6869 |
15 Nov 22 |
nicklas |
var tooltip = null; |
6869 |
15 Nov 22 |
nicklas |
var name = (index) + ': '+methylationItem.name; |
6869 |
15 Nov 22 |
nicklas |
name += ' - '+chip.BeadChipId+'_'+dna.BeadChipPosition; |
6869 |
15 Nov 22 |
nicklas |
153 |
|
6869 |
15 Nov 22 |
nicklas |
if (methylationItem.DO_NOT_USE) |
6869 |
15 Nov 22 |
nicklas |
155 |
{ |
6869 |
15 Nov 22 |
nicklas |
name += ' [DoNotUse]'; |
6869 |
15 Nov 22 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(methylationItem.DO_NOT_USE+': '+methylationItem.DO_NOT_USE_COMMENT); |
6869 |
15 Nov 22 |
nicklas |
158 |
} |
6869 |
15 Nov 22 |
nicklas |
else if (methylationItem.AutoProcess == 'ReProcess') |
6869 |
15 Nov 22 |
nicklas |
160 |
{ |
6869 |
15 Nov 22 |
nicklas |
name += ' [R]'; |
6869 |
15 Nov 22 |
nicklas |
162 |
} |
6869 |
15 Nov 22 |
nicklas |
163 |
|
6869 |
15 Nov 22 |
nicklas |
var option = new Option(name, methylationItem.id, false, selected); |
6869 |
15 Nov 22 |
nicklas |
if (tooltip) option.title = tooltip; |
6869 |
15 Nov 22 |
nicklas |
option.methylationItem = methylationItem; |
6869 |
15 Nov 22 |
nicklas |
return option; |
6869 |
15 Nov 22 |
nicklas |
168 |
} |
6869 |
15 Nov 22 |
nicklas |
169 |
|
6869 |
15 Nov 22 |
nicklas |
meth.methylationItemsOnChange = function() |
6869 |
15 Nov 22 |
nicklas |
171 |
{ |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
selectionIsValid = false; |
6869 |
15 Nov 22 |
nicklas |
var numSelected = 0; |
6869 |
15 Nov 22 |
nicklas |
var numDoNotUse = 0; |
6869 |
15 Nov 22 |
nicklas |
var invalidPipeline = null; |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems'); |
6869 |
15 Nov 22 |
nicklas |
Wizard.hideGoNextConfirmation(); |
6869 |
15 Nov 22 |
nicklas |
179 |
|
6869 |
15 Nov 22 |
nicklas |
for (var mNo = 0; mNo < frm.methylationItems.length; mNo++) |
6869 |
15 Nov 22 |
nicklas |
181 |
{ |
6869 |
15 Nov 22 |
nicklas |
if (frm.methylationItems[mNo].selected) |
6869 |
15 Nov 22 |
nicklas |
183 |
{ |
6869 |
15 Nov 22 |
nicklas |
numSelected++; |
6869 |
15 Nov 22 |
nicklas |
var m = frm.methylationItems[mNo].methylationItem; |
6869 |
15 Nov 22 |
nicklas |
if (m.DO_NOT_USE) numDoNotUse++; |
6869 |
15 Nov 22 |
nicklas |
if (m.pipeline && m.pipeline != 'DNA/Methylation') |
6869 |
15 Nov 22 |
nicklas |
188 |
{ |
6869 |
15 Nov 22 |
nicklas |
invalidPipeline = Strings.encodeTags(m.name+' ('+m.pipeline)+') is not intended for the DNA/Methylation pipeline.'; |
6869 |
15 Nov 22 |
nicklas |
190 |
} |
6869 |
15 Nov 22 |
nicklas |
191 |
} |
6869 |
15 Nov 22 |
nicklas |
192 |
} |
6869 |
15 Nov 22 |
nicklas |
193 |
|
6869 |
15 Nov 22 |
nicklas |
if (numSelected == 0) |
6869 |
15 Nov 22 |
nicklas |
195 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems', 'invalid', 'Select at least one item'); |
6869 |
15 Nov 22 |
nicklas |
return; |
6869 |
15 Nov 22 |
nicklas |
198 |
} |
6869 |
15 Nov 22 |
nicklas |
if (invalidPipeline) |
6869 |
15 Nov 22 |
nicklas |
200 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems', 'invalid', invalidPipeline); |
6869 |
15 Nov 22 |
nicklas |
return; |
6869 |
15 Nov 22 |
nicklas |
203 |
} |
6869 |
15 Nov 22 |
nicklas |
selectionIsValid = true; |
6869 |
15 Nov 22 |
nicklas |
205 |
|
6869 |
15 Nov 22 |
nicklas |
if (numDoNotUse > 0) |
6869 |
15 Nov 22 |
nicklas |
207 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
6869 |
15 Nov 22 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
6869 |
15 Nov 22 |
nicklas |
210 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
212 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('methylationItems', 'valid'); |
6869 |
15 Nov 22 |
nicklas |
214 |
} |
6869 |
15 Nov 22 |
nicklas |
215 |
} |
6869 |
15 Nov 22 |
nicklas |
216 |
|
6869 |
15 Nov 22 |
nicklas |
// --- Step 2 ----------------------------------- |
6869 |
15 Nov 22 |
nicklas |
meth.initializeStep2 = function() |
6869 |
15 Nov 22 |
nicklas |
219 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setCurrentStep(2); |
6869 |
15 Nov 22 |
nicklas |
221 |
|
6869 |
15 Nov 22 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
6869 |
15 Nov 22 |
nicklas |
225 |
|
6869 |
15 Nov 22 |
nicklas |
Reggie.loadSoftware('METHYLATION_SOFTWARE', 'betaSoftware', 'PARAMETER_SET'); |
6869 |
15 Nov 22 |
nicklas |
227 |
|
6869 |
15 Nov 22 |
nicklas |
// Load clusters |
6869 |
15 Nov 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=methylation-beta'; |
6869 |
15 Nov 22 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
6869 |
15 Nov 22 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
6869 |
15 Nov 22 |
nicklas |
Wizard.asyncJsonRequest(url, meth.clustersLoaded); |
6869 |
15 Nov 22 |
nicklas |
233 |
|
6869 |
15 Nov 22 |
nicklas |
Doc.show('goregister'); |
6869 |
15 Nov 22 |
nicklas |
Doc.show('gocancel'); |
6869 |
15 Nov 22 |
nicklas |
236 |
} |
6869 |
15 Nov 22 |
nicklas |
237 |
|
6869 |
15 Nov 22 |
nicklas |
meth.validateStep2 = function(event) |
6869 |
15 Nov 22 |
nicklas |
239 |
{ |
6869 |
15 Nov 22 |
nicklas |
if (!clusterIsValid) event.preventDefault(); |
6869 |
15 Nov 22 |
nicklas |
241 |
} |
6869 |
15 Nov 22 |
nicklas |
242 |
|
6869 |
15 Nov 22 |
nicklas |
meth.clustersLoaded = function(response) |
6869 |
15 Nov 22 |
nicklas |
244 |
{ |
6869 |
15 Nov 22 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
var clusters = response.hosts; |
6869 |
15 Nov 22 |
nicklas |
frm.clusters.length = 0; |
6869 |
15 Nov 22 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
6869 |
15 Nov 22 |
nicklas |
250 |
{ |
6869 |
15 Nov 22 |
nicklas |
var cl = clusters[i]; |
6869 |
15 Nov 22 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
6869 |
15 Nov 22 |
nicklas |
option.cluster = cl; |
6869 |
15 Nov 22 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
6869 |
15 Nov 22 |
nicklas |
clusterIsValid = true; |
6869 |
15 Nov 22 |
nicklas |
257 |
} |
6869 |
15 Nov 22 |
nicklas |
if (frm.clusters.length == 0) |
6869 |
15 Nov 22 |
nicklas |
259 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
6869 |
15 Nov 22 |
nicklas |
clusterIsValid = false; |
6869 |
15 Nov 22 |
nicklas |
262 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
264 |
{ |
6869 |
15 Nov 22 |
nicklas |
meth.clusterOnChange(); |
6869 |
15 Nov 22 |
nicklas |
266 |
} |
6869 |
15 Nov 22 |
nicklas |
267 |
} |
6869 |
15 Nov 22 |
nicklas |
268 |
|
6869 |
15 Nov 22 |
nicklas |
meth.softwareOnChange = function(event) |
6869 |
15 Nov 22 |
nicklas |
270 |
{ |
6869 |
15 Nov 22 |
nicklas |
var target = event.currentTarget; |
6869 |
15 Nov 22 |
nicklas |
var item = target[target.selectedIndex].item; |
6869 |
15 Nov 22 |
nicklas |
if (!item) item = {}; |
6869 |
15 Nov 22 |
nicklas |
274 |
|
6869 |
15 Nov 22 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
6869 |
15 Nov 22 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
6869 |
15 Nov 22 |
nicklas |
278 |
|
6869 |
15 Nov 22 |
nicklas |
if (item.ParameterSet) |
6869 |
15 Nov 22 |
nicklas |
280 |
{ |
6869 |
15 Nov 22 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
6869 |
15 Nov 22 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
6869 |
15 Nov 22 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
6869 |
15 Nov 22 |
nicklas |
url += '&targetId='+target.id; |
6869 |
15 Nov 22 |
nicklas |
Wizard.asyncJsonRequest(url, meth.parameterSetInfoLoaded); |
6869 |
15 Nov 22 |
nicklas |
286 |
} |
6869 |
15 Nov 22 |
nicklas |
287 |
} |
6869 |
15 Nov 22 |
nicklas |
288 |
|
6869 |
15 Nov 22 |
nicklas |
meth.parameterSetInfoLoaded = function(response) |
6869 |
15 Nov 22 |
nicklas |
290 |
{ |
6869 |
15 Nov 22 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
6869 |
15 Nov 22 |
nicklas |
292 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
6869 |
15 Nov 22 |
nicklas |
294 |
} |
6869 |
15 Nov 22 |
nicklas |
295 |
} |
6869 |
15 Nov 22 |
nicklas |
296 |
|
6869 |
15 Nov 22 |
nicklas |
meth.clusterOnChange = function() |
6869 |
15 Nov 22 |
nicklas |
298 |
{ |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
6869 |
15 Nov 22 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
6869 |
15 Nov 22 |
nicklas |
302 |
{ |
6869 |
15 Nov 22 |
nicklas |
frm.priority.length = 0; |
6869 |
15 Nov 22 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
6869 |
15 Nov 22 |
nicklas |
305 |
{ |
6869 |
15 Nov 22 |
nicklas |
var p = cluster.priorities[pNo]; |
6869 |
15 Nov 22 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
6869 |
15 Nov 22 |
nicklas |
308 |
} |
6869 |
15 Nov 22 |
nicklas |
Doc.show('job-priority'); |
6869 |
15 Nov 22 |
nicklas |
310 |
} |
6869 |
15 Nov 22 |
nicklas |
else |
6869 |
15 Nov 22 |
nicklas |
312 |
{ |
6869 |
15 Nov 22 |
nicklas |
Doc.hide('job-priority'); |
6869 |
15 Nov 22 |
nicklas |
314 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
316 |
{ |
6980 |
17 Jan 23 |
nicklas |
frm.partition.length = 0; |
6980 |
17 Jan 23 |
nicklas |
for (var pNo = 0; pNo < cluster.partitions.length; pNo++) |
6980 |
17 Jan 23 |
nicklas |
319 |
{ |
6980 |
17 Jan 23 |
nicklas |
var p = cluster.partitions[pNo]; |
6980 |
17 Jan 23 |
nicklas |
var title = p.name; |
6980 |
17 Jan 23 |
nicklas |
if (p.description) title += ' ('+p.description+')'; |
6980 |
17 Jan 23 |
nicklas |
frm.partition[frm.partition.length] = new Option(title, p.value, p['default'], p['default']); |
6980 |
17 Jan 23 |
nicklas |
324 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
326 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
328 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
330 |
} |
6869 |
15 Nov 22 |
nicklas |
331 |
} |
6869 |
15 Nov 22 |
nicklas |
332 |
|
6869 |
15 Nov 22 |
nicklas |
meth.submit = function() |
6869 |
15 Nov 22 |
nicklas |
334 |
{ |
6869 |
15 Nov 22 |
nicklas |
var frm = document.forms['reggie']; |
6869 |
15 Nov 22 |
nicklas |
336 |
|
6869 |
15 Nov 22 |
nicklas |
var submitInfo = {}; |
6869 |
15 Nov 22 |
nicklas |
submitInfo.betaSoftware = parseInt(frm.betaSoftware.value); |
6869 |
15 Nov 22 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
6869 |
15 Nov 22 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
6869 |
15 Nov 22 |
nicklas |
341 |
{ |
6869 |
15 Nov 22 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
6869 |
15 Nov 22 |
nicklas |
343 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
345 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
347 |
} |
6869 |
15 Nov 22 |
nicklas |
submitInfo.debug = frm.debug.checked; |
6869 |
15 Nov 22 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
6869 |
15 Nov 22 |
nicklas |
350 |
|
6869 |
15 Nov 22 |
nicklas |
var methylationItems = []; |
6869 |
15 Nov 22 |
nicklas |
submitInfo.methylationItems = methylationItems; |
6869 |
15 Nov 22 |
nicklas |
353 |
|
6869 |
15 Nov 22 |
nicklas |
for (var mNo = 0; mNo < frm.methylationItems.length; mNo++) |
6869 |
15 Nov 22 |
nicklas |
355 |
{ |
6869 |
15 Nov 22 |
nicklas |
if (frm.methylationItems[mNo].selected) |
6869 |
15 Nov 22 |
nicklas |
357 |
{ |
6869 |
15 Nov 22 |
nicklas |
var m = {}; |
6869 |
15 Nov 22 |
nicklas |
m.id = frm.methylationItems[mNo].methylationItem.id; |
6869 |
15 Nov 22 |
nicklas |
methylationItems[methylationItems.length] = m; |
6869 |
15 Nov 22 |
nicklas |
361 |
} |
6869 |
15 Nov 22 |
nicklas |
362 |
} |
6869 |
15 Nov 22 |
nicklas |
363 |
|
6869 |
15 Nov 22 |
nicklas |
var url = '../Methylation.servlet?ID='+App.getSessionId(); |
6869 |
15 Nov 22 |
nicklas |
url += '&cmd=StartBetaAnalysis'; |
6869 |
15 Nov 22 |
nicklas |
366 |
|
6869 |
15 Nov 22 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
6869 |
15 Nov 22 |
nicklas |
Wizard.asyncJsonRequest(url, meth.submissionResults, 'POST', JSON.stringify(submitInfo)); |
6869 |
15 Nov 22 |
nicklas |
369 |
} |
6869 |
15 Nov 22 |
nicklas |
370 |
|
6869 |
15 Nov 22 |
nicklas |
meth.submissionResults = function(response) |
6869 |
15 Nov 22 |
nicklas |
372 |
{ |
6869 |
15 Nov 22 |
nicklas |
Wizard.showFinalMessage(response.messages); |
6869 |
15 Nov 22 |
nicklas |
Doc.show('gorestart'); |
6869 |
15 Nov 22 |
nicklas |
375 |
} |
6869 |
15 Nov 22 |
nicklas |
376 |
|
6869 |
15 Nov 22 |
nicklas |
return meth; |
6869 |
15 Nov 22 |
nicklas |
378 |
}(); |
6869 |
15 Nov 22 |
nicklas |
379 |
|
6869 |
15 Nov 22 |
nicklas |
Doc.onLoad(Methylation.initPage); |
6869 |
15 Nov 22 |
nicklas |
381 |
|