4594 |
26 Sep 17 |
nicklas |
var Hisat = function() |
4594 |
26 Sep 17 |
nicklas |
2 |
{ |
4594 |
26 Sep 17 |
nicklas |
var hisat = {}; |
4594 |
26 Sep 17 |
nicklas |
var debug = 0; |
5542 |
05 Aug 19 |
nicklas |
var selectionIsValid = false; |
4594 |
26 Sep 17 |
nicklas |
var subtypeMergedSequences = null; |
5542 |
05 Aug 19 |
nicklas |
var annotationTypePipeline = null; |
4594 |
26 Sep 17 |
nicklas |
var clusterIsValid = false; |
4989 |
28 Sep 18 |
nicklas |
var manuallySelected = []; |
4594 |
26 Sep 17 |
nicklas |
10 |
|
4594 |
26 Sep 17 |
nicklas |
// Page initialization |
4594 |
26 Sep 17 |
nicklas |
hisat.initPage = function() |
4594 |
26 Sep 17 |
nicklas |
13 |
{ |
4594 |
26 Sep 17 |
nicklas |
14 |
|
4594 |
26 Sep 17 |
nicklas |
// Step 1 |
4594 |
26 Sep 17 |
nicklas |
Buttons.addClickHandler('btnSelectMergedSequences', hisat.selectMergedSequences); |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('mergedSequences', 'base-selected', hisat.setMergedSequenceCallback); |
4989 |
28 Sep 18 |
nicklas |
Events.addEventHandler('mergedSequences', 'change', hisat.mergedSequencesOnChange); |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', hisat.validateStep1); |
4594 |
26 Sep 17 |
nicklas |
20 |
|
4594 |
26 Sep 17 |
nicklas |
// Step 2 |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', hisat.initializeStep2); |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', hisat.validateStep2); |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('clusters', 'change', hisat.clusterOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('debug', 'change', hisat.debugOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('override', 'change', hisat.overrideOnChange); |
4656 |
24 Jan 18 |
nicklas |
Events.addEventHandler('maskingSoftware', 'change', hisat.softwareOnChange); |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('alignSoftware', 'change', hisat.softwareOnChange); |
4594 |
26 Sep 17 |
nicklas |
29 |
|
4594 |
26 Sep 17 |
nicklas |
// Navigation |
4594 |
26 Sep 17 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
4594 |
26 Sep 17 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
4594 |
26 Sep 17 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
4594 |
26 Sep 17 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
4594 |
26 Sep 17 |
nicklas |
35 |
|
4594 |
26 Sep 17 |
nicklas |
// Final registration |
4594 |
26 Sep 17 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', hisat.submit); |
4594 |
26 Sep 17 |
nicklas |
38 |
|
4594 |
26 Sep 17 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
4594 |
26 Sep 17 |
nicklas |
var url = '../Hisat.servlet?ID='+App.getSessionId(); |
4594 |
26 Sep 17 |
nicklas |
url += '&cmd=GetMergedSequencesForHisat'; |
4594 |
26 Sep 17 |
nicklas |
Wizard.asyncJsonRequest(url, hisat.initializeStep1); |
4594 |
26 Sep 17 |
nicklas |
43 |
} |
4594 |
26 Sep 17 |
nicklas |
44 |
|
4594 |
26 Sep 17 |
nicklas |
// --- Step 1 ----------------------------------- |
4594 |
26 Sep 17 |
nicklas |
hisat.initializeStep1 = function(response) |
4594 |
26 Sep 17 |
nicklas |
47 |
{ |
4594 |
26 Sep 17 |
nicklas |
var mergedSequences = response.mergedSequences; |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
50 |
|
4594 |
26 Sep 17 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
4594 |
26 Sep 17 |
nicklas |
52 |
{ |
4594 |
26 Sep 17 |
nicklas |
var firstPlate = null; |
4594 |
26 Sep 17 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
4594 |
26 Sep 17 |
nicklas |
55 |
{ |
4594 |
26 Sep 17 |
nicklas |
var ms = mergedSequences[msNo]; |
4989 |
28 Sep 18 |
nicklas |
var libPlate = ms.lib.bioWell ? ms.lib.bioWell.bioPlate : null; |
4594 |
26 Sep 17 |
nicklas |
if (firstPlate == null && libPlate != null) firstPlate = libPlate.name; |
4989 |
28 Sep 18 |
nicklas |
var option = hisat.createListOption(msNo+1, ms, ms.DO_NOT_USE == null && libPlate != null && libPlate.name==firstPlate) |
4594 |
26 Sep 17 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
4594 |
26 Sep 17 |
nicklas |
61 |
} |
5542 |
05 Aug 19 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
4594 |
26 Sep 17 |
nicklas |
63 |
} |
4594 |
26 Sep 17 |
nicklas |
else |
4594 |
26 Sep 17 |
nicklas |
65 |
{ |
4594 |
26 Sep 17 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', 'No new sequences available for processing'); |
4594 |
26 Sep 17 |
nicklas |
67 |
} |
4594 |
26 Sep 17 |
nicklas |
68 |
|
4594 |
26 Sep 17 |
nicklas |
Doc.show('step-1'); |
4594 |
26 Sep 17 |
nicklas |
Doc.show('gonext'); |
4594 |
26 Sep 17 |
nicklas |
71 |
|
4594 |
26 Sep 17 |
nicklas |
frm.mergedSequences.focus(); |
4594 |
26 Sep 17 |
nicklas |
73 |
} |
4594 |
26 Sep 17 |
nicklas |
74 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.validateStep1 = function(event) |
4594 |
26 Sep 17 |
nicklas |
76 |
{ |
5542 |
05 Aug 19 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
4594 |
26 Sep 17 |
nicklas |
78 |
} |
4594 |
26 Sep 17 |
nicklas |
79 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.selectMergedSequences = function() |
4594 |
26 Sep 17 |
nicklas |
81 |
{ |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
if (frm.mergedSequences.disabled) return; |
4594 |
26 Sep 17 |
nicklas |
84 |
|
4594 |
26 Sep 17 |
nicklas |
if (subtypeMergedSequences == null) |
4594 |
26 Sep 17 |
nicklas |
86 |
{ |
4594 |
26 Sep 17 |
nicklas |
subtypeMergedSequences = Reggie.getSubtypeInfo('MERGED_SEQUENCES'); |
4594 |
26 Sep 17 |
nicklas |
88 |
} |
5542 |
05 Aug 19 |
nicklas |
if (annotationTypePipeline == null) |
5542 |
05 Aug 19 |
nicklas |
90 |
{ |
5542 |
05 Aug 19 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5542 |
05 Aug 19 |
nicklas |
92 |
} |
4594 |
26 Sep 17 |
nicklas |
93 |
|
4989 |
28 Sep 18 |
nicklas |
// Reset list |
4989 |
28 Sep 18 |
nicklas |
manuallySelected = []; |
4594 |
26 Sep 17 |
nicklas |
var url = '&resetTemporary=1'; |
4594 |
26 Sep 17 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeMergedSequences.id; |
5542 |
05 Aug 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'=RNAseq'; |
4594 |
26 Sep 17 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'mergedSequences', 1, url); |
4594 |
26 Sep 17 |
nicklas |
100 |
} |
4594 |
26 Sep 17 |
nicklas |
101 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.setMergedSequenceCallback = function(event) |
4594 |
26 Sep 17 |
nicklas |
103 |
{ |
4594 |
26 Sep 17 |
nicklas |
var ms = event.detail; |
4594 |
26 Sep 17 |
nicklas |
105 |
|
4990 |
01 Oct 18 |
nicklas |
var opt = Reggie.getListOption('mergedSequences', ms.id); |
4990 |
01 Oct 18 |
nicklas |
if (opt) |
4989 |
28 Sep 18 |
nicklas |
108 |
{ |
4990 |
01 Oct 18 |
nicklas |
opt.selected = true; |
4990 |
01 Oct 18 |
nicklas |
110 |
} |
4990 |
01 Oct 18 |
nicklas |
else |
4990 |
01 Oct 18 |
nicklas |
112 |
{ |
4990 |
01 Oct 18 |
nicklas |
manuallySelected[manuallySelected.length] = ms.id; |
4990 |
01 Oct 18 |
nicklas |
114 |
} |
4990 |
01 Oct 18 |
nicklas |
115 |
|
4990 |
01 Oct 18 |
nicklas |
if (ms.remaining == 0 && manuallySelected.length > 0) |
4990 |
01 Oct 18 |
nicklas |
117 |
{ |
4989 |
28 Sep 18 |
nicklas |
var url = '../Hisat.servlet?ID='+App.getSessionId(); |
4989 |
28 Sep 18 |
nicklas |
url += '&cmd=GetMergedSequencesForHisat'; |
4989 |
28 Sep 18 |
nicklas |
url += '&items='+manuallySelected.join(','); |
4989 |
28 Sep 18 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
4989 |
28 Sep 18 |
nicklas |
Wizard.asyncJsonRequest(url, hisat.manuallySelected); |
4989 |
28 Sep 18 |
nicklas |
123 |
} |
4990 |
01 Oct 18 |
nicklas |
else |
4990 |
01 Oct 18 |
nicklas |
125 |
{ |
4990 |
01 Oct 18 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
4990 |
01 Oct 18 |
nicklas |
127 |
} |
4989 |
28 Sep 18 |
nicklas |
128 |
} |
4989 |
28 Sep 18 |
nicklas |
129 |
|
4989 |
28 Sep 18 |
nicklas |
hisat.manuallySelected = function(response) |
4989 |
28 Sep 18 |
nicklas |
131 |
{ |
4989 |
28 Sep 18 |
nicklas |
var mergedSequences = response.mergedSequences; |
4989 |
28 Sep 18 |
nicklas |
var frm = document.forms['reggie']; |
4989 |
28 Sep 18 |
nicklas |
134 |
|
4989 |
28 Sep 18 |
nicklas |
if (mergedSequences != null && mergedSequences.length > 0) |
4989 |
28 Sep 18 |
nicklas |
136 |
{ |
4989 |
28 Sep 18 |
nicklas |
var offset = frm.mergedSequences.length+1; |
4989 |
28 Sep 18 |
nicklas |
for (var msNo=0; msNo < mergedSequences.length; msNo++) |
4989 |
28 Sep 18 |
nicklas |
139 |
{ |
4989 |
28 Sep 18 |
nicklas |
var ms = mergedSequences[msNo]; |
4989 |
28 Sep 18 |
nicklas |
var option = hisat.createListOption(msNo+offset, ms, ms.DO_NOT_USE == null); |
4989 |
28 Sep 18 |
nicklas |
frm.mergedSequences.options[frm.mergedSequences.length] = option; |
4989 |
28 Sep 18 |
nicklas |
143 |
} |
4990 |
01 Oct 18 |
nicklas |
Events.sendChangeEvent('mergedSequences'); |
4989 |
28 Sep 18 |
nicklas |
145 |
} |
4989 |
28 Sep 18 |
nicklas |
146 |
} |
4989 |
28 Sep 18 |
nicklas |
147 |
|
4989 |
28 Sep 18 |
nicklas |
hisat.createListOption = function(index, mergedItem, selected) |
4989 |
28 Sep 18 |
nicklas |
149 |
{ |
4989 |
28 Sep 18 |
nicklas |
var lib = mergedItem.lib; |
4989 |
28 Sep 18 |
nicklas |
var isYellow = lib.specimen && lib.specimen.YellowLabel != null; |
4989 |
28 Sep 18 |
nicklas |
var libPlate = lib.bioWell ? lib.bioWell.bioPlate : null; |
4989 |
28 Sep 18 |
nicklas |
153 |
|
4989 |
28 Sep 18 |
nicklas |
var tooltip = null; |
4989 |
28 Sep 18 |
nicklas |
var name = (index) + ': '; |
4989 |
28 Sep 18 |
nicklas |
if (libPlate) name += libPlate.name + ' - '; |
4989 |
28 Sep 18 |
nicklas |
name += mergedItem.name; |
4989 |
28 Sep 18 |
nicklas |
158 |
|
4989 |
28 Sep 18 |
nicklas |
if (mergedItem.DO_NOT_USE) |
4989 |
28 Sep 18 |
nicklas |
160 |
{ |
4989 |
28 Sep 18 |
nicklas |
name += ' [DoNotUse]'; |
4989 |
28 Sep 18 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(mergedItem.DO_NOT_USE+': '+mergedItem.DO_NOT_USE_COMMENT); |
4989 |
28 Sep 18 |
nicklas |
163 |
} |
4989 |
28 Sep 18 |
nicklas |
else if (mergedItem.AutoProcess == 'ReProcess') |
4989 |
28 Sep 18 |
nicklas |
165 |
{ |
4989 |
28 Sep 18 |
nicklas |
name += ' [R]'; |
4989 |
28 Sep 18 |
nicklas |
167 |
} |
4989 |
28 Sep 18 |
nicklas |
168 |
|
4989 |
28 Sep 18 |
nicklas |
var option = new Option(name, mergedItem.id, false, selected); |
4989 |
28 Sep 18 |
nicklas |
if (isYellow) option.className = 'yellow'; |
4989 |
28 Sep 18 |
nicklas |
if (tooltip) option.title = tooltip; |
4989 |
28 Sep 18 |
nicklas |
option.mergedSequences = mergedItem; |
4989 |
28 Sep 18 |
nicklas |
return option; |
4989 |
28 Sep 18 |
nicklas |
174 |
} |
4989 |
28 Sep 18 |
nicklas |
175 |
|
4989 |
28 Sep 18 |
nicklas |
hisat.mergedSequencesOnChange = function() |
4989 |
28 Sep 18 |
nicklas |
177 |
{ |
4594 |
26 Sep 17 |
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; |
4989 |
28 Sep 18 |
nicklas |
183 |
|
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences'); |
5542 |
05 Aug 19 |
nicklas |
Wizard.hideGoNextConfirmation(); |
4989 |
28 Sep 18 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
4594 |
26 Sep 17 |
nicklas |
187 |
{ |
4989 |
28 Sep 18 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
4594 |
26 Sep 17 |
nicklas |
189 |
{ |
5542 |
05 Aug 19 |
nicklas |
numSelected++; |
4989 |
28 Sep 18 |
nicklas |
var ms = frm.mergedSequences[msNo].mergedSequences; |
4989 |
28 Sep 18 |
nicklas |
if (ms.DO_NOT_USE) numDoNotUse++; |
5542 |
05 Aug 19 |
nicklas |
if (ms.pipeline && ms.pipeline != 'RNAseq') |
5542 |
05 Aug 19 |
nicklas |
194 |
{ |
5542 |
05 Aug 19 |
nicklas |
invalidPipeline = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the RNAseq pipeline.'; |
5542 |
05 Aug 19 |
nicklas |
196 |
} |
4594 |
26 Sep 17 |
nicklas |
197 |
} |
4594 |
26 Sep 17 |
nicklas |
198 |
} |
4989 |
28 Sep 18 |
nicklas |
199 |
|
5542 |
05 Aug 19 |
nicklas |
if (numSelected == 0) |
5542 |
05 Aug 19 |
nicklas |
201 |
{ |
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 |
204 |
} |
5542 |
05 Aug 19 |
nicklas |
if (invalidPipeline) |
5542 |
05 Aug 19 |
nicklas |
206 |
{ |
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'invalid', invalidPipeline); |
5542 |
05 Aug 19 |
nicklas |
return; |
5542 |
05 Aug 19 |
nicklas |
209 |
} |
5542 |
05 Aug 19 |
nicklas |
selectionIsValid = true; |
5542 |
05 Aug 19 |
nicklas |
211 |
|
4989 |
28 Sep 18 |
nicklas |
if (numDoNotUse > 0) |
4989 |
28 Sep 18 |
nicklas |
213 |
{ |
4989 |
28 Sep 18 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
4989 |
28 Sep 18 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
4989 |
28 Sep 18 |
nicklas |
216 |
} |
4989 |
28 Sep 18 |
nicklas |
else |
4989 |
28 Sep 18 |
nicklas |
218 |
{ |
5542 |
05 Aug 19 |
nicklas |
Wizard.setInputStatus('mergedSequences', 'valid'); |
4989 |
28 Sep 18 |
nicklas |
220 |
} |
4594 |
26 Sep 17 |
nicklas |
221 |
} |
4594 |
26 Sep 17 |
nicklas |
222 |
|
4594 |
26 Sep 17 |
nicklas |
// --- Step 2 ----------------------------------- |
4594 |
26 Sep 17 |
nicklas |
hisat.initializeStep2 = function() |
4594 |
26 Sep 17 |
nicklas |
225 |
{ |
4594 |
26 Sep 17 |
nicklas |
Wizard.setCurrentStep(2); |
4594 |
26 Sep 17 |
nicklas |
227 |
|
4594 |
26 Sep 17 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
4594 |
26 Sep 17 |
nicklas |
231 |
|
6812 |
25 Aug 22 |
nicklas |
Reggie.loadProtocols('MASKING_PROTOCOL', 'maskingProtocol', 'PIPELINE', 'RNAseq/Hisat/StringTie'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadSoftware('MASKING_SOFTWARE', 'maskingSoftware', 'PIPELINE,PARAMETER_SET', 'RNAseq/Hisat/StringTie'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadProtocols('ALIGNMENT_PROTOCOL', 'alignProtocol', 'PIPELINE', 'RNAseq/Hisat/StringTie'); |
6812 |
25 Aug 22 |
nicklas |
Reggie.loadSoftware('ALIGNMENT_SOFTWARE', 'alignSoftware', 'PIPELINE,PARAMETER_SET', 'RNAseq/Hisat/StringTie'); |
4594 |
26 Sep 17 |
nicklas |
236 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
6633 |
08 Mar 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=align-hisat'; |
4594 |
26 Sep 17 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
4594 |
26 Sep 17 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
4594 |
26 Sep 17 |
nicklas |
Wizard.asyncJsonRequest(url, hisat.clustersLoaded); |
4594 |
26 Sep 17 |
nicklas |
242 |
|
4594 |
26 Sep 17 |
nicklas |
Doc.show('goregister'); |
4594 |
26 Sep 17 |
nicklas |
Doc.show('gocancel'); |
4594 |
26 Sep 17 |
nicklas |
245 |
} |
4594 |
26 Sep 17 |
nicklas |
246 |
|
6824 |
30 Aug 22 |
nicklas |
hisat.validateStep2 = function(event) |
4594 |
26 Sep 17 |
nicklas |
248 |
{ |
4594 |
26 Sep 17 |
nicklas |
if (!clusterIsValid) event.preventDefault(); |
4594 |
26 Sep 17 |
nicklas |
250 |
} |
4594 |
26 Sep 17 |
nicklas |
251 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.clustersLoaded = function(response) |
4594 |
26 Sep 17 |
nicklas |
253 |
{ |
4594 |
26 Sep 17 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
var clusters = response.hosts; |
4594 |
26 Sep 17 |
nicklas |
frm.clusters.length = 0; |
4594 |
26 Sep 17 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
4594 |
26 Sep 17 |
nicklas |
259 |
{ |
4594 |
26 Sep 17 |
nicklas |
var cl = clusters[i]; |
4594 |
26 Sep 17 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
4594 |
26 Sep 17 |
nicklas |
option.cluster = cl; |
4594 |
26 Sep 17 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
4594 |
26 Sep 17 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
4594 |
26 Sep 17 |
nicklas |
clusterIsValid = true; |
4594 |
26 Sep 17 |
nicklas |
266 |
} |
4594 |
26 Sep 17 |
nicklas |
if (frm.clusters.length == 0) |
4594 |
26 Sep 17 |
nicklas |
268 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
4594 |
26 Sep 17 |
nicklas |
clusterIsValid = false; |
4594 |
26 Sep 17 |
nicklas |
271 |
} |
4594 |
26 Sep 17 |
nicklas |
else |
4594 |
26 Sep 17 |
nicklas |
273 |
{ |
4594 |
26 Sep 17 |
nicklas |
hisat.clusterOnChange(); |
4594 |
26 Sep 17 |
nicklas |
275 |
} |
4594 |
26 Sep 17 |
nicklas |
276 |
} |
4594 |
26 Sep 17 |
nicklas |
277 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.softwareOnChange = function(event) |
4594 |
26 Sep 17 |
nicklas |
279 |
{ |
4594 |
26 Sep 17 |
nicklas |
var target = event.currentTarget; |
4594 |
26 Sep 17 |
nicklas |
var item = target[target.selectedIndex].item; |
4594 |
26 Sep 17 |
nicklas |
if (!item) item = {}; |
4594 |
26 Sep 17 |
nicklas |
283 |
|
4594 |
26 Sep 17 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
4594 |
26 Sep 17 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
4594 |
26 Sep 17 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
4594 |
26 Sep 17 |
nicklas |
287 |
|
4594 |
26 Sep 17 |
nicklas |
if (item.ParameterSet) |
4594 |
26 Sep 17 |
nicklas |
289 |
{ |
4594 |
26 Sep 17 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
4594 |
26 Sep 17 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
4594 |
26 Sep 17 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
4594 |
26 Sep 17 |
nicklas |
url += '&targetId='+target.id; |
4594 |
26 Sep 17 |
nicklas |
Wizard.asyncJsonRequest(url, hisat.parameterSetInfoLoaded); |
4594 |
26 Sep 17 |
nicklas |
295 |
} |
7372 |
06 Oct 23 |
nicklas |
hisat.updateSubmitOptions(); |
4594 |
26 Sep 17 |
nicklas |
297 |
} |
4594 |
26 Sep 17 |
nicklas |
298 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.parameterSetInfoLoaded = function(response) |
4594 |
26 Sep 17 |
nicklas |
300 |
{ |
4594 |
26 Sep 17 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
4594 |
26 Sep 17 |
nicklas |
302 |
{ |
4594 |
26 Sep 17 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
4594 |
26 Sep 17 |
nicklas |
304 |
} |
4594 |
26 Sep 17 |
nicklas |
305 |
} |
4594 |
26 Sep 17 |
nicklas |
306 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.clusterOnChange = function() |
4594 |
26 Sep 17 |
nicklas |
308 |
{ |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
4594 |
26 Sep 17 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
4594 |
26 Sep 17 |
nicklas |
312 |
{ |
4594 |
26 Sep 17 |
nicklas |
frm.priority.length = 0; |
4594 |
26 Sep 17 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
4594 |
26 Sep 17 |
nicklas |
315 |
{ |
4594 |
26 Sep 17 |
nicklas |
var p = cluster.priorities[pNo]; |
4594 |
26 Sep 17 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
4594 |
26 Sep 17 |
nicklas |
318 |
} |
4594 |
26 Sep 17 |
nicklas |
Doc.show('job-priority'); |
4594 |
26 Sep 17 |
nicklas |
320 |
} |
4594 |
26 Sep 17 |
nicklas |
else |
4594 |
26 Sep 17 |
nicklas |
322 |
{ |
4594 |
26 Sep 17 |
nicklas |
Doc.hide('job-priority'); |
4594 |
26 Sep 17 |
nicklas |
324 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
326 |
{ |
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 |
329 |
{ |
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 |
334 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
336 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
338 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
340 |
} |
7372 |
06 Oct 23 |
nicklas |
hisat.updateSubmitOptions(); |
4594 |
26 Sep 17 |
nicklas |
342 |
} |
4594 |
26 Sep 17 |
nicklas |
343 |
|
7372 |
06 Oct 23 |
nicklas |
hisat.debugOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
345 |
{ |
7372 |
06 Oct 23 |
nicklas |
hisat.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
347 |
} |
7372 |
06 Oct 23 |
nicklas |
348 |
|
7372 |
06 Oct 23 |
nicklas |
hisat.updateSubmitOptions = function() |
7372 |
06 Oct 23 |
nicklas |
350 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
var config = frm.clusters[frm.clusters.selectedIndex]?.cluster?.config?.['align-hisat']; |
7372 |
06 Oct 23 |
nicklas |
if (config) |
7372 |
06 Oct 23 |
nicklas |
354 |
{ |
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 |
358 |
} |
7372 |
06 Oct 23 |
nicklas |
359 |
} |
7372 |
06 Oct 23 |
nicklas |
360 |
|
7372 |
06 Oct 23 |
nicklas |
hisat.overrideOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
362 |
{ |
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 |
367 |
{ |
7372 |
06 Oct 23 |
nicklas |
frm.submitOptionsOverride.value = Doc.element('submitOptions').innerHTML; |
7372 |
06 Oct 23 |
nicklas |
369 |
} |
7372 |
06 Oct 23 |
nicklas |
370 |
} |
4594 |
26 Sep 17 |
nicklas |
371 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.submit = function() |
4594 |
26 Sep 17 |
nicklas |
373 |
{ |
4594 |
26 Sep 17 |
nicklas |
var frm = document.forms['reggie']; |
4594 |
26 Sep 17 |
nicklas |
375 |
|
4594 |
26 Sep 17 |
nicklas |
var submitInfo = {}; |
4656 |
24 Jan 18 |
nicklas |
submitInfo.maskingSoftware = parseInt(frm.maskingSoftware.value); |
4656 |
24 Jan 18 |
nicklas |
submitInfo.maskingProtocol = parseInt(frm.maskingProtocol.value); |
4594 |
26 Sep 17 |
nicklas |
submitInfo.alignSoftware = parseInt(frm.alignSoftware.value); |
4594 |
26 Sep 17 |
nicklas |
submitInfo.alignProtocol = parseInt(frm.alignProtocol.value); |
4594 |
26 Sep 17 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
4594 |
26 Sep 17 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
4594 |
26 Sep 17 |
nicklas |
383 |
{ |
4594 |
26 Sep 17 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
4594 |
26 Sep 17 |
nicklas |
385 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
387 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
389 |
} |
7372 |
06 Oct 23 |
nicklas |
if (frm.override.checked) |
7372 |
06 Oct 23 |
nicklas |
391 |
{ |
7372 |
06 Oct 23 |
nicklas |
submitInfo.submitOptionsOverride = frm.submitOptionsOverride.value; |
7372 |
06 Oct 23 |
nicklas |
393 |
} |
4594 |
26 Sep 17 |
nicklas |
submitInfo.debug = frm.debug.checked; |
4594 |
26 Sep 17 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
4594 |
26 Sep 17 |
nicklas |
396 |
|
4594 |
26 Sep 17 |
nicklas |
var mergedSequences = []; |
4594 |
26 Sep 17 |
nicklas |
submitInfo.mergedSequences = mergedSequences; |
4594 |
26 Sep 17 |
nicklas |
399 |
|
4594 |
26 Sep 17 |
nicklas |
for (var msNo = 0; msNo < frm.mergedSequences.length; msNo++) |
4594 |
26 Sep 17 |
nicklas |
401 |
{ |
4594 |
26 Sep 17 |
nicklas |
if (frm.mergedSequences[msNo].selected) |
4594 |
26 Sep 17 |
nicklas |
403 |
{ |
4594 |
26 Sep 17 |
nicklas |
var ms = {}; |
4594 |
26 Sep 17 |
nicklas |
ms.id = frm.mergedSequences[msNo].mergedSequences.id; |
4594 |
26 Sep 17 |
nicklas |
mergedSequences[mergedSequences.length] = ms; |
4594 |
26 Sep 17 |
nicklas |
407 |
} |
4594 |
26 Sep 17 |
nicklas |
408 |
} |
4594 |
26 Sep 17 |
nicklas |
409 |
|
4594 |
26 Sep 17 |
nicklas |
var url = '../Hisat.servlet?ID='+App.getSessionId(); |
4594 |
26 Sep 17 |
nicklas |
url += '&cmd=StartHisatAlignment'; |
4594 |
26 Sep 17 |
nicklas |
412 |
|
4594 |
26 Sep 17 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
4594 |
26 Sep 17 |
nicklas |
Wizard.asyncJsonRequest(url, hisat.submissionResults, 'POST', JSON.stringify(submitInfo)); |
4594 |
26 Sep 17 |
nicklas |
415 |
} |
4594 |
26 Sep 17 |
nicklas |
416 |
|
4594 |
26 Sep 17 |
nicklas |
hisat.submissionResults = function(response) |
4594 |
26 Sep 17 |
nicklas |
418 |
{ |
4594 |
26 Sep 17 |
nicklas |
Wizard.showFinalMessage(response.messages); |
4594 |
26 Sep 17 |
nicklas |
Doc.show('gorestart'); |
4594 |
26 Sep 17 |
nicklas |
421 |
} |
4594 |
26 Sep 17 |
nicklas |
422 |
|
4594 |
26 Sep 17 |
nicklas |
return hisat; |
4594 |
26 Sep 17 |
nicklas |
424 |
}(); |
4594 |
26 Sep 17 |
nicklas |
425 |
|
4594 |
26 Sep 17 |
nicklas |
Doc.onLoad(Hisat.initPage); |
4594 |
26 Sep 17 |
nicklas |
427 |
|