2599 |
25 Aug 14 |
nicklas |
var Align = function() |
2599 |
25 Aug 14 |
nicklas |
2 |
{ |
2599 |
25 Aug 14 |
nicklas |
var align = {}; |
2656 |
11 Sep 14 |
nicklas |
var debug = 0; |
5542 |
05 Aug 19 |
nicklas |
var selectionIsValid = false; |
2599 |
25 Aug 14 |
nicklas |
var subtypeMergedSequences = null; |
5542 |
05 Aug 19 |
nicklas |
var annotationTypePipeline = null; |
2599 |
25 Aug 14 |
nicklas |
var clusterIsValid = false; |
4542 |
26 Jun 17 |
nicklas |
var arrayDesignIsValid = false; |
4990 |
01 Oct 18 |
nicklas |
var manuallySelected = []; |
2599 |
25 Aug 14 |
nicklas |
11 |
|
2599 |
25 Aug 14 |
nicklas |
// Page initialization |
2599 |
25 Aug 14 |
nicklas |
align.initPage = function() |
2599 |
25 Aug 14 |
nicklas |
14 |
{ |
2599 |
25 Aug 14 |
nicklas |
15 |
|
2599 |
25 Aug 14 |
nicklas |
// Step 1 |
2599 |
25 Aug 14 |
nicklas |
Buttons.addClickHandler('btnSelectMergedSequences', align.selectMergedSequences); |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('mergedSequences', 'base-selected', align.setMergedSequenceCallback); |
4990 |
01 Oct 18 |
nicklas |
Events.addEventHandler('mergedSequences', 'change', align.mergedSequencesOnChange); |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', align.validateStep1); |
2599 |
25 Aug 14 |
nicklas |
21 |
|
2599 |
25 Aug 14 |
nicklas |
// Step 2 |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', align.initializeStep2); |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', align.validateStep2); |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('clusters', 'change', align.clusterOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('debug', 'change', align.debugOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('override', 'change', align.overrideOnChange); |
3115 |
06 Feb 15 |
nicklas |
Events.addEventHandler('maskingSoftware', 'change', align.softwareOnChange); |
3115 |
06 Feb 15 |
nicklas |
Events.addEventHandler('alignSoftware', 'change', align.softwareOnChange); |
4542 |
26 Jun 17 |
nicklas |
Events.addEventHandler('cufflinksSoftware', 'change', align.softwareOnChange); |
2599 |
25 Aug 14 |
nicklas |
31 |
|
2599 |
25 Aug 14 |
nicklas |
// Navigation |
2599 |
25 Aug 14 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2599 |
25 Aug 14 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2599 |
25 Aug 14 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2599 |
25 Aug 14 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2599 |
25 Aug 14 |
nicklas |
37 |
|
2599 |
25 Aug 14 |
nicklas |
// Final registration |
2599 |
25 Aug 14 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', align.submit); |
2599 |
25 Aug 14 |
nicklas |
40 |
|
2599 |
25 Aug 14 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
4547 |
29 Jun 17 |
nicklas |
var url = '../Cufflinks.servlet?ID='+App.getSessionId(); |
2599 |
25 Aug 14 |
nicklas |
url += '&cmd=GetMergedSequencesForAlignment'; |
2599 |
25 Aug 14 |
nicklas |
Wizard.asyncJsonRequest(url, align.initializeStep1); |
2599 |
25 Aug 14 |
nicklas |
45 |
} |
2599 |
25 Aug 14 |
nicklas |
46 |
|
2599 |
25 Aug 14 |
nicklas |
// --- Step 1 ----------------------------------- |
2599 |
25 Aug 14 |
nicklas |
align.initializeStep1 = function(response) |
2599 |
25 Aug 14 |
nicklas |
49 |
{ |
2599 |
25 Aug 14 |
nicklas |
var mergedSequences = response.mergedSequences; |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
2599 |
25 Aug 14 |
nicklas |
52 |
|
2599 |
25 Aug 14 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
2599 |
25 Aug 14 |
nicklas |
54 |
{ |
2599 |
25 Aug 14 |
nicklas |
var firstPlate = null; |
2599 |
25 Aug 14 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
2599 |
25 Aug 14 |
nicklas |
57 |
{ |
2599 |
25 Aug 14 |
nicklas |
var ms = mergedSequences[msNo]; |
4990 |
01 Oct 18 |
nicklas |
var libPlate = ms.lib.bioWell ? ms.lib.bioWell.bioPlate : null; |
2960 |
19 Nov 14 |
nicklas |
if (firstPlate == null && libPlate != null) firstPlate = libPlate.name; |
4990 |
01 Oct 18 |
nicklas |
var option = align.createListOption(msNo+1, ms, ms.DO_NOT_USE == null && libPlate != null && libPlate.name==firstPlate) |
2599 |
25 Aug 14 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
2599 |
25 Aug 14 |
nicklas |
63 |
} |
5542 |
05 Aug 19 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
2599 |
25 Aug 14 |
nicklas |
65 |
} |
2599 |
25 Aug 14 |
nicklas |
else |
2599 |
25 Aug 14 |
nicklas |
67 |
{ |
2599 |
25 Aug 14 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', 'No new sequences available for processing'); |
2599 |
25 Aug 14 |
nicklas |
69 |
} |
2599 |
25 Aug 14 |
nicklas |
70 |
|
2599 |
25 Aug 14 |
nicklas |
Doc.show('step-1'); |
2599 |
25 Aug 14 |
nicklas |
Doc.show('gonext'); |
2599 |
25 Aug 14 |
nicklas |
73 |
|
2599 |
25 Aug 14 |
nicklas |
frm.mergedSequences.focus(); |
2599 |
25 Aug 14 |
nicklas |
75 |
} |
2599 |
25 Aug 14 |
nicklas |
76 |
|
2599 |
25 Aug 14 |
nicklas |
align.validateStep1 = function(event) |
2599 |
25 Aug 14 |
nicklas |
78 |
{ |
5542 |
05 Aug 19 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
2599 |
25 Aug 14 |
nicklas |
80 |
} |
2599 |
25 Aug 14 |
nicklas |
81 |
|
2599 |
25 Aug 14 |
nicklas |
align.selectMergedSequences = function() |
2599 |
25 Aug 14 |
nicklas |
83 |
{ |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
2599 |
25 Aug 14 |
nicklas |
if (frm.mergedSequences.disabled) return; |
2599 |
25 Aug 14 |
nicklas |
86 |
|
2599 |
25 Aug 14 |
nicklas |
if (subtypeMergedSequences == null) |
2599 |
25 Aug 14 |
nicklas |
88 |
{ |
2599 |
25 Aug 14 |
nicklas |
subtypeMergedSequences = Reggie.getSubtypeInfo('MERGED_SEQUENCES'); |
2599 |
25 Aug 14 |
nicklas |
90 |
} |
5542 |
05 Aug 19 |
nicklas |
if (annotationTypePipeline == null) |
5542 |
05 Aug 19 |
nicklas |
92 |
{ |
5542 |
05 Aug 19 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5542 |
05 Aug 19 |
nicklas |
94 |
} |
2599 |
25 Aug 14 |
nicklas |
95 |
|
4990 |
01 Oct 18 |
nicklas |
// Reset list |
4990 |
01 Oct 18 |
nicklas |
manuallySelected = []; |
2599 |
25 Aug 14 |
nicklas |
var url = '&resetTemporary=1'; |
2599 |
25 Aug 14 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeMergedSequences.id; |
5542 |
05 Aug 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'=RNAseq'; |
2599 |
25 Aug 14 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'mergedSequences', 1, url); |
2599 |
25 Aug 14 |
nicklas |
102 |
} |
2599 |
25 Aug 14 |
nicklas |
103 |
|
2599 |
25 Aug 14 |
nicklas |
align.setMergedSequenceCallback = function(event) |
2599 |
25 Aug 14 |
nicklas |
105 |
{ |
2599 |
25 Aug 14 |
nicklas |
var ms = event.detail; |
4990 |
01 Oct 18 |
nicklas |
var opt = Reggie.getListOption('mergedSequences', ms.id); |
4990 |
01 Oct 18 |
nicklas |
if (opt) |
4990 |
01 Oct 18 |
nicklas |
109 |
{ |
4990 |
01 Oct 18 |
nicklas |
opt.selected = true; |
4990 |
01 Oct 18 |
nicklas |
111 |
} |
4990 |
01 Oct 18 |
nicklas |
else |
4990 |
01 Oct 18 |
nicklas |
113 |
{ |
4990 |
01 Oct 18 |
nicklas |
manuallySelected[manuallySelected.length] = ms.id; |
4990 |
01 Oct 18 |
nicklas |
115 |
} |
2599 |
25 Aug 14 |
nicklas |
116 |
|
4990 |
01 Oct 18 |
nicklas |
if (ms.remaining == 0 && manuallySelected.length > 0) |
2599 |
25 Aug 14 |
nicklas |
118 |
{ |
4990 |
01 Oct 18 |
nicklas |
var url = '../Cufflinks.servlet?ID='+App.getSessionId(); |
4990 |
01 Oct 18 |
nicklas |
url += '&cmd=GetMergedSequencesForAlignment'; |
4990 |
01 Oct 18 |
nicklas |
url += '&items='+manuallySelected.join(','); |
4990 |
01 Oct 18 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
4990 |
01 Oct 18 |
nicklas |
Wizard.asyncJsonRequest(url, align.manuallySelected); |
4990 |
01 Oct 18 |
nicklas |
124 |
} |
4990 |
01 Oct 18 |
nicklas |
else |
4990 |
01 Oct 18 |
nicklas |
126 |
{ |
4990 |
01 Oct 18 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
4990 |
01 Oct 18 |
nicklas |
128 |
} |
4990 |
01 Oct 18 |
nicklas |
129 |
} |
4990 |
01 Oct 18 |
nicklas |
130 |
|
4990 |
01 Oct 18 |
nicklas |
align.manuallySelected = function(response) |
4990 |
01 Oct 18 |
nicklas |
132 |
{ |
4990 |
01 Oct 18 |
nicklas |
var mergedSequences = response.mergedSequences; |
4990 |
01 Oct 18 |
nicklas |
var frm = document.forms['reggie']; |
4990 |
01 Oct 18 |
nicklas |
135 |
|
4990 |
01 Oct 18 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
4990 |
01 Oct 18 |
nicklas |
137 |
{ |
4990 |
01 Oct 18 |
nicklas |
var offset = frm.mergedSequences.length+1; |
4990 |
01 Oct 18 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
2599 |
25 Aug 14 |
nicklas |
140 |
{ |
4990 |
01 Oct 18 |
nicklas |
var ms = mergedSequences[msNo]; |
4990 |
01 Oct 18 |
nicklas |
var option = align.createListOption(msNo+offset, ms, ms.DO_NOT_USE == null); |
4990 |
01 Oct 18 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
2599 |
25 Aug 14 |
nicklas |
144 |
} |
4990 |
01 Oct 18 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
2599 |
25 Aug 14 |
nicklas |
146 |
} |
4990 |
01 Oct 18 |
nicklas |
147 |
} |
2599 |
25 Aug 14 |
nicklas |
148 |
|
4990 |
01 Oct 18 |
nicklas |
align.createListOption = function(index, mergedItem, selected) |
4990 |
01 Oct 18 |
nicklas |
150 |
{ |
4990 |
01 Oct 18 |
nicklas |
var lib = mergedItem.lib; |
4990 |
01 Oct 18 |
nicklas |
var isYellow = lib.specimen && lib.specimen.YellowLabel != null; |
4990 |
01 Oct 18 |
nicklas |
var libPlate = lib.bioWell ? lib.bioWell.bioPlate : null; |
4990 |
01 Oct 18 |
nicklas |
154 |
|
4990 |
01 Oct 18 |
nicklas |
var tooltip = null; |
4990 |
01 Oct 18 |
nicklas |
var name = (index) + ': '; |
4990 |
01 Oct 18 |
nicklas |
if (libPlate) name += libPlate.name + ' - '; |
4990 |
01 Oct 18 |
nicklas |
name += mergedItem.name; |
4990 |
01 Oct 18 |
nicklas |
159 |
|
4990 |
01 Oct 18 |
nicklas |
if (mergedItem.DO_NOT_USE) |
4990 |
01 Oct 18 |
nicklas |
161 |
{ |
4990 |
01 Oct 18 |
nicklas |
name += ' [DoNotUse]'; |
4990 |
01 Oct 18 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(mergedItem.DO_NOT_USE+': '+mergedItem.DO_NOT_USE_COMMENT); |
4990 |
01 Oct 18 |
nicklas |
164 |
} |
4990 |
01 Oct 18 |
nicklas |
else if (mergedItem.AutoProcess == 'ReProcess') |
4990 |
01 Oct 18 |
nicklas |
166 |
{ |
4990 |
01 Oct 18 |
nicklas |
name += ' [R]'; |
4990 |
01 Oct 18 |
nicklas |
168 |
} |
4990 |
01 Oct 18 |
nicklas |
169 |
|
4990 |
01 Oct 18 |
nicklas |
var option = new Option(name, mergedItem.id, false, selected); |
4990 |
01 Oct 18 |
nicklas |
if (isYellow) option.className = 'yellow'; |
4990 |
01 Oct 18 |
nicklas |
if (tooltip) option.title = tooltip; |
4990 |
01 Oct 18 |
nicklas |
option.mergedSequences = mergedItem; |
4990 |
01 Oct 18 |
nicklas |
return option; |
2599 |
25 Aug 14 |
nicklas |
175 |
} |
4990 |
01 Oct 18 |
nicklas |
176 |
|
4990 |
01 Oct 18 |
nicklas |
align.mergedSequencesOnChange = function() |
4990 |
01 Oct 18 |
nicklas |
178 |
{ |
4990 |
01 Oct 18 |
nicklas |
var frm = document.forms['reggie']; |
5542 |
05 Aug 19 |
nicklas |
selectionIsValid = false; |
5542 |
05 Aug 19 |
nicklas |
var numSelected = 0; |
5542 |
05 Aug 19 |
nicklas |
var numDoNotUse = 0; |
5542 |
05 Aug 19 |
nicklas |
var invalidPipeline = null; |
4990 |
01 Oct 18 |
nicklas |
184 |
|
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences'); |
5542 |
05 Aug 19 |
nicklas |
Wizard.hideGoNextConfirmation(); |
5542 |
05 Aug 19 |
nicklas |
187 |
|
4990 |
01 Oct 18 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
4990 |
01 Oct 18 |
nicklas |
189 |
{ |
4990 |
01 Oct 18 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
4990 |
01 Oct 18 |
nicklas |
191 |
{ |
5542 |
05 Aug 19 |
nicklas |
numSelected++; |
5542 |
05 Aug 19 |
nicklas |
193 |
|
4990 |
01 Oct 18 |
nicklas |
var ms = frm.mergedSequences[msNo].mergedSequences; |
4990 |
01 Oct 18 |
nicklas |
if (ms.DO_NOT_USE) numDoNotUse++; |
5542 |
05 Aug 19 |
nicklas |
196 |
|
5542 |
05 Aug 19 |
nicklas |
if (ms.pipeline && ms.pipeline != 'RNAseq') |
5542 |
05 Aug 19 |
nicklas |
198 |
{ |
5542 |
05 Aug 19 |
nicklas |
invalidPipeline = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the RNAseq pipeline.'; |
5542 |
05 Aug 19 |
nicklas |
200 |
} |
4990 |
01 Oct 18 |
nicklas |
201 |
} |
4990 |
01 Oct 18 |
nicklas |
202 |
} |
4990 |
01 Oct 18 |
nicklas |
203 |
|
5542 |
05 Aug 19 |
nicklas |
if (numSelected == 0) |
5542 |
05 Aug 19 |
nicklas |
205 |
{ |
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', 'Select at least one item'); |
5542 |
05 Aug 19 |
nicklas |
return; |
5542 |
05 Aug 19 |
nicklas |
208 |
} |
5542 |
05 Aug 19 |
nicklas |
if (invalidPipeline) |
5542 |
05 Aug 19 |
nicklas |
210 |
{ |
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', invalidPipeline); |
5542 |
05 Aug 19 |
nicklas |
return; |
5542 |
05 Aug 19 |
nicklas |
213 |
} |
5542 |
05 Aug 19 |
nicklas |
selectionIsValid = true; |
5542 |
05 Aug 19 |
nicklas |
215 |
|
4990 |
01 Oct 18 |
nicklas |
if (numDoNotUse > 0) |
4990 |
01 Oct 18 |
nicklas |
217 |
{ |
4990 |
01 Oct 18 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
4990 |
01 Oct 18 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
4990 |
01 Oct 18 |
nicklas |
220 |
} |
4990 |
01 Oct 18 |
nicklas |
else |
4990 |
01 Oct 18 |
nicklas |
222 |
{ |
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'valid'); |
4990 |
01 Oct 18 |
nicklas |
224 |
} |
4990 |
01 Oct 18 |
nicklas |
225 |
} |
2599 |
25 Aug 14 |
nicklas |
226 |
|
2599 |
25 Aug 14 |
nicklas |
227 |
|
2599 |
25 Aug 14 |
nicklas |
// --- Step 2 ----------------------------------- |
2599 |
25 Aug 14 |
nicklas |
align.initializeStep2 = function() |
2599 |
25 Aug 14 |
nicklas |
230 |
{ |
2599 |
25 Aug 14 |
nicklas |
Wizard.setCurrentStep(2); |
2599 |
25 Aug 14 |
nicklas |
232 |
|
2599 |
25 Aug 14 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
2599 |
25 Aug 14 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
2599 |
25 Aug 14 |
nicklas |
236 |
|
6812 |
25 Aug 22 |
nicklas |
Reggie.loadProtocols('MASKING_PROTOCOL', 'maskingProtocol', 'PIPELINE', 'RNAseq/Legacy'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadSoftware('MASKING_SOFTWARE', 'maskingSoftware', 'PIPELINE,PARAMETER_SET', 'RNAseq/Legacy'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadProtocols('ALIGNMENT_PROTOCOL', 'alignProtocol', 'PIPELINE', 'RNAseq/Legacy'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadSoftware('ALIGNMENT_SOFTWARE', 'alignSoftware', 'PIPELINE,PARAMETER_SET', 'RNAseq/Legacy'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadProtocols('FEATURE_EXTRACTION_PROTOCOL', 'cufflinksProtocol', 'PIPELINE', 'RNAseq/Legacy'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadSoftware('FEATURE_EXTRACTION_SOFTWARE', 'cufflinksSoftware', 'PIPELINE,PARAMETER_SET', 'RNAseq/Legacy'); |
2599 |
25 Aug 14 |
nicklas |
243 |
|
4542 |
26 Jun 17 |
nicklas |
// Load array design |
4542 |
26 Jun 17 |
nicklas |
var url = '../Cufflinks.servlet?ID='+App.getSessionId() + '&cmd=GetArrayDesigns'; |
4542 |
26 Jun 17 |
nicklas |
Doc.addClass('arrayDesign', 'list-loading'); |
4542 |
26 Jun 17 |
nicklas |
frm.arrayDesign[0] = new Option('loading...'); |
4542 |
26 Jun 17 |
nicklas |
Wizard.asyncJsonRequest(url, align.arrayDesignsLoaded); |
4542 |
26 Jun 17 |
nicklas |
249 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
6675 |
13 Apr 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=legacy'; |
2599 |
25 Aug 14 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
2599 |
25 Aug 14 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
2599 |
25 Aug 14 |
nicklas |
Wizard.asyncJsonRequest(url, align.clustersLoaded); |
2599 |
25 Aug 14 |
nicklas |
255 |
|
2599 |
25 Aug 14 |
nicklas |
Doc.show('goregister'); |
2599 |
25 Aug 14 |
nicklas |
Doc.show('gocancel'); |
2599 |
25 Aug 14 |
nicklas |
258 |
} |
2599 |
25 Aug 14 |
nicklas |
259 |
|
6824 |
30 Aug 22 |
nicklas |
align.validateStep2 = function(event) |
2599 |
25 Aug 14 |
nicklas |
261 |
{ |
4542 |
26 Jun 17 |
nicklas |
var valid = clusterIsValid; |
4542 |
26 Jun 17 |
nicklas |
valid &= arrayDesignIsValid; |
4542 |
26 Jun 17 |
nicklas |
if (!valid) event.preventDefault(); |
2599 |
25 Aug 14 |
nicklas |
265 |
} |
2599 |
25 Aug 14 |
nicklas |
266 |
|
4542 |
26 Jun 17 |
nicklas |
align.arrayDesignsLoaded = function(response) |
4542 |
26 Jun 17 |
nicklas |
268 |
{ |
4542 |
26 Jun 17 |
nicklas |
Doc.removeClass('arrayDesign', 'list-loading'); |
4542 |
26 Jun 17 |
nicklas |
var frm = document.forms['reggie']; |
4542 |
26 Jun 17 |
nicklas |
var designs = response.arrayDesigns; |
4542 |
26 Jun 17 |
nicklas |
frm.arrayDesign.length = 0; |
4542 |
26 Jun 17 |
nicklas |
for (var i = 0; i < designs.length; i++) |
4542 |
26 Jun 17 |
nicklas |
274 |
{ |
4542 |
26 Jun 17 |
nicklas |
var design = designs[i]; |
4583 |
21 Sep 17 |
nicklas |
var option = new Option(design.name + ' ('+design.numFeatures+')', design.id, design.isDefault, design.isDefault); |
4542 |
26 Jun 17 |
nicklas |
option.arrayDesign = design; |
4542 |
26 Jun 17 |
nicklas |
frm.arrayDesign[frm.arrayDesign.length] = option; |
4542 |
26 Jun 17 |
nicklas |
279 |
} |
4542 |
26 Jun 17 |
nicklas |
if (frm.arrayDesign.length == 0) |
4542 |
26 Jun 17 |
nicklas |
281 |
{ |
4542 |
26 Jun 17 |
nicklas |
Wizard.setInputStatus('arrayDesign', 'invalid', 'No available array designs'); |
4542 |
26 Jun 17 |
nicklas |
arrayDesignIsValid = false; |
4542 |
26 Jun 17 |
nicklas |
284 |
} |
4542 |
26 Jun 17 |
nicklas |
else |
4542 |
26 Jun 17 |
nicklas |
286 |
{ |
4542 |
26 Jun 17 |
nicklas |
Wizard.setInputStatus('arrayDesign', 'valid'); |
4542 |
26 Jun 17 |
nicklas |
arrayDesignIsValid = true; |
4542 |
26 Jun 17 |
nicklas |
289 |
} |
4542 |
26 Jun 17 |
nicklas |
290 |
} |
4542 |
26 Jun 17 |
nicklas |
291 |
|
2599 |
25 Aug 14 |
nicklas |
align.clustersLoaded = function(response) |
2599 |
25 Aug 14 |
nicklas |
293 |
{ |
2599 |
25 Aug 14 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
4306 |
17 Jan 17 |
nicklas |
var clusters = response.hosts; |
2599 |
25 Aug 14 |
nicklas |
frm.clusters.length = 0; |
2599 |
25 Aug 14 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
2599 |
25 Aug 14 |
nicklas |
299 |
{ |
2599 |
25 Aug 14 |
nicklas |
var cl = clusters[i]; |
4306 |
17 Jan 17 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
2599 |
25 Aug 14 |
nicklas |
option.cluster = cl; |
2599 |
25 Aug 14 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
2599 |
25 Aug 14 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
2599 |
25 Aug 14 |
nicklas |
clusterIsValid = true; |
2599 |
25 Aug 14 |
nicklas |
306 |
} |
2599 |
25 Aug 14 |
nicklas |
if (frm.clusters.length == 0) |
2599 |
25 Aug 14 |
nicklas |
308 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
2599 |
25 Aug 14 |
nicklas |
clusterIsValid = false; |
2599 |
25 Aug 14 |
nicklas |
311 |
} |
2599 |
25 Aug 14 |
nicklas |
else |
2599 |
25 Aug 14 |
nicklas |
313 |
{ |
2599 |
25 Aug 14 |
nicklas |
align.clusterOnChange(); |
2599 |
25 Aug 14 |
nicklas |
315 |
} |
2599 |
25 Aug 14 |
nicklas |
316 |
} |
2599 |
25 Aug 14 |
nicklas |
317 |
|
3115 |
06 Feb 15 |
nicklas |
align.softwareOnChange = function(event) |
3115 |
06 Feb 15 |
nicklas |
319 |
{ |
3115 |
06 Feb 15 |
nicklas |
var frm = document.forms['reggie']; |
3115 |
06 Feb 15 |
nicklas |
var target = event.currentTarget; |
3115 |
06 Feb 15 |
nicklas |
var item = target[target.selectedIndex].item; |
3118 |
06 Feb 15 |
nicklas |
if (!item) item = {}; |
3115 |
06 Feb 15 |
nicklas |
324 |
|
3115 |
06 Feb 15 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
3115 |
06 Feb 15 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
3116 |
06 Feb 15 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
3116 |
06 Feb 15 |
nicklas |
328 |
|
3116 |
06 Feb 15 |
nicklas |
if (item.ParameterSet) |
3116 |
06 Feb 15 |
nicklas |
330 |
{ |
3116 |
06 Feb 15 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
3116 |
06 Feb 15 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
3117 |
06 Feb 15 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
3116 |
06 Feb 15 |
nicklas |
url += '&targetId='+target.id; |
3116 |
06 Feb 15 |
nicklas |
Wizard.asyncJsonRequest(url, align.parameterSetInfoLoaded); |
3116 |
06 Feb 15 |
nicklas |
336 |
} |
7372 |
06 Oct 23 |
nicklas |
align.updateSubmitOptions(); |
3115 |
06 Feb 15 |
nicklas |
338 |
} |
3115 |
06 Feb 15 |
nicklas |
339 |
|
3116 |
06 Feb 15 |
nicklas |
align.parameterSetInfoLoaded = function(response) |
3116 |
06 Feb 15 |
nicklas |
341 |
{ |
3116 |
06 Feb 15 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
3116 |
06 Feb 15 |
nicklas |
343 |
{ |
3116 |
06 Feb 15 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
3116 |
06 Feb 15 |
nicklas |
345 |
} |
3116 |
06 Feb 15 |
nicklas |
346 |
} |
3116 |
06 Feb 15 |
nicklas |
347 |
|
2599 |
25 Aug 14 |
nicklas |
align.clusterOnChange = function() |
2599 |
25 Aug 14 |
nicklas |
349 |
{ |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
2599 |
25 Aug 14 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
2599 |
25 Aug 14 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
2599 |
25 Aug 14 |
nicklas |
353 |
{ |
2599 |
25 Aug 14 |
nicklas |
frm.priority.length = 0; |
2599 |
25 Aug 14 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
2599 |
25 Aug 14 |
nicklas |
356 |
{ |
2599 |
25 Aug 14 |
nicklas |
var p = cluster.priorities[pNo]; |
4583 |
21 Sep 17 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
2599 |
25 Aug 14 |
nicklas |
359 |
} |
2599 |
25 Aug 14 |
nicklas |
Doc.show('job-priority'); |
2599 |
25 Aug 14 |
nicklas |
361 |
} |
2599 |
25 Aug 14 |
nicklas |
else |
2599 |
25 Aug 14 |
nicklas |
363 |
{ |
2599 |
25 Aug 14 |
nicklas |
Doc.hide('job-priority'); |
2599 |
25 Aug 14 |
nicklas |
365 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
367 |
{ |
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 |
370 |
{ |
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 |
375 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
377 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
379 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
381 |
} |
7372 |
06 Oct 23 |
nicklas |
align.updateSubmitOptions(); |
2599 |
25 Aug 14 |
nicklas |
383 |
} |
2599 |
25 Aug 14 |
nicklas |
384 |
|
7372 |
06 Oct 23 |
nicklas |
align.debugOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
386 |
{ |
7372 |
06 Oct 23 |
nicklas |
align.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
388 |
} |
7372 |
06 Oct 23 |
nicklas |
389 |
|
7372 |
06 Oct 23 |
nicklas |
align.updateSubmitOptions = function() |
7372 |
06 Oct 23 |
nicklas |
391 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
var config = frm.clusters[frm.clusters.selectedIndex]?.cluster?.config?.legacy; |
7372 |
06 Oct 23 |
nicklas |
if (config) |
7372 |
06 Oct 23 |
nicklas |
395 |
{ |
7372 |
06 Oct 23 |
nicklas |
var parameterSet = frm.alignSoftware[frm.alignSoftware.selectedIndex]?.item?.ParameterSet; |
7372 |
06 Oct 23 |
nicklas |
Doc.element('submitOptions').innerHTML = Reggie.getSubmitOptions(config, frm.debug.checked, parameterSet); |
7372 |
06 Oct 23 |
nicklas |
frm.override.disabled = false; |
7372 |
06 Oct 23 |
nicklas |
399 |
} |
7372 |
06 Oct 23 |
nicklas |
400 |
} |
7372 |
06 Oct 23 |
nicklas |
401 |
|
7372 |
06 Oct 23 |
nicklas |
align.overrideOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
403 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
Doc.showHide('submitOptions', !frm.override.checked); |
7372 |
06 Oct 23 |
nicklas |
Doc.showHide('submitOptionsOverride', frm.override.checked); |
7372 |
06 Oct 23 |
nicklas |
if (frm.submitOptionsOverride.value=='') |
7372 |
06 Oct 23 |
nicklas |
408 |
{ |
7372 |
06 Oct 23 |
nicklas |
frm.submitOptionsOverride.value = Doc.element('submitOptions').innerHTML; |
7372 |
06 Oct 23 |
nicklas |
410 |
} |
7372 |
06 Oct 23 |
nicklas |
411 |
} |
7372 |
06 Oct 23 |
nicklas |
412 |
|
2599 |
25 Aug 14 |
nicklas |
413 |
|
2599 |
25 Aug 14 |
nicklas |
align.submit = function() |
2599 |
25 Aug 14 |
nicklas |
415 |
{ |
2599 |
25 Aug 14 |
nicklas |
var frm = document.forms['reggie']; |
2599 |
25 Aug 14 |
nicklas |
417 |
|
2599 |
25 Aug 14 |
nicklas |
var submitInfo = {}; |
2599 |
25 Aug 14 |
nicklas |
submitInfo.maskingSoftware = parseInt(frm.maskingSoftware.value); |
2599 |
25 Aug 14 |
nicklas |
submitInfo.maskingProtocol = parseInt(frm.maskingProtocol.value); |
2599 |
25 Aug 14 |
nicklas |
submitInfo.alignSoftware = parseInt(frm.alignSoftware.value); |
2599 |
25 Aug 14 |
nicklas |
submitInfo.alignProtocol = parseInt(frm.alignProtocol.value); |
4542 |
26 Jun 17 |
nicklas |
submitInfo.arrayDesign = parseInt(frm.arrayDesign.value); |
4542 |
26 Jun 17 |
nicklas |
submitInfo.cufflinksSoftware = parseInt(frm.cufflinksSoftware.value); |
4542 |
26 Jun 17 |
nicklas |
submitInfo.cufflinksProtocol = parseInt(frm.cufflinksProtocol.value); |
2599 |
25 Aug 14 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
2599 |
25 Aug 14 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
2599 |
25 Aug 14 |
nicklas |
428 |
{ |
2599 |
25 Aug 14 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
2599 |
25 Aug 14 |
nicklas |
430 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
432 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
434 |
} |
7372 |
06 Oct 23 |
nicklas |
if (frm.override.checked) |
7372 |
06 Oct 23 |
nicklas |
436 |
{ |
7372 |
06 Oct 23 |
nicklas |
submitInfo.submitOptionsOverride = frm.submitOptionsOverride.value; |
7372 |
06 Oct 23 |
nicklas |
438 |
} |
2599 |
25 Aug 14 |
nicklas |
submitInfo.debug = frm.debug.checked; |
3029 |
11 Dec 14 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
2599 |
25 Aug 14 |
nicklas |
441 |
|
2599 |
25 Aug 14 |
nicklas |
var mergedSequences = []; |
2599 |
25 Aug 14 |
nicklas |
submitInfo.mergedSequences = mergedSequences; |
2599 |
25 Aug 14 |
nicklas |
444 |
|
2599 |
25 Aug 14 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
2599 |
25 Aug 14 |
nicklas |
446 |
{ |
2599 |
25 Aug 14 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
2599 |
25 Aug 14 |
nicklas |
448 |
{ |
2599 |
25 Aug 14 |
nicklas |
var ms = {}; |
2599 |
25 Aug 14 |
nicklas |
ms.id = frm.mergedSequences[msNo].mergedSequences.id; |
2599 |
25 Aug 14 |
nicklas |
mergedSequences[mergedSequences.length] = ms; |
2599 |
25 Aug 14 |
nicklas |
452 |
} |
2599 |
25 Aug 14 |
nicklas |
453 |
} |
2599 |
25 Aug 14 |
nicklas |
454 |
|
4543 |
27 Jun 17 |
nicklas |
var url = '../Cufflinks.servlet?ID='+App.getSessionId(); |
4543 |
27 Jun 17 |
nicklas |
url += '&cmd=StartCufflinks'; |
2599 |
25 Aug 14 |
nicklas |
457 |
|
2623 |
02 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
2599 |
25 Aug 14 |
nicklas |
Wizard.asyncJsonRequest(url, align.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2599 |
25 Aug 14 |
nicklas |
460 |
} |
2599 |
25 Aug 14 |
nicklas |
461 |
|
2599 |
25 Aug 14 |
nicklas |
align.submissionResults = function(response) |
2599 |
25 Aug 14 |
nicklas |
463 |
{ |
2599 |
25 Aug 14 |
nicklas |
Wizard.showFinalMessage(response.messages); |
2599 |
25 Aug 14 |
nicklas |
Doc.show('gorestart'); |
2599 |
25 Aug 14 |
nicklas |
466 |
} |
2599 |
25 Aug 14 |
nicklas |
467 |
|
2599 |
25 Aug 14 |
nicklas |
return align; |
2599 |
25 Aug 14 |
nicklas |
469 |
}(); |
2599 |
25 Aug 14 |
nicklas |
470 |
|
2599 |
25 Aug 14 |
nicklas |
Doc.onLoad(Align.initPage); |
2599 |
25 Aug 14 |
nicklas |
472 |
|