2622 |
02 Sep 14 |
nicklas |
var Demux = function() |
2622 |
02 Sep 14 |
nicklas |
2 |
{ |
2622 |
02 Sep 14 |
nicklas |
var demux = {}; |
2656 |
11 Sep 14 |
nicklas |
var debug = 0; |
5479 |
10 Jun 19 |
nicklas |
5 |
|
5479 |
10 Jun 19 |
nicklas |
var pipeline = null; |
2622 |
02 Sep 14 |
nicklas |
var subtypeSequencingRun = null; |
5479 |
10 Jun 19 |
nicklas |
var annotationTypePipeline = null; |
5479 |
10 Jun 19 |
nicklas |
var seqRunsAreValid = false; |
2622 |
02 Sep 14 |
nicklas |
var clusterIsValid = false; |
2808 |
15 Oct 14 |
nicklas |
var newSeqRuns; |
6280 |
09 Jun 21 |
nicklas |
var allLibs = []; |
2622 |
02 Sep 14 |
nicklas |
13 |
|
2622 |
02 Sep 14 |
nicklas |
// Page initialization |
2622 |
02 Sep 14 |
nicklas |
demux.initPage = function() |
2622 |
02 Sep 14 |
nicklas |
16 |
{ |
2622 |
02 Sep 14 |
nicklas |
17 |
|
2622 |
02 Sep 14 |
nicklas |
// Step 1 |
2622 |
02 Sep 14 |
nicklas |
Buttons.addClickHandler('btnSelectSeqRuns', demux.selectSeqencingRuns); |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('seqRuns', 'base-selected', demux.setSeqRunCallback); |
2628 |
02 Sep 14 |
nicklas |
Events.addEventHandler('seqRuns', 'change', demux.seqRunsOnChange); |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', demux.validateStep1); |
2622 |
02 Sep 14 |
nicklas |
23 |
|
2622 |
02 Sep 14 |
nicklas |
// Step 2 |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', demux.initializeStep2); |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', demux.validateStep2); |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('clusters', 'change', demux.clusterOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('debug', 'change', demux.debugOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('override', 'change', demux.overrideOnChange); |
3128 |
10 Feb 15 |
nicklas |
Events.addEventHandler('demuxSoftware', 'change', demux.softwareOnChange); |
3128 |
10 Feb 15 |
nicklas |
Events.addEventHandler('mergeSoftware', 'change', demux.softwareOnChange); |
6280 |
09 Jun 21 |
nicklas |
Buttons.addClickHandler('donotuseinfo', demux.showDoNotUseInfo); |
6280 |
09 Jun 21 |
nicklas |
Buttons.addClickHandler('libsAll', demux.selectLibsAll); |
6280 |
09 Jun 21 |
nicklas |
Buttons.addClickHandler('libsExceptDoNotUse', demux.selectLibsAllExceptDoNotUse); |
6280 |
09 Jun 21 |
nicklas |
Buttons.addClickHandler('libsSelected', demux.selectLibsForDemux); |
2622 |
02 Sep 14 |
nicklas |
36 |
|
2622 |
02 Sep 14 |
nicklas |
// Navigation |
2622 |
02 Sep 14 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2622 |
02 Sep 14 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2622 |
02 Sep 14 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2622 |
02 Sep 14 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2622 |
02 Sep 14 |
nicklas |
42 |
|
2622 |
02 Sep 14 |
nicklas |
// Final registration |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', demux.submit); |
2622 |
02 Sep 14 |
nicklas |
45 |
|
2622 |
02 Sep 14 |
nicklas |
46 |
|
2622 |
02 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
2622 |
02 Sep 14 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
5479 |
10 Jun 19 |
nicklas |
url += '&cmd=GetConfirmedSequencingRuns&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
2622 |
02 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, demux.initializeStep1); |
2622 |
02 Sep 14 |
nicklas |
51 |
} |
2622 |
02 Sep 14 |
nicklas |
52 |
|
2622 |
02 Sep 14 |
nicklas |
// --- Step 1 ----------------------------------- |
2622 |
02 Sep 14 |
nicklas |
demux.initializeStep1 = function(response) |
2622 |
02 Sep 14 |
nicklas |
55 |
{ |
5479 |
10 Jun 19 |
nicklas |
pipeline = response.pipeline; // We need the 'name' value here to be able to filter in "Select manually" |
2622 |
02 Sep 14 |
nicklas |
var seqRuns = response.sequencingRuns; |
2627 |
02 Sep 14 |
nicklas |
seqRuns.sort(demux.sortByPool); |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
60 |
|
2622 |
02 Sep 14 |
nicklas |
if (seqRuns.length > 0) |
2622 |
02 Sep 14 |
nicklas |
62 |
{ |
2622 |
02 Sep 14 |
nicklas |
for (var runNo=0; runNo < seqRuns.length; runNo++) |
2622 |
02 Sep 14 |
nicklas |
64 |
{ |
2622 |
02 Sep 14 |
nicklas |
var seqRun = seqRuns[runNo]; |
2622 |
02 Sep 14 |
nicklas |
var option = demux.getOptionForSeqRun(seqRun); |
2622 |
02 Sep 14 |
nicklas |
frm.seqRuns.options[frm.seqRuns.length] = option; |
2622 |
02 Sep 14 |
nicklas |
68 |
} |
5479 |
10 Jun 19 |
nicklas |
demux.seqRunsOnChange(); |
2622 |
02 Sep 14 |
nicklas |
70 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
72 |
{ |
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', 'No new sequencing runs available for processing'); |
2622 |
02 Sep 14 |
nicklas |
74 |
} |
2622 |
02 Sep 14 |
nicklas |
75 |
|
2622 |
02 Sep 14 |
nicklas |
Doc.show('step-1'); |
2622 |
02 Sep 14 |
nicklas |
Doc.show('gonext'); |
2622 |
02 Sep 14 |
nicklas |
78 |
|
2622 |
02 Sep 14 |
nicklas |
frm.seqRuns.focus(); |
2622 |
02 Sep 14 |
nicklas |
80 |
} |
2622 |
02 Sep 14 |
nicklas |
81 |
|
2622 |
02 Sep 14 |
nicklas |
demux.validateStep1 = function(event) |
2622 |
02 Sep 14 |
nicklas |
83 |
{ |
5479 |
10 Jun 19 |
nicklas |
if (!seqRunsAreValid) event.preventDefault(); |
2622 |
02 Sep 14 |
nicklas |
85 |
} |
2622 |
02 Sep 14 |
nicklas |
86 |
|
2627 |
02 Sep 14 |
nicklas |
87 |
/** |
2627 |
02 Sep 14 |
nicklas |
Sort by the name of the first pool. |
2627 |
02 Sep 14 |
nicklas |
89 |
*/ |
2627 |
02 Sep 14 |
nicklas |
demux.sortByPool = function(a, b) |
2627 |
02 Sep 14 |
nicklas |
91 |
{ |
2627 |
02 Sep 14 |
nicklas |
var p1 = a.flowCell.pools[0].name; |
2627 |
02 Sep 14 |
nicklas |
var p2 = b.flowCell.pools[0].name; |
2627 |
02 Sep 14 |
nicklas |
if (p1 < p2) return -1; |
2627 |
02 Sep 14 |
nicklas |
if (p1 > p2) return 1; |
2627 |
02 Sep 14 |
nicklas |
if (a.name < b.name) return -1; |
2627 |
02 Sep 14 |
nicklas |
if (a.name > b.name) return 1; |
2627 |
02 Sep 14 |
nicklas |
return a.id - b.id; |
2627 |
02 Sep 14 |
nicklas |
99 |
} |
2627 |
02 Sep 14 |
nicklas |
100 |
|
2622 |
02 Sep 14 |
nicklas |
demux.getOptionForSeqRun = function(seqRun) |
2622 |
02 Sep 14 |
nicklas |
102 |
{ |
2622 |
02 Sep 14 |
nicklas |
var flowCell = seqRun.flowCell; |
2622 |
02 Sep 14 |
nicklas |
var name = seqRun.name+': '; |
2622 |
02 Sep 14 |
nicklas |
var numPools = flowCell.pools.length; |
2622 |
02 Sep 14 |
nicklas |
var firstPoolNum = demux.getPoolNum(flowCell.pools[0].name); |
2622 |
02 Sep 14 |
nicklas |
var lastPoolNum = demux.getPoolNum(flowCell.pools[flowCell.pools.length-1].name); |
2622 |
02 Sep 14 |
nicklas |
108 |
|
2622 |
02 Sep 14 |
nicklas |
if (lastPoolNum - firstPoolNum == numPools - 1) |
2622 |
02 Sep 14 |
nicklas |
110 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (numPools > 1) |
2622 |
02 Sep 14 |
nicklas |
112 |
{ |
2622 |
02 Sep 14 |
nicklas |
// Display: PoolN -- PoolY |
2622 |
02 Sep 14 |
nicklas |
name += flowCell.pools[0].name + ' — ' + flowCell.pools[flowCell.pools.length-1].name; |
2622 |
02 Sep 14 |
nicklas |
115 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
117 |
{ |
2622 |
02 Sep 14 |
nicklas |
name += flowCell.pools[0].name; |
2622 |
02 Sep 14 |
nicklas |
119 |
} |
2622 |
02 Sep 14 |
nicklas |
120 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
122 |
{ |
2622 |
02 Sep 14 |
nicklas |
// Display: PoolN + x more... |
2622 |
02 Sep 14 |
nicklas |
name += flowCell.pools[0].name + ' + ' + (numPools-1) + ' more...'; |
2622 |
02 Sep 14 |
nicklas |
125 |
} |
5479 |
10 Jun 19 |
nicklas |
126 |
|
5479 |
10 Jun 19 |
nicklas |
var opt = []; |
5479 |
10 Jun 19 |
nicklas |
opt[opt.length] = flowCell.libraries.length + ' libraries'; |
5479 |
10 Jun 19 |
nicklas |
if (flowCell.FlowCellType) opt[opt.length] = flowCell.FlowCellType; |
5479 |
10 Jun 19 |
nicklas |
opt[opt.length] = seqRun.pipeline; |
5479 |
10 Jun 19 |
nicklas |
name += ' [' + opt.join('; ') + ']'; |
5479 |
10 Jun 19 |
nicklas |
132 |
|
2640 |
08 Sep 14 |
nicklas |
if (seqRun.AutoProcess == 'ReProcess') |
2640 |
08 Sep 14 |
nicklas |
134 |
{ |
2640 |
08 Sep 14 |
nicklas |
name += ' [R]'; |
2640 |
08 Sep 14 |
nicklas |
136 |
} |
2648 |
10 Sep 14 |
nicklas |
137 |
|
4985 |
28 Sep 18 |
nicklas |
// Count the number of libraries marked with DoNotUse |
4985 |
28 Sep 18 |
nicklas |
var numDoNotUse = 0; |
4985 |
28 Sep 18 |
nicklas |
for (var libNo = 0; libNo < flowCell.libraries.length; libNo++) |
4985 |
28 Sep 18 |
nicklas |
141 |
{ |
4985 |
28 Sep 18 |
nicklas |
if (flowCell.libraries[libNo].DO_NOT_USE) numDoNotUse++; |
4985 |
28 Sep 18 |
nicklas |
143 |
} |
4985 |
28 Sep 18 |
nicklas |
flowCell.numDoNotUse = numDoNotUse; |
4985 |
28 Sep 18 |
nicklas |
145 |
|
2622 |
02 Sep 14 |
nicklas |
// Tooltip is always all pools |
2622 |
02 Sep 14 |
nicklas |
var title = ''; |
2622 |
02 Sep 14 |
nicklas |
for (var poolNo=0; poolNo < numPools; poolNo++) |
2622 |
02 Sep 14 |
nicklas |
149 |
{ |
2622 |
02 Sep 14 |
nicklas |
var pool = flowCell.pools[poolNo]; |
2622 |
02 Sep 14 |
nicklas |
if (poolNo > 0) title += ', '; |
2622 |
02 Sep 14 |
nicklas |
title += pool.name; |
2622 |
02 Sep 14 |
nicklas |
153 |
} |
2622 |
02 Sep 14 |
nicklas |
154 |
|
2622 |
02 Sep 14 |
nicklas |
var option = new Option(name, seqRun.id); |
2622 |
02 Sep 14 |
nicklas |
option.title = title; |
2622 |
02 Sep 14 |
nicklas |
option.seqRun = seqRun; |
2622 |
02 Sep 14 |
nicklas |
return option; |
2622 |
02 Sep 14 |
nicklas |
159 |
} |
2622 |
02 Sep 14 |
nicklas |
160 |
|
2622 |
02 Sep 14 |
nicklas |
demux.getPoolNum = function(poolName) |
2622 |
02 Sep 14 |
nicklas |
162 |
{ |
2622 |
02 Sep 14 |
nicklas |
var num = poolName.match(/Pool(\d+)/); |
2622 |
02 Sep 14 |
nicklas |
return num ? parseInt(num[1], 10) : null; |
2622 |
02 Sep 14 |
nicklas |
165 |
} |
2622 |
02 Sep 14 |
nicklas |
166 |
|
2622 |
02 Sep 14 |
nicklas |
demux.selectSeqencingRuns = function() |
2622 |
02 Sep 14 |
nicklas |
168 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
if (frm.seqRuns.disabled) return; |
2622 |
02 Sep 14 |
nicklas |
171 |
|
2622 |
02 Sep 14 |
nicklas |
if (subtypeSequencingRun == null) |
2622 |
02 Sep 14 |
nicklas |
173 |
{ |
2622 |
02 Sep 14 |
nicklas |
subtypeSequencingRun = Reggie.getSubtypeInfo('SEQUENCING_RUN'); |
2622 |
02 Sep 14 |
nicklas |
175 |
} |
5479 |
10 Jun 19 |
nicklas |
if (annotationTypePipeline == null) |
5479 |
10 Jun 19 |
nicklas |
177 |
{ |
5479 |
10 Jun 19 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5479 |
10 Jun 19 |
nicklas |
179 |
} |
2622 |
02 Sep 14 |
nicklas |
180 |
|
2808 |
15 Oct 14 |
nicklas |
newSeqRuns = []; |
2622 |
02 Sep 14 |
nicklas |
var url = '&resetTemporary=1'; |
2622 |
02 Sep 14 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeSequencingRun.id; |
5479 |
10 Jun 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'='+encodeURIComponent(pipeline.name); |
2622 |
02 Sep 14 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'seqRuns', 1, url); |
2622 |
02 Sep 14 |
nicklas |
186 |
} |
2622 |
02 Sep 14 |
nicklas |
187 |
|
2622 |
02 Sep 14 |
nicklas |
demux.setSeqRunCallback = function(event) |
2622 |
02 Sep 14 |
nicklas |
189 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
var seqRunList = frm.seqRuns; |
2808 |
15 Oct 14 |
nicklas |
192 |
|
2808 |
15 Oct 14 |
nicklas |
var isNew = true; |
2622 |
02 Sep 14 |
nicklas |
for (var i = 0; i < seqRunList.length; i++) |
2622 |
02 Sep 14 |
nicklas |
195 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (seqRunList[i].value == event.detail.id) |
2622 |
02 Sep 14 |
nicklas |
197 |
{ |
2622 |
02 Sep 14 |
nicklas |
seqRunList[i].selected = true; |
2808 |
15 Oct 14 |
nicklas |
isNew = false; |
2808 |
15 Oct 14 |
nicklas |
200 |
} |
2808 |
15 Oct 14 |
nicklas |
201 |
} |
2808 |
15 Oct 14 |
nicklas |
202 |
|
2808 |
15 Oct 14 |
nicklas |
if (isNew) newSeqRuns[newSeqRuns.length] = event.detail.id; |
2808 |
15 Oct 14 |
nicklas |
204 |
|
2808 |
15 Oct 14 |
nicklas |
if (event.detail.remaining == 0) |
2808 |
15 Oct 14 |
nicklas |
206 |
{ |
2808 |
15 Oct 14 |
nicklas |
if (newSeqRuns.length > 0) |
2808 |
15 Oct 14 |
nicklas |
208 |
{ |
2808 |
15 Oct 14 |
nicklas |
// Get more information about the selected sequencing run |
2808 |
15 Oct 14 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
2808 |
15 Oct 14 |
nicklas |
url += '&cmd=GetSequencingRunInfo&ids=' + newSeqRuns.join(','); |
2808 |
15 Oct 14 |
nicklas |
Wizard.asyncJsonRequest(url, demux.seqRunInfoLoaded); |
2808 |
15 Oct 14 |
nicklas |
213 |
} |
2808 |
15 Oct 14 |
nicklas |
else |
2808 |
15 Oct 14 |
nicklas |
215 |
{ |
2628 |
02 Sep 14 |
nicklas |
demux.seqRunsOnChange(); |
2622 |
02 Sep 14 |
nicklas |
217 |
} |
2622 |
02 Sep 14 |
nicklas |
218 |
} |
2622 |
02 Sep 14 |
nicklas |
219 |
} |
2622 |
02 Sep 14 |
nicklas |
220 |
|
2622 |
02 Sep 14 |
nicklas |
demux.seqRunInfoLoaded = function(response) |
2622 |
02 Sep 14 |
nicklas |
222 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2808 |
15 Oct 14 |
nicklas |
var seqRuns = response.sequencingRuns; |
2622 |
02 Sep 14 |
nicklas |
var seqRunList = frm.seqRuns; |
2808 |
15 Oct 14 |
nicklas |
for (var seqNo = 0; seqNo < seqRuns.length; seqNo++) |
2808 |
15 Oct 14 |
nicklas |
227 |
{ |
2808 |
15 Oct 14 |
nicklas |
var seqRun = seqRuns[seqNo]; |
2808 |
15 Oct 14 |
nicklas |
var option = demux.getOptionForSeqRun(seqRun); |
2808 |
15 Oct 14 |
nicklas |
option.selected = true; |
2808 |
15 Oct 14 |
nicklas |
seqRunList[seqRunList.length] = option; |
2808 |
15 Oct 14 |
nicklas |
232 |
} |
2628 |
02 Sep 14 |
nicklas |
demux.seqRunsOnChange(); |
2628 |
02 Sep 14 |
nicklas |
234 |
} |
2628 |
02 Sep 14 |
nicklas |
235 |
|
2628 |
02 Sep 14 |
nicklas |
// Check if all selected sequencing runs have the same pools |
2628 |
02 Sep 14 |
nicklas |
demux.seqRunsOnChange = function() |
2628 |
02 Sep 14 |
nicklas |
238 |
{ |
5479 |
10 Jun 19 |
nicklas |
seqRunsAreValid = false; |
5479 |
10 Jun 19 |
nicklas |
240 |
|
2628 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2628 |
02 Sep 14 |
nicklas |
var numSelected = 0; |
2628 |
02 Sep 14 |
nicklas |
var pools; |
4985 |
28 Sep 18 |
nicklas |
var numDoNotUse = 0; |
5479 |
10 Jun 19 |
nicklas |
var hasPoolMix = false; |
6214 |
15 Apr 21 |
nicklas |
var invalidSelection = null; |
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus('seqRuns'); |
2628 |
02 Sep 14 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
2628 |
02 Sep 14 |
nicklas |
249 |
{ |
2628 |
02 Sep 14 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
2628 |
02 Sep 14 |
nicklas |
251 |
{ |
5479 |
10 Jun 19 |
nicklas |
var sr = frm.seqRuns[seqNo].seqRun; |
5479 |
10 Jun 19 |
nicklas |
if (sr.pipeline && sr.pipeline != pipeline.name) |
5479 |
10 Jun 19 |
nicklas |
254 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.'; |
5479 |
10 Jun 19 |
nicklas |
256 |
} |
6214 |
15 Apr 21 |
nicklas |
else if (!sr.DataFilesFolder) |
6214 |
15 Apr 21 |
nicklas |
258 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(sr.name+' is missing DataFilesFolder information'); |
6214 |
15 Apr 21 |
nicklas |
260 |
} |
5479 |
10 Jun 19 |
nicklas |
261 |
|
5479 |
10 Jun 19 |
nicklas |
numSelected++; |
2628 |
02 Sep 14 |
nicklas |
if (numSelected == 1) |
2628 |
02 Sep 14 |
nicklas |
264 |
{ |
5479 |
10 Jun 19 |
nicklas |
pools = sr.flowCell.pools; |
5479 |
10 Jun 19 |
nicklas |
numDoNotUse = sr.flowCell.numDoNotUse; |
2628 |
02 Sep 14 |
nicklas |
267 |
} |
2628 |
02 Sep 14 |
nicklas |
else |
2628 |
02 Sep 14 |
nicklas |
269 |
{ |
5479 |
10 Jun 19 |
nicklas |
if (!demux.compareListOfPools(pools, sr.flowCell.pools)) |
2628 |
02 Sep 14 |
nicklas |
271 |
{ |
5479 |
10 Jun 19 |
nicklas |
hasPoolMix = true; |
2628 |
02 Sep 14 |
nicklas |
273 |
} |
2628 |
02 Sep 14 |
nicklas |
274 |
} |
2628 |
02 Sep 14 |
nicklas |
275 |
} |
2628 |
02 Sep 14 |
nicklas |
276 |
} |
2628 |
02 Sep 14 |
nicklas |
if (numSelected == 0) |
2628 |
02 Sep 14 |
nicklas |
278 |
{ |
2628 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', 'Select at least one sequencing run'); |
4985 |
28 Sep 18 |
nicklas |
return; |
2628 |
02 Sep 14 |
nicklas |
281 |
} |
6214 |
15 Apr 21 |
nicklas |
if (invalidSelection) |
4985 |
28 Sep 18 |
nicklas |
283 |
{ |
6214 |
15 Apr 21 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', invalidSelection); |
5479 |
10 Jun 19 |
nicklas |
return; |
5479 |
10 Jun 19 |
nicklas |
286 |
} |
5479 |
10 Jun 19 |
nicklas |
287 |
|
5479 |
10 Jun 19 |
nicklas |
seqRunsAreValid = true; |
5479 |
10 Jun 19 |
nicklas |
if (hasPoolMix) |
5479 |
10 Jun 19 |
nicklas |
290 |
{ |
5479 |
10 Jun 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'warning', 'The selected sequencing runs have different pools'); |
5479 |
10 Jun 19 |
nicklas |
292 |
} |
5479 |
10 Jun 19 |
nicklas |
else if (numDoNotUse > 0) |
5479 |
10 Jun 19 |
nicklas |
294 |
{ |
4985 |
28 Sep 18 |
nicklas |
var msg = numDoNotUse == 1 ? '1 library is marked with DoNotUse.' : |
4985 |
28 Sep 18 |
nicklas |
numDoNotUse + ' libraries are marked with DoNotUse.' |
4985 |
28 Sep 18 |
nicklas |
Wizard.setInputStatus('seqRuns', 'warning', msg); |
4985 |
28 Sep 18 |
nicklas |
298 |
} |
2628 |
02 Sep 14 |
nicklas |
else |
2628 |
02 Sep 14 |
nicklas |
300 |
{ |
2628 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus('seqRuns', 'valid'); |
2628 |
02 Sep 14 |
nicklas |
302 |
} |
2622 |
02 Sep 14 |
nicklas |
303 |
} |
2622 |
02 Sep 14 |
nicklas |
304 |
|
2628 |
02 Sep 14 |
nicklas |
// Check if two lists of pools are the same or not |
2628 |
02 Sep 14 |
nicklas |
demux.compareListOfPools = function(p1, p2) |
2628 |
02 Sep 14 |
nicklas |
307 |
{ |
2628 |
02 Sep 14 |
nicklas |
if (p1.length != p2.length) return false; |
2628 |
02 Sep 14 |
nicklas |
for (var i = 0; i < p1.length; i++) |
2628 |
02 Sep 14 |
nicklas |
310 |
{ |
2628 |
02 Sep 14 |
nicklas |
if (p1[i].id != p2[i].id) return false; |
2628 |
02 Sep 14 |
nicklas |
312 |
} |
2628 |
02 Sep 14 |
nicklas |
return true; |
2628 |
02 Sep 14 |
nicklas |
314 |
} |
2628 |
02 Sep 14 |
nicklas |
315 |
|
2622 |
02 Sep 14 |
nicklas |
demux.initializeStep2 = function() |
2622 |
02 Sep 14 |
nicklas |
317 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
319 |
|
2622 |
02 Sep 14 |
nicklas |
// ReadString input fields |
2622 |
02 Sep 14 |
nicklas |
var html = ''; |
6280 |
09 Jun 21 |
nicklas |
var numDoNotUse = 0; |
6280 |
09 Jun 21 |
nicklas |
var uniqueLibs = {}; |
2622 |
02 Sep 14 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
2622 |
02 Sep 14 |
nicklas |
325 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
2622 |
02 Sep 14 |
nicklas |
327 |
{ |
2622 |
02 Sep 14 |
nicklas |
var seqRun = frm.seqRuns[seqNo].seqRun; |
2622 |
02 Sep 14 |
nicklas |
var fc = seqRun.flowCell; |
6280 |
09 Jun 21 |
nicklas |
for (var libNo = 0; libNo < fc.libraries.length; libNo++) |
6280 |
09 Jun 21 |
nicklas |
331 |
{ |
6280 |
09 Jun 21 |
nicklas |
var lib = fc.libraries[libNo]; |
6280 |
09 Jun 21 |
nicklas |
if (!uniqueLibs[lib.name]) |
6280 |
09 Jun 21 |
nicklas |
334 |
{ |
6280 |
09 Jun 21 |
nicklas |
if (lib.DO_NOT_USE) numDoNotUse++; |
6280 |
09 Jun 21 |
nicklas |
allLibs[allLibs.length] = lib; |
6280 |
09 Jun 21 |
nicklas |
uniqueLibs[lib.name] = true; |
6280 |
09 Jun 21 |
nicklas |
338 |
} |
6280 |
09 Jun 21 |
nicklas |
339 |
} |
6280 |
09 Jun 21 |
nicklas |
340 |
|
2622 |
02 Sep 14 |
nicklas |
var readStringId = 'readString.'+seqNo; |
2622 |
02 Sep 14 |
nicklas |
html += '<tr>'; |
2657 |
11 Sep 14 |
nicklas |
html += '<td class="prompt" colspan="2">'+Strings.encodeTags(frm.seqRuns[seqNo].text)+'</td>'; |
2657 |
11 Sep 14 |
nicklas |
html += '<td class="status"></td>'; |
2657 |
11 Sep 14 |
nicklas |
html += '<td class="help"></td>'; |
2657 |
11 Sep 14 |
nicklas |
html += '</tr>'; |
2657 |
11 Sep 14 |
nicklas |
347 |
|
2657 |
11 Sep 14 |
nicklas |
html += '<tr>'; |
2657 |
11 Sep 14 |
nicklas |
html += '<td class="subprompt">Sequencing cycles</td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td>'+Strings.encodeTags(seqRun.SequencingCycles)+'</td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="status"></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="help"></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '</tr>'; |
2622 |
02 Sep 14 |
nicklas |
354 |
|
2622 |
02 Sep 14 |
nicklas |
html += '<tr>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="subprompt">ReadString</td>'; |
5479 |
10 Jun 19 |
nicklas |
html += '<td><input type="text" class="required" name="'+readStringId+'" id="'+readStringId+'" value="'+Strings.encodeTags(seqRun.ReadString)+'" style="width: 15em;"></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="status" id="'+readStringId+'.status"></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="help"><span id="'+readStringId+'.message"></span></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '</tr>'; |
2622 |
02 Sep 14 |
nicklas |
361 |
|
2622 |
02 Sep 14 |
nicklas |
html += '<tr>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="subprompt">Omit lanes</td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td>'; |
2622 |
02 Sep 14 |
nicklas |
for (var laneNo = 1; laneNo <= fc.numLanes; laneNo++) |
2622 |
02 Sep 14 |
nicklas |
366 |
{ |
2622 |
02 Sep 14 |
nicklas |
var checked = fc.FailedLanes.indexOf(laneNo) >= 0 ? 'checked' : ''; |
2622 |
02 Sep 14 |
nicklas |
html += '<label><input type="checkbox" name="omitLanes.'+seqNo+'" value="'+laneNo+'" ' + checked + '>'+laneNo+'</label> '; |
2622 |
02 Sep 14 |
nicklas |
369 |
} |
2622 |
02 Sep 14 |
nicklas |
html += '</td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="status"></td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '<td class="help">By default, failed lanes are omitted</td>'; |
2622 |
02 Sep 14 |
nicklas |
html += '</tr>'; |
2622 |
02 Sep 14 |
nicklas |
374 |
|
2642 |
09 Sep 14 |
nicklas |
html += '<tr>'; |
2642 |
09 Sep 14 |
nicklas |
html += '<td class="subprompt"></td>'; |
3026 |
11 Dec 14 |
nicklas |
html += '<td><div id="check.'+seqNo+'" class="button basicbutton interactable" data-seqrun-id="'+seqRun.id+'"><img src="../images/validate.png" alt="Check data files&hellip;">Check data files…</div></td>'; |
2642 |
09 Sep 14 |
nicklas |
html += '<td class="status"></td>'; |
2642 |
09 Sep 14 |
nicklas |
html += '<td class="help"></td>'; |
2642 |
09 Sep 14 |
nicklas |
html += '</tr>'; |
2622 |
02 Sep 14 |
nicklas |
381 |
} |
2622 |
02 Sep 14 |
nicklas |
382 |
} |
2622 |
02 Sep 14 |
nicklas |
Doc.element('SequencingRun-section').innerHTML = html; |
2622 |
02 Sep 14 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
2622 |
02 Sep 14 |
nicklas |
385 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
2622 |
02 Sep 14 |
nicklas |
387 |
{ |
2622 |
02 Sep 14 |
nicklas |
demux.readStringOnBlur(frm['readString.'+seqNo]); |
2622 |
02 Sep 14 |
nicklas |
Events.addEventHandler('readString.'+seqNo, 'blur', demux.readStringOnBlur); |
2642 |
09 Sep 14 |
nicklas |
Buttons.addClickHandler('check.'+seqNo, demux.checkDataFilesOnClick); |
2622 |
02 Sep 14 |
nicklas |
391 |
} |
2622 |
02 Sep 14 |
nicklas |
392 |
} |
2622 |
02 Sep 14 |
nicklas |
393 |
|
6280 |
09 Jun 21 |
nicklas |
if (numDoNotUse > 0) |
6280 |
09 Jun 21 |
nicklas |
395 |
{ |
6280 |
09 Jun 21 |
nicklas |
Doc.element('numDoNotUseLibs').innerHTML = numDoNotUse == 1 ? '1 library' : numDoNotUse + ' libraries'; |
6280 |
09 Jun 21 |
nicklas |
Doc.show('doNotUseOption'); |
6280 |
09 Jun 21 |
nicklas |
Wizard.setInputStatus('whichLibs', 'warning', 'By default, libraries marked with DoNotUse are omitted.') |
6280 |
09 Jun 21 |
nicklas |
Forms.checkRadio(frm.whichLibs, 'allExceptDoNotUse'); |
6280 |
09 Jun 21 |
nicklas |
400 |
} |
6280 |
09 Jun 21 |
nicklas |
401 |
|
2622 |
02 Sep 14 |
nicklas |
Wizard.setCurrentStep(2); |
2622 |
02 Sep 14 |
nicklas |
Doc.show('gocancel'); |
2622 |
02 Sep 14 |
nicklas |
Doc.show('goregister'); |
2622 |
02 Sep 14 |
nicklas |
405 |
|
2622 |
02 Sep 14 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
2622 |
02 Sep 14 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
2622 |
02 Sep 14 |
nicklas |
408 |
|
6213 |
15 Apr 21 |
nicklas |
Reggie.loadProtocols('DEMUX_PROTOCOL', 'demuxProtocol', 'PIPELINE,DEMUX_TYPE', pipeline.name+',Picard'); |
6213 |
15 Apr 21 |
nicklas |
Reggie.loadSoftware('DEMUX_SOFTWARE', 'demuxSoftware', 'PIPELINE,DEMUX_TYPE,PARAMETER_SET', pipeline.name+',Picard'); |
6213 |
15 Apr 21 |
nicklas |
Reggie.loadProtocols('MERGE_PROTOCOL', 'mergeProtocol', 'PIPELINE,MERGE_TYPE', pipeline.name+',Default'); |
6213 |
15 Apr 21 |
nicklas |
Reggie.loadSoftware('MERGE_SOFTWARE', 'mergeSoftware', 'PIPELINE,MERGE_TYPE,PARAMETER_SET', pipeline.name+',Default'); |
2622 |
02 Sep 14 |
nicklas |
413 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
5613 |
18 Sep 19 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config='+(pipeline.id == 'MIPS' ? 'demux-mips' : 'demux'); |
2622 |
02 Sep 14 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
2622 |
02 Sep 14 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
2622 |
02 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, demux.clustersLoaded); |
2622 |
02 Sep 14 |
nicklas |
419 |
} |
2622 |
02 Sep 14 |
nicklas |
420 |
|
4985 |
28 Sep 18 |
nicklas |
demux.showDoNotUseInfo = function(event) |
4985 |
28 Sep 18 |
nicklas |
422 |
{ |
6280 |
09 Jun 21 |
nicklas |
var libs = allLibs; |
4985 |
28 Sep 18 |
nicklas |
424 |
|
4985 |
28 Sep 18 |
nicklas |
var msg = '<table>'; |
4985 |
28 Sep 18 |
nicklas |
for (var libNo = 0; libNo < libs.length; libNo++) |
4985 |
28 Sep 18 |
nicklas |
427 |
{ |
4985 |
28 Sep 18 |
nicklas |
var lib = libs[libNo]; |
4985 |
28 Sep 18 |
nicklas |
if (lib.DO_NOT_USE) |
4985 |
28 Sep 18 |
nicklas |
430 |
{ |
6280 |
09 Jun 21 |
nicklas |
msg += '<tr><td><b>'+Strings.encodeTags(lib.name) + '</b></td><td><span class="itemsubtype">[' + Strings.encodeTags(lib.DO_NOT_USE) + ']</span></td>'; |
4985 |
28 Sep 18 |
nicklas |
msg += '<td>'+ Strings.encodeTags(lib.DO_NOT_USE_COMMENT) + '</td></tr>'; |
4985 |
28 Sep 18 |
nicklas |
433 |
} |
4985 |
28 Sep 18 |
nicklas |
434 |
} |
4985 |
28 Sep 18 |
nicklas |
msg += '</table>'; |
4985 |
28 Sep 18 |
nicklas |
Forms.showNotification(event.currentTarget, msg, 'donotuseinfo', 'pointer-left'); |
4985 |
28 Sep 18 |
nicklas |
437 |
} |
4985 |
28 Sep 18 |
nicklas |
438 |
|
6280 |
09 Jun 21 |
nicklas |
demux.selectLibsAll = function() |
6280 |
09 Jun 21 |
nicklas |
440 |
{ |
6280 |
09 Jun 21 |
nicklas |
Wizard.setInputStatus('whichLibs', 'valid'); |
6280 |
09 Jun 21 |
nicklas |
442 |
} |
6280 |
09 Jun 21 |
nicklas |
443 |
|
6280 |
09 Jun 21 |
nicklas |
demux.selectLibsAllExceptDoNotUse = function() |
6280 |
09 Jun 21 |
nicklas |
445 |
{ |
6280 |
09 Jun 21 |
nicklas |
Wizard.setInputStatus('whichLibs', 'valid'); |
6280 |
09 Jun 21 |
nicklas |
447 |
} |
6280 |
09 Jun 21 |
nicklas |
448 |
|
6280 |
09 Jun 21 |
nicklas |
demux.selectLibsForDemux = function() |
6280 |
09 Jun 21 |
nicklas |
450 |
{ |
6280 |
09 Jun 21 |
nicklas |
Wizard.setInputStatus('whichLibs'); |
6280 |
09 Jun 21 |
nicklas |
var url = 'select_libs.jsp?ID='+App.getSessionId(); |
6280 |
09 Jun 21 |
nicklas |
Dialogs.openPopup(url, 'SelectLibsForDemux', 800, 600); |
6280 |
09 Jun 21 |
nicklas |
454 |
} |
6280 |
09 Jun 21 |
nicklas |
455 |
|
6280 |
09 Jun 21 |
nicklas |
demux.getAllLibraries = function() |
6280 |
09 Jun 21 |
nicklas |
457 |
{ |
6280 |
09 Jun 21 |
nicklas |
return allLibs; |
6280 |
09 Jun 21 |
nicklas |
459 |
} |
6280 |
09 Jun 21 |
nicklas |
460 |
|
2622 |
02 Sep 14 |
nicklas |
demux.clustersLoaded = function(response) |
2622 |
02 Sep 14 |
nicklas |
462 |
{ |
2622 |
02 Sep 14 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
4306 |
17 Jan 17 |
nicklas |
var clusters = response.hosts; |
2622 |
02 Sep 14 |
nicklas |
frm.clusters.length = 0; |
2622 |
02 Sep 14 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
2622 |
02 Sep 14 |
nicklas |
468 |
{ |
2622 |
02 Sep 14 |
nicklas |
var cl = clusters[i]; |
4306 |
17 Jan 17 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
2622 |
02 Sep 14 |
nicklas |
option.cluster = cl; |
2622 |
02 Sep 14 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
2622 |
02 Sep 14 |
nicklas |
clusterIsValid = true; |
2622 |
02 Sep 14 |
nicklas |
475 |
} |
2622 |
02 Sep 14 |
nicklas |
if (frm.clusters.length == 0) |
2622 |
02 Sep 14 |
nicklas |
477 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
2622 |
02 Sep 14 |
nicklas |
clusterIsValid = false; |
2622 |
02 Sep 14 |
nicklas |
480 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
482 |
{ |
2622 |
02 Sep 14 |
nicklas |
demux.clusterOnChange(); |
2622 |
02 Sep 14 |
nicklas |
484 |
} |
2622 |
02 Sep 14 |
nicklas |
485 |
} |
2622 |
02 Sep 14 |
nicklas |
486 |
|
2642 |
09 Sep 14 |
nicklas |
demux.checkDataFilesOnClick = function(event) |
2642 |
09 Sep 14 |
nicklas |
488 |
{ |
2642 |
09 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2642 |
09 Sep 14 |
nicklas |
var seqNo = parseInt(event.currentTarget.id.substring(6)); |
2642 |
09 Sep 14 |
nicklas |
var url = 'check_data_files.jsp?ID='+App.getSessionId(); |
2642 |
09 Sep 14 |
nicklas |
url += '&seqrun='+Data.get(event.currentTarget, 'seqrun-id'); |
2642 |
09 Sep 14 |
nicklas |
url += '&readString='+encodeURIComponent(frm['readString.'+seqNo].value); |
2910 |
10 Nov 14 |
nicklas |
494 |
|
2910 |
10 Nov 14 |
nicklas |
var omitLanes = []; |
2910 |
10 Nov 14 |
nicklas |
var checkboxes = frm['omitLanes.'+seqNo]; |
2910 |
10 Nov 14 |
nicklas |
for (var i = 0; i < checkboxes.length; i++) |
2910 |
10 Nov 14 |
nicklas |
498 |
{ |
2910 |
10 Nov 14 |
nicklas |
if (checkboxes[i].checked) |
2910 |
10 Nov 14 |
nicklas |
500 |
{ |
2910 |
10 Nov 14 |
nicklas |
omitLanes[omitLanes.length] = parseInt(checkboxes[i].value); |
2910 |
10 Nov 14 |
nicklas |
502 |
} |
2910 |
10 Nov 14 |
nicklas |
503 |
} |
2910 |
10 Nov 14 |
nicklas |
if (omitLanes.length > 0) url += '&omitLanes='+omitLanes.join(','); |
2910 |
10 Nov 14 |
nicklas |
505 |
|
2642 |
09 Sep 14 |
nicklas |
Dialogs.openPopup(url, 'CheckDataFiles', 900, 600); |
2642 |
09 Sep 14 |
nicklas |
507 |
} |
2642 |
09 Sep 14 |
nicklas |
508 |
|
2642 |
09 Sep 14 |
nicklas |
509 |
|
2622 |
02 Sep 14 |
nicklas |
demux.clusterOnChange = function() |
2622 |
02 Sep 14 |
nicklas |
511 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
2622 |
02 Sep 14 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
2622 |
02 Sep 14 |
nicklas |
515 |
{ |
2622 |
02 Sep 14 |
nicklas |
frm.priority.length = 0; |
2622 |
02 Sep 14 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
2622 |
02 Sep 14 |
nicklas |
518 |
{ |
2622 |
02 Sep 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']); |
2622 |
02 Sep 14 |
nicklas |
521 |
} |
2622 |
02 Sep 14 |
nicklas |
Doc.show('job-priority'); |
2622 |
02 Sep 14 |
nicklas |
523 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
525 |
{ |
2622 |
02 Sep 14 |
nicklas |
Doc.hide('job-priority'); |
2622 |
02 Sep 14 |
nicklas |
527 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
529 |
{ |
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 |
532 |
{ |
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 |
537 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
539 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
541 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
543 |
} |
7372 |
06 Oct 23 |
nicklas |
demux.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
545 |
} |
7372 |
06 Oct 23 |
nicklas |
546 |
|
7372 |
06 Oct 23 |
nicklas |
demux.debugOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
548 |
{ |
7372 |
06 Oct 23 |
nicklas |
demux.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
550 |
} |
7372 |
06 Oct 23 |
nicklas |
551 |
|
7372 |
06 Oct 23 |
nicklas |
demux.updateSubmitOptions = function() |
7372 |
06 Oct 23 |
nicklas |
553 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
var config = frm.clusters[frm.clusters.selectedIndex]?.cluster?.config?.demux; |
7372 |
06 Oct 23 |
nicklas |
if (config) |
2960 |
19 Nov 14 |
nicklas |
557 |
{ |
7372 |
06 Oct 23 |
nicklas |
var parameterSet = frm.demuxSoftware[frm.demuxSoftware.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; |
2960 |
19 Nov 14 |
nicklas |
561 |
} |
2622 |
02 Sep 14 |
nicklas |
562 |
} |
7372 |
06 Oct 23 |
nicklas |
563 |
|
7372 |
06 Oct 23 |
nicklas |
demux.overrideOnChange = function() |
2960 |
19 Nov 14 |
nicklas |
565 |
{ |
2960 |
19 Nov 14 |
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=='') |
2960 |
19 Nov 14 |
nicklas |
570 |
{ |
7372 |
06 Oct 23 |
nicklas |
frm.submitOptionsOverride.value = Doc.element('submitOptions').innerHTML; |
2960 |
19 Nov 14 |
nicklas |
572 |
} |
2960 |
19 Nov 14 |
nicklas |
573 |
} |
2960 |
19 Nov 14 |
nicklas |
574 |
|
2622 |
02 Sep 14 |
nicklas |
demux.readStringOnBlur = function(eventOrTarget) |
2622 |
02 Sep 14 |
nicklas |
576 |
{ |
2622 |
02 Sep 14 |
nicklas |
var target = eventOrTarget.currentTarget || eventOrTarget; |
2622 |
02 Sep 14 |
nicklas |
var isValid = false; |
2622 |
02 Sep 14 |
nicklas |
579 |
|
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus(target.id); |
2622 |
02 Sep 14 |
nicklas |
var readString = target.value; |
2622 |
02 Sep 14 |
nicklas |
582 |
|
5532 |
27 Jun 19 |
nicklas |
if (!readString.match(/^(\d+[TBMS])+$/)) |
2622 |
02 Sep 14 |
nicklas |
584 |
{ |
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus(target.id, 'invalid', 'Invalid read string'); |
2622 |
02 Sep 14 |
nicklas |
586 |
} |
2622 |
02 Sep 14 |
nicklas |
else |
2622 |
02 Sep 14 |
nicklas |
588 |
{ |
2622 |
02 Sep 14 |
nicklas |
isValid = true; |
2622 |
02 Sep 14 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
2622 |
02 Sep 14 |
nicklas |
591 |
} |
2622 |
02 Sep 14 |
nicklas |
592 |
|
2622 |
02 Sep 14 |
nicklas |
Data.set(target, 'valid', isValid ? 1 : 0); |
2622 |
02 Sep 14 |
nicklas |
594 |
} |
2622 |
02 Sep 14 |
nicklas |
595 |
|
3128 |
10 Feb 15 |
nicklas |
demux.softwareOnChange = function(event) |
3128 |
10 Feb 15 |
nicklas |
597 |
{ |
3128 |
10 Feb 15 |
nicklas |
var target = event.currentTarget; |
3128 |
10 Feb 15 |
nicklas |
var item = target[target.selectedIndex].item; |
3128 |
10 Feb 15 |
nicklas |
if (!item) item = {}; |
3128 |
10 Feb 15 |
nicklas |
601 |
|
3128 |
10 Feb 15 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
3128 |
10 Feb 15 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
3128 |
10 Feb 15 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
3128 |
10 Feb 15 |
nicklas |
605 |
|
3128 |
10 Feb 15 |
nicklas |
if (item.ParameterSet) |
3128 |
10 Feb 15 |
nicklas |
607 |
{ |
3128 |
10 Feb 15 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
3128 |
10 Feb 15 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
3128 |
10 Feb 15 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
3128 |
10 Feb 15 |
nicklas |
url += '&targetId='+target.id; |
3128 |
10 Feb 15 |
nicklas |
Wizard.asyncJsonRequest(url, demux.parameterSetInfoLoaded); |
3128 |
10 Feb 15 |
nicklas |
613 |
} |
7372 |
06 Oct 23 |
nicklas |
demux.updateSubmitOptions(); |
3128 |
10 Feb 15 |
nicklas |
615 |
} |
3128 |
10 Feb 15 |
nicklas |
616 |
|
3128 |
10 Feb 15 |
nicklas |
demux.parameterSetInfoLoaded = function(response) |
3128 |
10 Feb 15 |
nicklas |
618 |
{ |
3128 |
10 Feb 15 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
3128 |
10 Feb 15 |
nicklas |
620 |
{ |
3128 |
10 Feb 15 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
3128 |
10 Feb 15 |
nicklas |
622 |
} |
3128 |
10 Feb 15 |
nicklas |
623 |
} |
3128 |
10 Feb 15 |
nicklas |
624 |
|
3128 |
10 Feb 15 |
nicklas |
625 |
|
2622 |
02 Sep 14 |
nicklas |
demux.validateStep2 = function(event) |
2622 |
02 Sep 14 |
nicklas |
627 |
{ |
6280 |
09 Jun 21 |
nicklas |
var frm = document.forms['reggie']; |
6280 |
09 Jun 21 |
nicklas |
if (frm.whichLibs.value == 'selected') |
6280 |
09 Jun 21 |
nicklas |
630 |
{ |
6280 |
09 Jun 21 |
nicklas |
var numSelected = 0; |
6280 |
09 Jun 21 |
nicklas |
for (var libNo = 0; libNo < allLibs.length; libNo++) |
6280 |
09 Jun 21 |
nicklas |
633 |
{ |
6280 |
09 Jun 21 |
nicklas |
if (allLibs[libNo].selected) numSelected++; |
6280 |
09 Jun 21 |
nicklas |
635 |
} |
6280 |
09 Jun 21 |
nicklas |
if (numSelected == 0) |
6280 |
09 Jun 21 |
nicklas |
637 |
{ |
6280 |
09 Jun 21 |
nicklas |
Wizard.setInputStatus('whichLibs', 'invalid', 'Please select at least one library'); |
6280 |
09 Jun 21 |
nicklas |
event.preventDefault(); |
6280 |
09 Jun 21 |
nicklas |
return; |
6280 |
09 Jun 21 |
nicklas |
641 |
} |
6280 |
09 Jun 21 |
nicklas |
642 |
} |
2622 |
02 Sep 14 |
nicklas |
643 |
|
7372 |
06 Oct 23 |
nicklas |
if (!clusterIsValid) |
2622 |
02 Sep 14 |
nicklas |
645 |
{ |
2622 |
02 Sep 14 |
nicklas |
event.preventDefault(); |
2622 |
02 Sep 14 |
nicklas |
return; |
2622 |
02 Sep 14 |
nicklas |
648 |
} |
2622 |
02 Sep 14 |
nicklas |
649 |
|
2622 |
02 Sep 14 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
2622 |
02 Sep 14 |
nicklas |
651 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
2622 |
02 Sep 14 |
nicklas |
653 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (!Wizard.isValid(frm['readString.'+seqNo])) |
2622 |
02 Sep 14 |
nicklas |
655 |
{ |
2622 |
02 Sep 14 |
nicklas |
event.preventDefault(); |
2622 |
02 Sep 14 |
nicklas |
return; |
2622 |
02 Sep 14 |
nicklas |
658 |
} |
2622 |
02 Sep 14 |
nicklas |
659 |
} |
2622 |
02 Sep 14 |
nicklas |
660 |
} |
2622 |
02 Sep 14 |
nicklas |
661 |
} |
2622 |
02 Sep 14 |
nicklas |
662 |
|
2622 |
02 Sep 14 |
nicklas |
demux.submit = function() |
2622 |
02 Sep 14 |
nicklas |
664 |
{ |
2622 |
02 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2622 |
02 Sep 14 |
nicklas |
var submitInfo = {}; |
2622 |
02 Sep 14 |
nicklas |
submitInfo.demuxSoftware = parseInt(frm.demuxSoftware.value); |
2622 |
02 Sep 14 |
nicklas |
submitInfo.demuxProtocol = parseInt(frm.demuxProtocol.value); |
2622 |
02 Sep 14 |
nicklas |
submitInfo.mergeSoftware = parseInt(frm.mergeSoftware.value); |
2622 |
02 Sep 14 |
nicklas |
submitInfo.mergeProtocol = parseInt(frm.mergeProtocol.value); |
2622 |
02 Sep 14 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
2622 |
02 Sep 14 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
2622 |
02 Sep 14 |
nicklas |
673 |
{ |
2622 |
02 Sep 14 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
2622 |
02 Sep 14 |
nicklas |
675 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
677 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
679 |
} |
7372 |
06 Oct 23 |
nicklas |
if (frm.override.checked) |
7372 |
06 Oct 23 |
nicklas |
681 |
{ |
7372 |
06 Oct 23 |
nicklas |
submitInfo.submitOptionsOverride = frm.submitOptionsOverride.value; |
7372 |
06 Oct 23 |
nicklas |
683 |
} |
2622 |
02 Sep 14 |
nicklas |
submitInfo.debug = frm.debug.checked; |
3029 |
11 Dec 14 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
6280 |
09 Jun 21 |
nicklas |
submitInfo.whichLibs = frm.whichLibs.value; |
6280 |
09 Jun 21 |
nicklas |
if (frm.whichLibs.value == 'selected') |
6280 |
09 Jun 21 |
nicklas |
688 |
{ |
6280 |
09 Jun 21 |
nicklas |
var ignoreLibs = []; |
6280 |
09 Jun 21 |
nicklas |
for (var libNo = 0; libNo < allLibs.length; libNo++) |
6280 |
09 Jun 21 |
nicklas |
691 |
{ |
6280 |
09 Jun 21 |
nicklas |
var lib = allLibs[libNo]; |
6280 |
09 Jun 21 |
nicklas |
if (!lib.selected) ignoreLibs[ignoreLibs.length] = lib.id; |
6280 |
09 Jun 21 |
nicklas |
694 |
} |
6280 |
09 Jun 21 |
nicklas |
submitInfo.ignoreLibs = ignoreLibs; |
6280 |
09 Jun 21 |
nicklas |
696 |
} |
2622 |
02 Sep 14 |
nicklas |
697 |
|
2622 |
02 Sep 14 |
nicklas |
var sequencingRuns = []; |
2622 |
02 Sep 14 |
nicklas |
submitInfo.sequencingRuns = sequencingRuns; |
2622 |
02 Sep 14 |
nicklas |
700 |
|
2622 |
02 Sep 14 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
2622 |
02 Sep 14 |
nicklas |
702 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
2622 |
02 Sep 14 |
nicklas |
704 |
{ |
2622 |
02 Sep 14 |
nicklas |
var seqRun = {}; |
2622 |
02 Sep 14 |
nicklas |
seqRun.id = frm.seqRuns[seqNo].seqRun.id; |
2622 |
02 Sep 14 |
nicklas |
seqRun.ReadString = frm['readString.'+seqNo].value; |
2622 |
02 Sep 14 |
nicklas |
708 |
|
2622 |
02 Sep 14 |
nicklas |
var omitLanes = []; |
2622 |
02 Sep 14 |
nicklas |
var checkboxes = frm['omitLanes.'+seqNo]; |
2622 |
02 Sep 14 |
nicklas |
for (var i = 0; i < checkboxes.length; i++) |
2622 |
02 Sep 14 |
nicklas |
712 |
{ |
2622 |
02 Sep 14 |
nicklas |
if (checkboxes[i].checked) |
2622 |
02 Sep 14 |
nicklas |
714 |
{ |
2622 |
02 Sep 14 |
nicklas |
omitLanes[omitLanes.length] = parseInt(checkboxes[i].value); |
2622 |
02 Sep 14 |
nicklas |
716 |
} |
2622 |
02 Sep 14 |
nicklas |
717 |
} |
2622 |
02 Sep 14 |
nicklas |
seqRun.OmitLanes = omitLanes; |
2622 |
02 Sep 14 |
nicklas |
sequencingRuns[sequencingRuns.length] = seqRun; |
2622 |
02 Sep 14 |
nicklas |
720 |
} |
2622 |
02 Sep 14 |
nicklas |
721 |
} |
2622 |
02 Sep 14 |
nicklas |
722 |
|
2622 |
02 Sep 14 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
6280 |
09 Jun 21 |
nicklas |
url += '&cmd=StartDemuxAndMerge&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
2622 |
02 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
2622 |
02 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, demux.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2622 |
02 Sep 14 |
nicklas |
727 |
} |
2622 |
02 Sep 14 |
nicklas |
728 |
|
2622 |
02 Sep 14 |
nicklas |
demux.submissionResults = function(response) |
2622 |
02 Sep 14 |
nicklas |
730 |
{ |
2622 |
02 Sep 14 |
nicklas |
Wizard.showFinalMessage(response.messages); |
2622 |
02 Sep 14 |
nicklas |
Doc.show('gorestart'); |
2622 |
02 Sep 14 |
nicklas |
733 |
} |
2622 |
02 Sep 14 |
nicklas |
734 |
|
2622 |
02 Sep 14 |
nicklas |
return demux; |
2622 |
02 Sep 14 |
nicklas |
736 |
}(); |
2622 |
02 Sep 14 |
nicklas |
737 |
|
2622 |
02 Sep 14 |
nicklas |
Doc.onLoad(Demux.initPage); |
2622 |
02 Sep 14 |
nicklas |
739 |
|