5844 |
26 Feb 20 |
nicklas |
var Align = function() |
5844 |
26 Feb 20 |
nicklas |
2 |
{ |
5844 |
26 Feb 20 |
nicklas |
var align = {}; |
5844 |
26 Feb 20 |
nicklas |
var debug = 0; |
5844 |
26 Feb 20 |
nicklas |
var selectionIsValid = false; |
5844 |
26 Feb 20 |
nicklas |
var subtypeMergedSequences = null; |
5844 |
26 Feb 20 |
nicklas |
var annotationTypePipeline = null; |
5844 |
26 Feb 20 |
nicklas |
var clusterIsValid = false; |
5844 |
26 Feb 20 |
nicklas |
var manuallySelected = []; |
5844 |
26 Feb 20 |
nicklas |
10 |
|
5844 |
26 Feb 20 |
nicklas |
// Page initialization |
5844 |
26 Feb 20 |
nicklas |
align.initPage = function() |
5844 |
26 Feb 20 |
nicklas |
13 |
{ |
5844 |
26 Feb 20 |
nicklas |
14 |
|
5844 |
26 Feb 20 |
nicklas |
// Step 1 |
5844 |
26 Feb 20 |
nicklas |
Buttons.addClickHandler('btnSelectMergedSequences', align.selectMergedSequences); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('mergedSequences', 'base-selected', align.setMergedSequenceCallback); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('mergedSequences', 'change', align.mergedSequencesOnChange); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', align.validateStep1); |
5844 |
26 Feb 20 |
nicklas |
20 |
|
5844 |
26 Feb 20 |
nicklas |
// Step 2 |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', align.initializeStep2); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', align.validateStep2); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('clusters', 'change', align.clusterOnChange); |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('alignSoftware', 'change', align.softwareOnChange); |
5844 |
26 Feb 20 |
nicklas |
26 |
|
5844 |
26 Feb 20 |
nicklas |
// Navigation |
5844 |
26 Feb 20 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
5844 |
26 Feb 20 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
5844 |
26 Feb 20 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
5844 |
26 Feb 20 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
5844 |
26 Feb 20 |
nicklas |
32 |
|
5844 |
26 Feb 20 |
nicklas |
// Final registration |
5844 |
26 Feb 20 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', align.submit); |
5844 |
26 Feb 20 |
nicklas |
35 |
|
5844 |
26 Feb 20 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
5844 |
26 Feb 20 |
nicklas |
var url = '../Mips.servlet?ID='+App.getSessionId(); |
5844 |
26 Feb 20 |
nicklas |
url += '&cmd=GetMergedSequencesForAlignment'; |
5844 |
26 Feb 20 |
nicklas |
Wizard.asyncJsonRequest(url, align.initializeStep1); |
5844 |
26 Feb 20 |
nicklas |
40 |
} |
5844 |
26 Feb 20 |
nicklas |
41 |
|
5844 |
26 Feb 20 |
nicklas |
// --- Step 1 ----------------------------------- |
5844 |
26 Feb 20 |
nicklas |
align.initializeStep1 = function(response) |
5844 |
26 Feb 20 |
nicklas |
44 |
{ |
5844 |
26 Feb 20 |
nicklas |
var mergedSequences = response.mergedSequences; |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
47 |
|
5844 |
26 Feb 20 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
5844 |
26 Feb 20 |
nicklas |
49 |
{ |
5844 |
26 Feb 20 |
nicklas |
var firstPlate = null; |
5844 |
26 Feb 20 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
5844 |
26 Feb 20 |
nicklas |
52 |
{ |
5844 |
26 Feb 20 |
nicklas |
var ms = mergedSequences[msNo]; |
5844 |
26 Feb 20 |
nicklas |
var libPlate = ms.lib.bioWell ? ms.lib.bioWell.bioPlate : null; |
5844 |
26 Feb 20 |
nicklas |
if (firstPlate == null && libPlate != null) firstPlate = libPlate.name; |
5844 |
26 Feb 20 |
nicklas |
var option = align.createListOption(msNo+1, ms, ms.DO_NOT_USE == null && libPlate != null && libPlate.name==firstPlate) |
5844 |
26 Feb 20 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
5844 |
26 Feb 20 |
nicklas |
58 |
} |
5844 |
26 Feb 20 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
5844 |
26 Feb 20 |
nicklas |
60 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
62 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', 'No new sequences available for processing'); |
5844 |
26 Feb 20 |
nicklas |
64 |
} |
5844 |
26 Feb 20 |
nicklas |
65 |
|
5844 |
26 Feb 20 |
nicklas |
Doc.show('step-1'); |
5844 |
26 Feb 20 |
nicklas |
Doc.show('gonext'); |
5844 |
26 Feb 20 |
nicklas |
68 |
|
5844 |
26 Feb 20 |
nicklas |
frm.mergedSequences.focus(); |
5844 |
26 Feb 20 |
nicklas |
70 |
} |
5844 |
26 Feb 20 |
nicklas |
71 |
|
5844 |
26 Feb 20 |
nicklas |
align.validateStep1 = function(event) |
5844 |
26 Feb 20 |
nicklas |
73 |
{ |
5844 |
26 Feb 20 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
5844 |
26 Feb 20 |
nicklas |
75 |
} |
5844 |
26 Feb 20 |
nicklas |
76 |
|
5844 |
26 Feb 20 |
nicklas |
align.selectMergedSequences = function() |
5844 |
26 Feb 20 |
nicklas |
78 |
{ |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
if (frm.mergedSequences.disabled) return; |
5844 |
26 Feb 20 |
nicklas |
81 |
|
5844 |
26 Feb 20 |
nicklas |
if (subtypeMergedSequences == null) |
5844 |
26 Feb 20 |
nicklas |
83 |
{ |
5844 |
26 Feb 20 |
nicklas |
subtypeMergedSequences = Reggie.getSubtypeInfo('MERGED_SEQUENCES'); |
5844 |
26 Feb 20 |
nicklas |
85 |
} |
5844 |
26 Feb 20 |
nicklas |
if (annotationTypePipeline == null) |
5844 |
26 Feb 20 |
nicklas |
87 |
{ |
5844 |
26 Feb 20 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5844 |
26 Feb 20 |
nicklas |
89 |
} |
5844 |
26 Feb 20 |
nicklas |
90 |
|
5844 |
26 Feb 20 |
nicklas |
// Reset list |
5844 |
26 Feb 20 |
nicklas |
manuallySelected = []; |
5844 |
26 Feb 20 |
nicklas |
var url = '&resetTemporary=1'; |
5844 |
26 Feb 20 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeMergedSequences.id; |
5844 |
26 Feb 20 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'=MIPs'; |
5844 |
26 Feb 20 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'mergedSequences', 1, url); |
5844 |
26 Feb 20 |
nicklas |
97 |
} |
5844 |
26 Feb 20 |
nicklas |
98 |
|
5844 |
26 Feb 20 |
nicklas |
align.setMergedSequenceCallback = function(event) |
5844 |
26 Feb 20 |
nicklas |
100 |
{ |
5844 |
26 Feb 20 |
nicklas |
var ms = event.detail; |
5844 |
26 Feb 20 |
nicklas |
102 |
|
5844 |
26 Feb 20 |
nicklas |
var opt = Reggie.getListOption('mergedSequences', ms.id); |
5844 |
26 Feb 20 |
nicklas |
if (opt) |
5844 |
26 Feb 20 |
nicklas |
105 |
{ |
5844 |
26 Feb 20 |
nicklas |
opt.selected = true; |
5844 |
26 Feb 20 |
nicklas |
107 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
109 |
{ |
5844 |
26 Feb 20 |
nicklas |
manuallySelected[manuallySelected.length] = ms.id; |
5844 |
26 Feb 20 |
nicklas |
111 |
} |
5844 |
26 Feb 20 |
nicklas |
112 |
|
5844 |
26 Feb 20 |
nicklas |
if (ms.remaining == 0 && manuallySelected.length > 0) |
5844 |
26 Feb 20 |
nicklas |
114 |
{ |
5844 |
26 Feb 20 |
nicklas |
var url = '../Mips.servlet?ID='+App.getSessionId(); |
5844 |
26 Feb 20 |
nicklas |
url += '&cmd=GetMergedSequencesForAlignment'; |
5844 |
26 Feb 20 |
nicklas |
url += '&items='+manuallySelected.join(','); |
5844 |
26 Feb 20 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
5844 |
26 Feb 20 |
nicklas |
Wizard.asyncJsonRequest(url, align.manuallySelected); |
5844 |
26 Feb 20 |
nicklas |
120 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
122 |
{ |
5844 |
26 Feb 20 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
5844 |
26 Feb 20 |
nicklas |
124 |
} |
5844 |
26 Feb 20 |
nicklas |
125 |
} |
5844 |
26 Feb 20 |
nicklas |
126 |
|
5844 |
26 Feb 20 |
nicklas |
align.manuallySelected = function(response) |
5844 |
26 Feb 20 |
nicklas |
128 |
{ |
5844 |
26 Feb 20 |
nicklas |
var mergedSequences = response.mergedSequences; |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
131 |
|
5844 |
26 Feb 20 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
5844 |
26 Feb 20 |
nicklas |
133 |
{ |
5844 |
26 Feb 20 |
nicklas |
var offset = frm.mergedSequences.length+1; |
5844 |
26 Feb 20 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
5844 |
26 Feb 20 |
nicklas |
136 |
{ |
5844 |
26 Feb 20 |
nicklas |
var ms = mergedSequences[msNo]; |
5844 |
26 Feb 20 |
nicklas |
var option = align.createListOption(msNo+offset, ms, ms.DO_NOT_USE == null); |
5844 |
26 Feb 20 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
5844 |
26 Feb 20 |
nicklas |
140 |
} |
5844 |
26 Feb 20 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
5844 |
26 Feb 20 |
nicklas |
142 |
} |
5844 |
26 Feb 20 |
nicklas |
143 |
} |
5844 |
26 Feb 20 |
nicklas |
144 |
|
5844 |
26 Feb 20 |
nicklas |
align.createListOption = function(index, mergedItem, selected) |
5844 |
26 Feb 20 |
nicklas |
146 |
{ |
5844 |
26 Feb 20 |
nicklas |
var lib = mergedItem.lib; |
5844 |
26 Feb 20 |
nicklas |
var isYellow = lib.specimen && lib.specimen.YellowLabel != null; |
5844 |
26 Feb 20 |
nicklas |
var libPlate = lib.bioWell ? lib.bioWell.bioPlate : null; |
5844 |
26 Feb 20 |
nicklas |
150 |
|
5844 |
26 Feb 20 |
nicklas |
var tooltip = null; |
5844 |
26 Feb 20 |
nicklas |
var name = (index) + ': '; |
5844 |
26 Feb 20 |
nicklas |
if (libPlate) name += libPlate.name + ' - '; |
5844 |
26 Feb 20 |
nicklas |
name += mergedItem.name; |
5844 |
26 Feb 20 |
nicklas |
155 |
|
5844 |
26 Feb 20 |
nicklas |
if (mergedItem.DO_NOT_USE) |
5844 |
26 Feb 20 |
nicklas |
157 |
{ |
5844 |
26 Feb 20 |
nicklas |
name += ' [DoNotUse]'; |
5844 |
26 Feb 20 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(mergedItem.DO_NOT_USE+': '+mergedItem.DO_NOT_USE_COMMENT); |
5844 |
26 Feb 20 |
nicklas |
160 |
} |
5844 |
26 Feb 20 |
nicklas |
else if (mergedItem.AutoProcess == 'ReProcess') |
5844 |
26 Feb 20 |
nicklas |
162 |
{ |
5844 |
26 Feb 20 |
nicklas |
name += ' [R]'; |
5844 |
26 Feb 20 |
nicklas |
164 |
} |
5844 |
26 Feb 20 |
nicklas |
165 |
|
5844 |
26 Feb 20 |
nicklas |
var option = new Option(name, mergedItem.id, false, selected); |
5844 |
26 Feb 20 |
nicklas |
if (isYellow) option.className = 'yellow'; |
5844 |
26 Feb 20 |
nicklas |
if (tooltip) option.title = tooltip; |
5844 |
26 Feb 20 |
nicklas |
option.mergedSequences = mergedItem; |
5844 |
26 Feb 20 |
nicklas |
return option; |
5844 |
26 Feb 20 |
nicklas |
171 |
} |
5844 |
26 Feb 20 |
nicklas |
172 |
|
5844 |
26 Feb 20 |
nicklas |
align.mergedSequencesOnChange = function() |
5844 |
26 Feb 20 |
nicklas |
174 |
{ |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
selectionIsValid = false; |
5844 |
26 Feb 20 |
nicklas |
var numSelected = 0; |
5844 |
26 Feb 20 |
nicklas |
var numDoNotUse = 0; |
5844 |
26 Feb 20 |
nicklas |
var invalidPipeline = null; |
5844 |
26 Feb 20 |
nicklas |
180 |
|
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences'); |
5844 |
26 Feb 20 |
nicklas |
Wizard.hideGoNextConfirmation(); |
5844 |
26 Feb 20 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
5844 |
26 Feb 20 |
nicklas |
184 |
{ |
5844 |
26 Feb 20 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
5844 |
26 Feb 20 |
nicklas |
186 |
{ |
5844 |
26 Feb 20 |
nicklas |
numSelected++; |
5844 |
26 Feb 20 |
nicklas |
var ms = frm.mergedSequences[msNo].mergedSequences; |
5844 |
26 Feb 20 |
nicklas |
if (ms.DO_NOT_USE) numDoNotUse++; |
5844 |
26 Feb 20 |
nicklas |
if (ms.pipeline && ms.pipeline != 'MIPs') |
5844 |
26 Feb 20 |
nicklas |
191 |
{ |
5844 |
26 Feb 20 |
nicklas |
invalidPipeline = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the MIPs pipeline.'; |
5844 |
26 Feb 20 |
nicklas |
193 |
} |
5844 |
26 Feb 20 |
nicklas |
194 |
} |
5844 |
26 Feb 20 |
nicklas |
195 |
} |
5844 |
26 Feb 20 |
nicklas |
196 |
|
5844 |
26 Feb 20 |
nicklas |
if (numSelected == 0) |
5844 |
26 Feb 20 |
nicklas |
198 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', 'Select at least one item'); |
5844 |
26 Feb 20 |
nicklas |
return; |
5844 |
26 Feb 20 |
nicklas |
201 |
} |
5844 |
26 Feb 20 |
nicklas |
if (invalidPipeline) |
5844 |
26 Feb 20 |
nicklas |
203 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', invalidPipeline); |
5844 |
26 Feb 20 |
nicklas |
return; |
5844 |
26 Feb 20 |
nicklas |
206 |
} |
5844 |
26 Feb 20 |
nicklas |
selectionIsValid = true; |
5844 |
26 Feb 20 |
nicklas |
208 |
|
5844 |
26 Feb 20 |
nicklas |
if (numDoNotUse > 0) |
5844 |
26 Feb 20 |
nicklas |
210 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
5844 |
26 Feb 20 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
5844 |
26 Feb 20 |
nicklas |
213 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
215 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'valid'); |
5844 |
26 Feb 20 |
nicklas |
217 |
} |
5844 |
26 Feb 20 |
nicklas |
218 |
} |
5844 |
26 Feb 20 |
nicklas |
219 |
|
5844 |
26 Feb 20 |
nicklas |
// --- Step 2 ----------------------------------- |
5844 |
26 Feb 20 |
nicklas |
align.initializeStep2 = function() |
5844 |
26 Feb 20 |
nicklas |
222 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setCurrentStep(2); |
5844 |
26 Feb 20 |
nicklas |
224 |
|
5844 |
26 Feb 20 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
5844 |
26 Feb 20 |
nicklas |
228 |
|
5844 |
26 Feb 20 |
nicklas |
Reggie.loadProtocols('ALIGNMENT_PROTOCOL', 'alignProtocol', 'ALIGNMENT_TYPE', 'MIPs'); |
5844 |
26 Feb 20 |
nicklas |
Reggie.loadSoftware('ALIGNMENT_SOFTWARE', 'alignSoftware', 'ALIGNMENT_TYPE,PARAMETER_SET', 'MIPs'); |
5844 |
26 Feb 20 |
nicklas |
231 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
6633 |
08 Mar 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=align-mips'; |
5844 |
26 Feb 20 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
5844 |
26 Feb 20 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
5844 |
26 Feb 20 |
nicklas |
Wizard.asyncJsonRequest(url, align.clustersLoaded); |
5844 |
26 Feb 20 |
nicklas |
237 |
|
5844 |
26 Feb 20 |
nicklas |
Doc.show('goregister'); |
5844 |
26 Feb 20 |
nicklas |
Doc.show('gocancel'); |
5844 |
26 Feb 20 |
nicklas |
240 |
} |
5844 |
26 Feb 20 |
nicklas |
241 |
|
6824 |
30 Aug 22 |
nicklas |
align.validateStep2 = function(event) |
5844 |
26 Feb 20 |
nicklas |
243 |
{ |
5844 |
26 Feb 20 |
nicklas |
if (!clusterIsValid) event.preventDefault(); |
5844 |
26 Feb 20 |
nicklas |
245 |
} |
5844 |
26 Feb 20 |
nicklas |
246 |
|
5844 |
26 Feb 20 |
nicklas |
align.clustersLoaded = function(response) |
5844 |
26 Feb 20 |
nicklas |
248 |
{ |
5844 |
26 Feb 20 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
var clusters = response.hosts; |
5844 |
26 Feb 20 |
nicklas |
frm.clusters.length = 0; |
5844 |
26 Feb 20 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
5844 |
26 Feb 20 |
nicklas |
254 |
{ |
5844 |
26 Feb 20 |
nicklas |
var cl = clusters[i]; |
5844 |
26 Feb 20 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
5844 |
26 Feb 20 |
nicklas |
option.cluster = cl; |
5844 |
26 Feb 20 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
5844 |
26 Feb 20 |
nicklas |
clusterIsValid = true; |
5844 |
26 Feb 20 |
nicklas |
261 |
} |
5844 |
26 Feb 20 |
nicklas |
if (frm.clusters.length == 0) |
5844 |
26 Feb 20 |
nicklas |
263 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
5844 |
26 Feb 20 |
nicklas |
clusterIsValid = false; |
5844 |
26 Feb 20 |
nicklas |
266 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
268 |
{ |
5844 |
26 Feb 20 |
nicklas |
align.clusterOnChange(); |
5844 |
26 Feb 20 |
nicklas |
270 |
} |
5844 |
26 Feb 20 |
nicklas |
271 |
} |
5844 |
26 Feb 20 |
nicklas |
272 |
|
5844 |
26 Feb 20 |
nicklas |
align.softwareOnChange = function(event) |
5844 |
26 Feb 20 |
nicklas |
274 |
{ |
5844 |
26 Feb 20 |
nicklas |
var target = event.currentTarget; |
5844 |
26 Feb 20 |
nicklas |
var item = target[target.selectedIndex].item; |
5844 |
26 Feb 20 |
nicklas |
if (!item) item = {}; |
5844 |
26 Feb 20 |
nicklas |
278 |
|
5844 |
26 Feb 20 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
5844 |
26 Feb 20 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
5844 |
26 Feb 20 |
nicklas |
282 |
|
5844 |
26 Feb 20 |
nicklas |
if (item.ParameterSet) |
5844 |
26 Feb 20 |
nicklas |
284 |
{ |
5844 |
26 Feb 20 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
5844 |
26 Feb 20 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
5844 |
26 Feb 20 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
5844 |
26 Feb 20 |
nicklas |
url += '&targetId='+target.id; |
5844 |
26 Feb 20 |
nicklas |
Wizard.asyncJsonRequest(url, align.parameterSetInfoLoaded); |
5844 |
26 Feb 20 |
nicklas |
290 |
} |
5844 |
26 Feb 20 |
nicklas |
291 |
} |
5844 |
26 Feb 20 |
nicklas |
292 |
|
5844 |
26 Feb 20 |
nicklas |
align.parameterSetInfoLoaded = function(response) |
5844 |
26 Feb 20 |
nicklas |
294 |
{ |
5844 |
26 Feb 20 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
5844 |
26 Feb 20 |
nicklas |
296 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
5844 |
26 Feb 20 |
nicklas |
298 |
} |
5844 |
26 Feb 20 |
nicklas |
299 |
} |
5844 |
26 Feb 20 |
nicklas |
300 |
|
5844 |
26 Feb 20 |
nicklas |
align.clusterOnChange = function() |
5844 |
26 Feb 20 |
nicklas |
302 |
{ |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
5844 |
26 Feb 20 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
5844 |
26 Feb 20 |
nicklas |
306 |
{ |
5844 |
26 Feb 20 |
nicklas |
frm.priority.length = 0; |
5844 |
26 Feb 20 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
5844 |
26 Feb 20 |
nicklas |
309 |
{ |
5844 |
26 Feb 20 |
nicklas |
var p = cluster.priorities[pNo]; |
5844 |
26 Feb 20 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
5844 |
26 Feb 20 |
nicklas |
312 |
} |
5844 |
26 Feb 20 |
nicklas |
Doc.show('job-priority'); |
5844 |
26 Feb 20 |
nicklas |
314 |
} |
5844 |
26 Feb 20 |
nicklas |
else |
5844 |
26 Feb 20 |
nicklas |
316 |
{ |
5844 |
26 Feb 20 |
nicklas |
Doc.hide('job-priority'); |
5844 |
26 Feb 20 |
nicklas |
318 |
} |
5844 |
26 Feb 20 |
nicklas |
319 |
} |
5844 |
26 Feb 20 |
nicklas |
320 |
|
5844 |
26 Feb 20 |
nicklas |
321 |
|
5844 |
26 Feb 20 |
nicklas |
322 |
|
5844 |
26 Feb 20 |
nicklas |
align.submit = function() |
5844 |
26 Feb 20 |
nicklas |
324 |
{ |
5844 |
26 Feb 20 |
nicklas |
var frm = document.forms['reggie']; |
5844 |
26 Feb 20 |
nicklas |
326 |
|
5844 |
26 Feb 20 |
nicklas |
var submitInfo = {}; |
5844 |
26 Feb 20 |
nicklas |
submitInfo.alignSoftware = parseInt(frm.alignSoftware.value); |
5844 |
26 Feb 20 |
nicklas |
submitInfo.alignProtocol = parseInt(frm.alignProtocol.value); |
5844 |
26 Feb 20 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
5844 |
26 Feb 20 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
5844 |
26 Feb 20 |
nicklas |
332 |
{ |
5844 |
26 Feb 20 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
5844 |
26 Feb 20 |
nicklas |
334 |
} |
5844 |
26 Feb 20 |
nicklas |
submitInfo.debug = frm.debug.checked; |
5844 |
26 Feb 20 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
5844 |
26 Feb 20 |
nicklas |
337 |
|
5844 |
26 Feb 20 |
nicklas |
var mergedSequences = []; |
5844 |
26 Feb 20 |
nicklas |
submitInfo.mergedSequences = mergedSequences; |
5844 |
26 Feb 20 |
nicklas |
340 |
|
5844 |
26 Feb 20 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
5844 |
26 Feb 20 |
nicklas |
342 |
{ |
5844 |
26 Feb 20 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
5844 |
26 Feb 20 |
nicklas |
344 |
{ |
5844 |
26 Feb 20 |
nicklas |
var ms = {}; |
5844 |
26 Feb 20 |
nicklas |
ms.id = frm.mergedSequences[msNo].mergedSequences.id; |
5844 |
26 Feb 20 |
nicklas |
mergedSequences[mergedSequences.length] = ms; |
5844 |
26 Feb 20 |
nicklas |
348 |
} |
5844 |
26 Feb 20 |
nicklas |
349 |
} |
5844 |
26 Feb 20 |
nicklas |
350 |
|
5844 |
26 Feb 20 |
nicklas |
var url = '../Mips.servlet?ID='+App.getSessionId(); |
5844 |
26 Feb 20 |
nicklas |
url += '&cmd=StartMipsAlignment'; |
5844 |
26 Feb 20 |
nicklas |
353 |
|
5844 |
26 Feb 20 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
5844 |
26 Feb 20 |
nicklas |
Wizard.asyncJsonRequest(url, align.submissionResults, 'POST', JSON.stringify(submitInfo)); |
5844 |
26 Feb 20 |
nicklas |
356 |
} |
5844 |
26 Feb 20 |
nicklas |
357 |
|
5844 |
26 Feb 20 |
nicklas |
align.submissionResults = function(response) |
5844 |
26 Feb 20 |
nicklas |
359 |
{ |
5844 |
26 Feb 20 |
nicklas |
Wizard.showFinalMessage(response.messages); |
5844 |
26 Feb 20 |
nicklas |
Doc.show('gorestart'); |
5844 |
26 Feb 20 |
nicklas |
362 |
} |
5844 |
26 Feb 20 |
nicklas |
363 |
|
5844 |
26 Feb 20 |
nicklas |
return align; |
5844 |
26 Feb 20 |
nicklas |
365 |
}(); |
5844 |
26 Feb 20 |
nicklas |
366 |
|
5844 |
26 Feb 20 |
nicklas |
Doc.onLoad(Align.initPage); |
5844 |
26 Feb 20 |
nicklas |
368 |
|