5801 |
19 Dec 19 |
nicklas |
var Demux = function() |
5801 |
19 Dec 19 |
nicklas |
2 |
{ |
5801 |
19 Dec 19 |
nicklas |
var demux = {}; |
5801 |
19 Dec 19 |
nicklas |
var debug = 0; |
5801 |
19 Dec 19 |
nicklas |
5 |
|
5801 |
19 Dec 19 |
nicklas |
var pipeline = null; |
5801 |
19 Dec 19 |
nicklas |
var subtypeSequencingRun = null; |
5801 |
19 Dec 19 |
nicklas |
var annotationTypePipeline = null; |
5801 |
19 Dec 19 |
nicklas |
var seqRunsAreValid = false; |
5801 |
19 Dec 19 |
nicklas |
var clusterIsValid = false; |
5801 |
19 Dec 19 |
nicklas |
var newSeqRuns; |
5801 |
19 Dec 19 |
nicklas |
12 |
|
5801 |
19 Dec 19 |
nicklas |
// Page initialization |
5801 |
19 Dec 19 |
nicklas |
demux.initPage = function() |
5801 |
19 Dec 19 |
nicklas |
15 |
{ |
5801 |
19 Dec 19 |
nicklas |
16 |
|
5801 |
19 Dec 19 |
nicklas |
// Step 1 |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('btnSelectSeqRuns', demux.selectSeqencingRuns); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('seqRuns', 'base-selected', demux.setSeqRunCallback); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('seqRuns', 'change', demux.seqRunsOnChange); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', demux.validateStep1); |
5801 |
19 Dec 19 |
nicklas |
22 |
|
5801 |
19 Dec 19 |
nicklas |
// Step 2 |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', demux.initializeStep2); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', demux.validateStep2); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('clusters', 'change', demux.clusterOnChange); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('demuxSoftware', 'change', demux.softwareOnChange); |
5801 |
19 Dec 19 |
nicklas |
28 |
|
5801 |
19 Dec 19 |
nicklas |
// Navigation |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
5801 |
19 Dec 19 |
nicklas |
34 |
|
5801 |
19 Dec 19 |
nicklas |
// Final registration |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', demux.submit); |
5801 |
19 Dec 19 |
nicklas |
37 |
|
5801 |
19 Dec 19 |
nicklas |
38 |
|
5801 |
19 Dec 19 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
5801 |
19 Dec 19 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
5801 |
19 Dec 19 |
nicklas |
url += '&cmd=GetConfirmedSequencingRuns&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
5801 |
19 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, demux.initializeStep1); |
5801 |
19 Dec 19 |
nicklas |
43 |
} |
5801 |
19 Dec 19 |
nicklas |
44 |
|
5801 |
19 Dec 19 |
nicklas |
// --- Step 1 ----------------------------------- |
5801 |
19 Dec 19 |
nicklas |
demux.initializeStep1 = function(response) |
5801 |
19 Dec 19 |
nicklas |
47 |
{ |
5801 |
19 Dec 19 |
nicklas |
pipeline = response.pipeline; // We need the 'name' value here to be able to filter in "Select manually" |
5801 |
19 Dec 19 |
nicklas |
var seqRuns = response.sequencingRuns; |
5801 |
19 Dec 19 |
nicklas |
seqRuns.sort(demux.sortByPool); |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
52 |
|
5801 |
19 Dec 19 |
nicklas |
if (seqRuns.length > 0) |
5801 |
19 Dec 19 |
nicklas |
54 |
{ |
5801 |
19 Dec 19 |
nicklas |
for (var runNo=0; runNo < seqRuns.length; runNo++) |
5801 |
19 Dec 19 |
nicklas |
56 |
{ |
5801 |
19 Dec 19 |
nicklas |
var seqRun = seqRuns[runNo]; |
5801 |
19 Dec 19 |
nicklas |
var option = demux.getOptionForSeqRun(seqRun); |
5801 |
19 Dec 19 |
nicklas |
frm.seqRuns.options[frm.seqRuns.length] = option; |
5801 |
19 Dec 19 |
nicklas |
60 |
} |
5801 |
19 Dec 19 |
nicklas |
demux.seqRunsOnChange(); |
5801 |
19 Dec 19 |
nicklas |
62 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
64 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', 'No new sequencing runs available for processing'); |
5801 |
19 Dec 19 |
nicklas |
66 |
} |
5801 |
19 Dec 19 |
nicklas |
67 |
|
5801 |
19 Dec 19 |
nicklas |
Doc.show('step-1'); |
5801 |
19 Dec 19 |
nicklas |
Doc.show('gonext'); |
5801 |
19 Dec 19 |
nicklas |
70 |
|
5801 |
19 Dec 19 |
nicklas |
frm.seqRuns.focus(); |
5801 |
19 Dec 19 |
nicklas |
72 |
} |
5801 |
19 Dec 19 |
nicklas |
73 |
|
5801 |
19 Dec 19 |
nicklas |
demux.validateStep1 = function(event) |
5801 |
19 Dec 19 |
nicklas |
75 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (!seqRunsAreValid) event.preventDefault(); |
5801 |
19 Dec 19 |
nicklas |
77 |
} |
5801 |
19 Dec 19 |
nicklas |
78 |
|
5801 |
19 Dec 19 |
nicklas |
79 |
/** |
5801 |
19 Dec 19 |
nicklas |
Sort by the name of the first pool. |
5801 |
19 Dec 19 |
nicklas |
81 |
*/ |
5801 |
19 Dec 19 |
nicklas |
demux.sortByPool = function(a, b) |
5801 |
19 Dec 19 |
nicklas |
83 |
{ |
5801 |
19 Dec 19 |
nicklas |
var p1 = a.flowCell.pools[0].name; |
5801 |
19 Dec 19 |
nicklas |
var p2 = b.flowCell.pools[0].name; |
5801 |
19 Dec 19 |
nicklas |
if (p1 < p2) return -1; |
5801 |
19 Dec 19 |
nicklas |
if (p1 > p2) return 1; |
5801 |
19 Dec 19 |
nicklas |
if (a.name < b.name) return -1; |
5801 |
19 Dec 19 |
nicklas |
if (a.name > b.name) return 1; |
5801 |
19 Dec 19 |
nicklas |
return a.id - b.id; |
5801 |
19 Dec 19 |
nicklas |
91 |
} |
5801 |
19 Dec 19 |
nicklas |
92 |
|
5801 |
19 Dec 19 |
nicklas |
demux.getOptionForSeqRun = function(seqRun) |
5801 |
19 Dec 19 |
nicklas |
94 |
{ |
5801 |
19 Dec 19 |
nicklas |
var flowCell = seqRun.flowCell; |
5801 |
19 Dec 19 |
nicklas |
var name = seqRun.name+': '; |
5801 |
19 Dec 19 |
nicklas |
var numPools = flowCell.pools.length; |
5801 |
19 Dec 19 |
nicklas |
var firstPoolNum = demux.getPoolNum(flowCell.pools[0].name); |
5801 |
19 Dec 19 |
nicklas |
var lastPoolNum = demux.getPoolNum(flowCell.pools[flowCell.pools.length-1].name); |
5801 |
19 Dec 19 |
nicklas |
100 |
|
5801 |
19 Dec 19 |
nicklas |
if (lastPoolNum - firstPoolNum == numPools - 1) |
5801 |
19 Dec 19 |
nicklas |
102 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (numPools > 1) |
5801 |
19 Dec 19 |
nicklas |
104 |
{ |
5801 |
19 Dec 19 |
nicklas |
// Display: PoolN -- PoolY |
5801 |
19 Dec 19 |
nicklas |
name += flowCell.pools[0].name + ' — ' + flowCell.pools[flowCell.pools.length-1].name; |
5801 |
19 Dec 19 |
nicklas |
107 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
109 |
{ |
5801 |
19 Dec 19 |
nicklas |
name += flowCell.pools[0].name; |
5801 |
19 Dec 19 |
nicklas |
111 |
} |
5801 |
19 Dec 19 |
nicklas |
112 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
114 |
{ |
5801 |
19 Dec 19 |
nicklas |
// Display: PoolN + x more... |
5801 |
19 Dec 19 |
nicklas |
name += flowCell.pools[0].name + ' + ' + (numPools-1) + ' more...'; |
5801 |
19 Dec 19 |
nicklas |
117 |
} |
5801 |
19 Dec 19 |
nicklas |
118 |
|
5801 |
19 Dec 19 |
nicklas |
var opt = []; |
5801 |
19 Dec 19 |
nicklas |
opt[opt.length] = flowCell.libraries.length + ' libraries'; |
5801 |
19 Dec 19 |
nicklas |
if (flowCell.FlowCellType) opt[opt.length] = flowCell.FlowCellType; |
5801 |
19 Dec 19 |
nicklas |
opt[opt.length] = seqRun.pipeline; |
5801 |
19 Dec 19 |
nicklas |
name += ' [' + opt.join('; ') + ']'; |
5801 |
19 Dec 19 |
nicklas |
124 |
|
5801 |
19 Dec 19 |
nicklas |
if (seqRun.AutoProcess == 'ReProcess') |
5801 |
19 Dec 19 |
nicklas |
126 |
{ |
5801 |
19 Dec 19 |
nicklas |
name += ' [R]'; |
5801 |
19 Dec 19 |
nicklas |
128 |
} |
5801 |
19 Dec 19 |
nicklas |
129 |
|
5801 |
19 Dec 19 |
nicklas |
// Count the number of libraries marked with DoNotUse |
5801 |
19 Dec 19 |
nicklas |
var numDoNotUse = 0; |
5801 |
19 Dec 19 |
nicklas |
for (var libNo = 0; libNo < flowCell.libraries.length; libNo++) |
5801 |
19 Dec 19 |
nicklas |
133 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (flowCell.libraries[libNo].DO_NOT_USE) numDoNotUse++; |
5801 |
19 Dec 19 |
nicklas |
135 |
} |
5801 |
19 Dec 19 |
nicklas |
flowCell.numDoNotUse = numDoNotUse; |
5801 |
19 Dec 19 |
nicklas |
137 |
|
5801 |
19 Dec 19 |
nicklas |
// Tooltip is always all pools |
5801 |
19 Dec 19 |
nicklas |
var title = ''; |
5801 |
19 Dec 19 |
nicklas |
for (var poolNo=0; poolNo < numPools; poolNo++) |
5801 |
19 Dec 19 |
nicklas |
141 |
{ |
5801 |
19 Dec 19 |
nicklas |
var pool = flowCell.pools[poolNo]; |
5801 |
19 Dec 19 |
nicklas |
if (poolNo > 0) title += ', '; |
5801 |
19 Dec 19 |
nicklas |
title += pool.name; |
5801 |
19 Dec 19 |
nicklas |
145 |
} |
5801 |
19 Dec 19 |
nicklas |
146 |
|
5801 |
19 Dec 19 |
nicklas |
var option = new Option(name, seqRun.id); |
5801 |
19 Dec 19 |
nicklas |
option.title = title; |
5801 |
19 Dec 19 |
nicklas |
option.seqRun = seqRun; |
5801 |
19 Dec 19 |
nicklas |
return option; |
5801 |
19 Dec 19 |
nicklas |
151 |
} |
5801 |
19 Dec 19 |
nicklas |
152 |
|
5801 |
19 Dec 19 |
nicklas |
demux.getPoolNum = function(poolName) |
5801 |
19 Dec 19 |
nicklas |
154 |
{ |
5801 |
19 Dec 19 |
nicklas |
var num = poolName.match(/Pool(\d+)/); |
5801 |
19 Dec 19 |
nicklas |
return num ? parseInt(num[1], 10) : null; |
5801 |
19 Dec 19 |
nicklas |
157 |
} |
5801 |
19 Dec 19 |
nicklas |
158 |
|
5801 |
19 Dec 19 |
nicklas |
demux.selectSeqencingRuns = function() |
5801 |
19 Dec 19 |
nicklas |
160 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns.disabled) return; |
5801 |
19 Dec 19 |
nicklas |
163 |
|
5801 |
19 Dec 19 |
nicklas |
if (subtypeSequencingRun == null) |
5801 |
19 Dec 19 |
nicklas |
165 |
{ |
5801 |
19 Dec 19 |
nicklas |
subtypeSequencingRun = Reggie.getSubtypeInfo('SEQUENCING_RUN'); |
5801 |
19 Dec 19 |
nicklas |
167 |
} |
5801 |
19 Dec 19 |
nicklas |
if (annotationTypePipeline == null) |
5801 |
19 Dec 19 |
nicklas |
169 |
{ |
5801 |
19 Dec 19 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5801 |
19 Dec 19 |
nicklas |
171 |
} |
5801 |
19 Dec 19 |
nicklas |
172 |
|
5801 |
19 Dec 19 |
nicklas |
newSeqRuns = []; |
5801 |
19 Dec 19 |
nicklas |
var url = '&resetTemporary=1'; |
5801 |
19 Dec 19 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeSequencingRun.id; |
5801 |
19 Dec 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'='+encodeURIComponent(pipeline.name); |
5801 |
19 Dec 19 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'seqRuns', 1, url); |
5801 |
19 Dec 19 |
nicklas |
178 |
} |
5801 |
19 Dec 19 |
nicklas |
179 |
|
5801 |
19 Dec 19 |
nicklas |
demux.setSeqRunCallback = function(event) |
5801 |
19 Dec 19 |
nicklas |
181 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var seqRunList = frm.seqRuns; |
5801 |
19 Dec 19 |
nicklas |
184 |
|
5801 |
19 Dec 19 |
nicklas |
var isNew = true; |
5801 |
19 Dec 19 |
nicklas |
for (var i = 0; i < seqRunList.length; i++) |
5801 |
19 Dec 19 |
nicklas |
187 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (seqRunList[i].value == event.detail.id) |
5801 |
19 Dec 19 |
nicklas |
189 |
{ |
5801 |
19 Dec 19 |
nicklas |
seqRunList[i].selected = true; |
5801 |
19 Dec 19 |
nicklas |
isNew = false; |
5801 |
19 Dec 19 |
nicklas |
192 |
} |
5801 |
19 Dec 19 |
nicklas |
193 |
} |
5801 |
19 Dec 19 |
nicklas |
194 |
|
5801 |
19 Dec 19 |
nicklas |
if (isNew) newSeqRuns[newSeqRuns.length] = event.detail.id; |
5801 |
19 Dec 19 |
nicklas |
196 |
|
5801 |
19 Dec 19 |
nicklas |
if (event.detail.remaining == 0) |
5801 |
19 Dec 19 |
nicklas |
198 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (newSeqRuns.length > 0) |
5801 |
19 Dec 19 |
nicklas |
200 |
{ |
5801 |
19 Dec 19 |
nicklas |
// Get more information about the selected sequencing run |
5801 |
19 Dec 19 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
5801 |
19 Dec 19 |
nicklas |
url += '&cmd=GetSequencingRunInfo&ids=' + newSeqRuns.join(','); |
5801 |
19 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, demux.seqRunInfoLoaded); |
5801 |
19 Dec 19 |
nicklas |
205 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
207 |
{ |
5801 |
19 Dec 19 |
nicklas |
demux.seqRunsOnChange(); |
5801 |
19 Dec 19 |
nicklas |
209 |
} |
5801 |
19 Dec 19 |
nicklas |
210 |
} |
5801 |
19 Dec 19 |
nicklas |
211 |
} |
5801 |
19 Dec 19 |
nicklas |
212 |
|
5801 |
19 Dec 19 |
nicklas |
demux.seqRunInfoLoaded = function(response) |
5801 |
19 Dec 19 |
nicklas |
214 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var seqRuns = response.sequencingRuns; |
5801 |
19 Dec 19 |
nicklas |
var seqRunList = frm.seqRuns; |
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
219 |
{ |
5801 |
19 Dec 19 |
nicklas |
var seqRun = seqRuns[seqNo]; |
5801 |
19 Dec 19 |
nicklas |
var option = demux.getOptionForSeqRun(seqRun); |
5801 |
19 Dec 19 |
nicklas |
option.selected = true; |
5801 |
19 Dec 19 |
nicklas |
seqRunList[seqRunList.length] = option; |
5801 |
19 Dec 19 |
nicklas |
224 |
} |
5801 |
19 Dec 19 |
nicklas |
demux.seqRunsOnChange(); |
5801 |
19 Dec 19 |
nicklas |
226 |
} |
5801 |
19 Dec 19 |
nicklas |
227 |
|
5801 |
19 Dec 19 |
nicklas |
// Check if all selected sequencing runs have the same pools |
5801 |
19 Dec 19 |
nicklas |
demux.seqRunsOnChange = function() |
5801 |
19 Dec 19 |
nicklas |
230 |
{ |
5801 |
19 Dec 19 |
nicklas |
seqRunsAreValid = false; |
5801 |
19 Dec 19 |
nicklas |
232 |
|
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var numSelected = 0; |
5801 |
19 Dec 19 |
nicklas |
var pools; |
5801 |
19 Dec 19 |
nicklas |
var numDoNotUse = 0; |
5801 |
19 Dec 19 |
nicklas |
var hasPoolMix = false; |
6214 |
15 Apr 21 |
nicklas |
var invalidSelection = null; |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns'); |
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
241 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
5801 |
19 Dec 19 |
nicklas |
243 |
{ |
5801 |
19 Dec 19 |
nicklas |
var sr = frm.seqRuns[seqNo].seqRun; |
5801 |
19 Dec 19 |
nicklas |
if (sr.pipeline && sr.pipeline != pipeline.name) |
5801 |
19 Dec 19 |
nicklas |
246 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.'; |
5801 |
19 Dec 19 |
nicklas |
248 |
} |
6214 |
15 Apr 21 |
nicklas |
else if (!sr.DataFilesFolder) |
6214 |
15 Apr 21 |
nicklas |
250 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(sr.name+' is missing DataFilesFolder information'); |
6214 |
15 Apr 21 |
nicklas |
252 |
} |
5801 |
19 Dec 19 |
nicklas |
253 |
|
5801 |
19 Dec 19 |
nicklas |
numSelected++; |
5801 |
19 Dec 19 |
nicklas |
if (numSelected == 1) |
5801 |
19 Dec 19 |
nicklas |
256 |
{ |
5801 |
19 Dec 19 |
nicklas |
pools = sr.flowCell.pools; |
5801 |
19 Dec 19 |
nicklas |
numDoNotUse = sr.flowCell.numDoNotUse; |
5801 |
19 Dec 19 |
nicklas |
259 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
261 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (!demux.compareListOfPools(pools, sr.flowCell.pools)) |
5801 |
19 Dec 19 |
nicklas |
263 |
{ |
5801 |
19 Dec 19 |
nicklas |
hasPoolMix = true; |
5801 |
19 Dec 19 |
nicklas |
265 |
} |
5801 |
19 Dec 19 |
nicklas |
266 |
} |
5801 |
19 Dec 19 |
nicklas |
267 |
} |
5801 |
19 Dec 19 |
nicklas |
268 |
} |
5801 |
19 Dec 19 |
nicklas |
if (numSelected == 0) |
5801 |
19 Dec 19 |
nicklas |
270 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', 'Select at least one sequencing run'); |
5801 |
19 Dec 19 |
nicklas |
return; |
5801 |
19 Dec 19 |
nicklas |
273 |
} |
6214 |
15 Apr 21 |
nicklas |
if (invalidSelection) |
5801 |
19 Dec 19 |
nicklas |
275 |
{ |
6214 |
15 Apr 21 |
nicklas |
Wizard.setInputStatus('seqRuns', 'invalid', invalidSelection); |
5801 |
19 Dec 19 |
nicklas |
return; |
5801 |
19 Dec 19 |
nicklas |
278 |
} |
5801 |
19 Dec 19 |
nicklas |
279 |
|
5801 |
19 Dec 19 |
nicklas |
seqRunsAreValid = true; |
5801 |
19 Dec 19 |
nicklas |
if (hasPoolMix) |
5801 |
19 Dec 19 |
nicklas |
282 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'warning', 'The selected sequencing runs have different pools'); |
5801 |
19 Dec 19 |
nicklas |
284 |
} |
5801 |
19 Dec 19 |
nicklas |
else if (numDoNotUse > 0) |
5801 |
19 Dec 19 |
nicklas |
286 |
{ |
5801 |
19 Dec 19 |
nicklas |
var msg = numDoNotUse == 1 ? '1 library is marked with DoNotUse.' : |
5801 |
19 Dec 19 |
nicklas |
numDoNotUse + ' libraries are marked with DoNotUse.' |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'warning', msg); |
5801 |
19 Dec 19 |
nicklas |
290 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
292 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('seqRuns', 'valid'); |
5801 |
19 Dec 19 |
nicklas |
294 |
} |
5801 |
19 Dec 19 |
nicklas |
295 |
} |
5801 |
19 Dec 19 |
nicklas |
296 |
|
5801 |
19 Dec 19 |
nicklas |
// Check if two lists of pools are the same or not |
5801 |
19 Dec 19 |
nicklas |
demux.compareListOfPools = function(p1, p2) |
5801 |
19 Dec 19 |
nicklas |
299 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (p1.length != p2.length) return false; |
5801 |
19 Dec 19 |
nicklas |
for (var i = 0; i < p1.length; i++) |
5801 |
19 Dec 19 |
nicklas |
302 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (p1[i].id != p2[i].id) return false; |
5801 |
19 Dec 19 |
nicklas |
304 |
} |
5801 |
19 Dec 19 |
nicklas |
return true; |
5801 |
19 Dec 19 |
nicklas |
306 |
} |
5801 |
19 Dec 19 |
nicklas |
307 |
|
5801 |
19 Dec 19 |
nicklas |
demux.initializeStep2 = function() |
5801 |
19 Dec 19 |
nicklas |
309 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
311 |
|
5801 |
19 Dec 19 |
nicklas |
// ReadString input fields |
5801 |
19 Dec 19 |
nicklas |
var html = ''; |
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
315 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
5801 |
19 Dec 19 |
nicklas |
317 |
{ |
5801 |
19 Dec 19 |
nicklas |
var seqRun = frm.seqRuns[seqNo].seqRun; |
5801 |
19 Dec 19 |
nicklas |
var fc = seqRun.flowCell; |
5801 |
19 Dec 19 |
nicklas |
var libs = fc.libraries; |
5801 |
19 Dec 19 |
nicklas |
var readStringId = 'readString.'+seqNo; |
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="prompt" colspan="2">'+Strings.encodeTags(frm.seqRuns[seqNo].text)+'</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
327 |
|
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="subprompt">Sequencing cycles</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td>'+Strings.encodeTags(seqRun.SequencingCycles)+'</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
334 |
|
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="subprompt">ReadString</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td><input type="text" class="required" name="'+readStringId+'" id="'+readStringId+'" value="'+Strings.encodeTags(seqRun.ReadString)+'" style="width: 15em;"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status" id="'+readStringId+'.status"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help"><span id="'+readStringId+'.message"></span></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
341 |
|
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="subprompt">Omit lanes</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td>'; |
5801 |
19 Dec 19 |
nicklas |
for (var laneNo = 1; laneNo <= fc.numLanes; laneNo++) |
5801 |
19 Dec 19 |
nicklas |
346 |
{ |
5801 |
19 Dec 19 |
nicklas |
var checked = fc.FailedLanes.indexOf(laneNo) >= 0 ? 'checked' : ''; |
5801 |
19 Dec 19 |
nicklas |
html += '<label><input type="checkbox" name="omitLanes.'+seqNo+'" value="'+laneNo+'" ' + checked + '>'+laneNo+'</label> '; |
5801 |
19 Dec 19 |
nicklas |
349 |
} |
5801 |
19 Dec 19 |
nicklas |
html += '</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help">By default, failed lanes are omitted</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
354 |
|
5801 |
19 Dec 19 |
nicklas |
// Check for DoNotUse |
5801 |
19 Dec 19 |
nicklas |
if (fc.numDoNotUse > 0) |
5801 |
19 Dec 19 |
nicklas |
357 |
{ |
5801 |
19 Dec 19 |
nicklas |
var text = fc.numDoNotUse == 1 ? '1 library' : fc.numDoNotUse + ' libraries'; |
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="subprompt">DoNotUse</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td><label><input type="checkbox" name="excludeDoNotUse.'+seqNo+'" checked>Exclude ' + text + ' marked with DoNotUse</label>'; |
5801 |
19 Dec 19 |
nicklas |
html += ' <img src="../images/info.png" class="link" id="donotuseinfo.'+seqNo+'" data-seq-no="'+seqNo+'" title="More information about the libraries..."></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status warning"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help">By default, libraries marked with DoNotUse are omitted</td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
366 |
} |
5801 |
19 Dec 19 |
nicklas |
367 |
|
5801 |
19 Dec 19 |
nicklas |
html += '<tr>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="subprompt"></td>'; |
5801 |
19 Dec 19 |
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>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="status"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '<td class="help"></td>'; |
5801 |
19 Dec 19 |
nicklas |
html += '</tr>'; |
5801 |
19 Dec 19 |
nicklas |
374 |
|
5801 |
19 Dec 19 |
nicklas |
375 |
} |
5801 |
19 Dec 19 |
nicklas |
376 |
} |
5801 |
19 Dec 19 |
nicklas |
Doc.element('SequencingRun-section').innerHTML = html; |
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
379 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
5801 |
19 Dec 19 |
nicklas |
381 |
{ |
5801 |
19 Dec 19 |
nicklas |
demux.readStringOnBlur(frm['readString.'+seqNo]); |
5801 |
19 Dec 19 |
nicklas |
Events.addEventHandler('readString.'+seqNo, 'blur', demux.readStringOnBlur); |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('check.'+seqNo, demux.checkDataFilesOnClick); |
5801 |
19 Dec 19 |
nicklas |
Buttons.addClickHandler('donotuseinfo.'+seqNo, demux.showDoNotUseInfo); |
5801 |
19 Dec 19 |
nicklas |
386 |
} |
5801 |
19 Dec 19 |
nicklas |
387 |
} |
5801 |
19 Dec 19 |
nicklas |
388 |
|
5801 |
19 Dec 19 |
nicklas |
Wizard.setCurrentStep(2); |
5801 |
19 Dec 19 |
nicklas |
Doc.show('gocancel'); |
5801 |
19 Dec 19 |
nicklas |
Doc.show('goregister'); |
5801 |
19 Dec 19 |
nicklas |
392 |
|
5801 |
19 Dec 19 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
5801 |
19 Dec 19 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
5801 |
19 Dec 19 |
nicklas |
395 |
|
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'); |
5801 |
19 Dec 19 |
nicklas |
398 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
5801 |
19 Dec 19 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config='+(pipeline.id == 'MIPS' ? 'demux-mips' : 'demux'); |
5801 |
19 Dec 19 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
5801 |
19 Dec 19 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
5801 |
19 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, demux.clustersLoaded); |
5801 |
19 Dec 19 |
nicklas |
404 |
} |
5801 |
19 Dec 19 |
nicklas |
405 |
|
5801 |
19 Dec 19 |
nicklas |
demux.showDoNotUseInfo = function(event) |
5801 |
19 Dec 19 |
nicklas |
407 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var seqNo = Data.get(event.currentTarget, 'seq-no'); |
5801 |
19 Dec 19 |
nicklas |
var seqRun = frm.seqRuns[seqNo].seqRun; |
5801 |
19 Dec 19 |
nicklas |
var fc = seqRun.flowCell; |
5801 |
19 Dec 19 |
nicklas |
var libs = fc.libraries; |
5801 |
19 Dec 19 |
nicklas |
413 |
|
5801 |
19 Dec 19 |
nicklas |
var msg = '<table>'; |
5801 |
19 Dec 19 |
nicklas |
for (var libNo = 0; libNo < libs.length; libNo++) |
5801 |
19 Dec 19 |
nicklas |
416 |
{ |
5801 |
19 Dec 19 |
nicklas |
var lib = libs[libNo]; |
5801 |
19 Dec 19 |
nicklas |
if (lib.DO_NOT_USE) |
5801 |
19 Dec 19 |
nicklas |
419 |
{ |
5801 |
19 Dec 19 |
nicklas |
msg += '<tr><td><b>'+Strings.encodeTags(lib.name) + '</b></td><td><span class="itemsubtype">[' + lib.DO_NOT_USE + ']</span></td>'; |
5801 |
19 Dec 19 |
nicklas |
msg += '<td>'+ Strings.encodeTags(lib.DO_NOT_USE_COMMENT) + '</td></tr>'; |
5801 |
19 Dec 19 |
nicklas |
422 |
} |
5801 |
19 Dec 19 |
nicklas |
423 |
} |
5801 |
19 Dec 19 |
nicklas |
msg += '</table>'; |
5801 |
19 Dec 19 |
nicklas |
Forms.showNotification(event.currentTarget, msg, 'donotuseinfo', 'pointer-left'); |
5801 |
19 Dec 19 |
nicklas |
426 |
} |
5801 |
19 Dec 19 |
nicklas |
427 |
|
5801 |
19 Dec 19 |
nicklas |
demux.clustersLoaded = function(response) |
5801 |
19 Dec 19 |
nicklas |
429 |
{ |
5801 |
19 Dec 19 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var clusters = response.hosts; |
5801 |
19 Dec 19 |
nicklas |
frm.clusters.length = 0; |
5801 |
19 Dec 19 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
5801 |
19 Dec 19 |
nicklas |
435 |
{ |
5801 |
19 Dec 19 |
nicklas |
var cl = clusters[i]; |
5801 |
19 Dec 19 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
5801 |
19 Dec 19 |
nicklas |
option.cluster = cl; |
5801 |
19 Dec 19 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
5801 |
19 Dec 19 |
nicklas |
clusterIsValid = true; |
5801 |
19 Dec 19 |
nicklas |
442 |
} |
5801 |
19 Dec 19 |
nicklas |
if (frm.clusters.length == 0) |
5801 |
19 Dec 19 |
nicklas |
444 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
5801 |
19 Dec 19 |
nicklas |
clusterIsValid = false; |
5801 |
19 Dec 19 |
nicklas |
447 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
449 |
{ |
5801 |
19 Dec 19 |
nicklas |
demux.clusterOnChange(); |
5801 |
19 Dec 19 |
nicklas |
451 |
} |
5801 |
19 Dec 19 |
nicklas |
452 |
} |
5801 |
19 Dec 19 |
nicklas |
453 |
|
5801 |
19 Dec 19 |
nicklas |
demux.checkDataFilesOnClick = function(event) |
5801 |
19 Dec 19 |
nicklas |
455 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var seqNo = parseInt(event.currentTarget.id.substring(6)); |
5801 |
19 Dec 19 |
nicklas |
var url = '../analysis/check_data_files.jsp?ID='+App.getSessionId(); |
5801 |
19 Dec 19 |
nicklas |
url += '&seqrun='+Data.get(event.currentTarget, 'seqrun-id'); |
5801 |
19 Dec 19 |
nicklas |
url += '&readString='+encodeURIComponent(frm['readString.'+seqNo].value); |
5801 |
19 Dec 19 |
nicklas |
461 |
|
5801 |
19 Dec 19 |
nicklas |
var omitLanes = []; |
5801 |
19 Dec 19 |
nicklas |
var checkboxes = frm['omitLanes.'+seqNo]; |
5801 |
19 Dec 19 |
nicklas |
for (var i = 0; i < checkboxes.length; i++) |
5801 |
19 Dec 19 |
nicklas |
465 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (checkboxes[i].checked) |
5801 |
19 Dec 19 |
nicklas |
467 |
{ |
5801 |
19 Dec 19 |
nicklas |
omitLanes[omitLanes.length] = parseInt(checkboxes[i].value); |
5801 |
19 Dec 19 |
nicklas |
469 |
} |
5801 |
19 Dec 19 |
nicklas |
470 |
} |
5801 |
19 Dec 19 |
nicklas |
if (omitLanes.length > 0) url += '&omitLanes='+omitLanes.join(','); |
5801 |
19 Dec 19 |
nicklas |
472 |
|
5801 |
19 Dec 19 |
nicklas |
Dialogs.openPopup(url, 'CheckDataFiles', 900, 600); |
5801 |
19 Dec 19 |
nicklas |
474 |
} |
5801 |
19 Dec 19 |
nicklas |
475 |
|
5801 |
19 Dec 19 |
nicklas |
476 |
|
5801 |
19 Dec 19 |
nicklas |
demux.clusterOnChange = function() |
5801 |
19 Dec 19 |
nicklas |
478 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
5801 |
19 Dec 19 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
5801 |
19 Dec 19 |
nicklas |
482 |
{ |
5801 |
19 Dec 19 |
nicklas |
frm.priority.length = 0; |
5801 |
19 Dec 19 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
5801 |
19 Dec 19 |
nicklas |
485 |
{ |
5801 |
19 Dec 19 |
nicklas |
var p = cluster.priorities[pNo]; |
5801 |
19 Dec 19 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
5801 |
19 Dec 19 |
nicklas |
488 |
} |
5801 |
19 Dec 19 |
nicklas |
Doc.show('job-priority'); |
5801 |
19 Dec 19 |
nicklas |
490 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
492 |
{ |
5801 |
19 Dec 19 |
nicklas |
Doc.hide('job-priority'); |
5801 |
19 Dec 19 |
nicklas |
494 |
} |
5801 |
19 Dec 19 |
nicklas |
495 |
|
5801 |
19 Dec 19 |
nicklas |
496 |
} |
5801 |
19 Dec 19 |
nicklas |
497 |
|
5801 |
19 Dec 19 |
nicklas |
demux.readStringOnBlur = function(eventOrTarget) |
5801 |
19 Dec 19 |
nicklas |
499 |
{ |
5801 |
19 Dec 19 |
nicklas |
var target = eventOrTarget.currentTarget || eventOrTarget; |
5801 |
19 Dec 19 |
nicklas |
var isValid = false; |
5801 |
19 Dec 19 |
nicklas |
502 |
|
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus(target.id); |
5801 |
19 Dec 19 |
nicklas |
var readString = target.value; |
5801 |
19 Dec 19 |
nicklas |
505 |
|
5801 |
19 Dec 19 |
nicklas |
if (!readString.match(/^(\d+[TBMS])+$/)) |
5801 |
19 Dec 19 |
nicklas |
507 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus(target.id, 'invalid', 'Invalid read string'); |
5801 |
19 Dec 19 |
nicklas |
509 |
} |
5801 |
19 Dec 19 |
nicklas |
else |
5801 |
19 Dec 19 |
nicklas |
511 |
{ |
5801 |
19 Dec 19 |
nicklas |
isValid = true; |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
5801 |
19 Dec 19 |
nicklas |
514 |
} |
5801 |
19 Dec 19 |
nicklas |
515 |
|
5801 |
19 Dec 19 |
nicklas |
Data.set(target, 'valid', isValid ? 1 : 0); |
5801 |
19 Dec 19 |
nicklas |
517 |
} |
5801 |
19 Dec 19 |
nicklas |
518 |
|
5801 |
19 Dec 19 |
nicklas |
demux.softwareOnChange = function(event) |
5801 |
19 Dec 19 |
nicklas |
520 |
{ |
5801 |
19 Dec 19 |
nicklas |
var target = event.currentTarget; |
5801 |
19 Dec 19 |
nicklas |
var item = target[target.selectedIndex].item; |
5801 |
19 Dec 19 |
nicklas |
if (!item) item = {}; |
5801 |
19 Dec 19 |
nicklas |
524 |
|
5801 |
19 Dec 19 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
5801 |
19 Dec 19 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
5801 |
19 Dec 19 |
nicklas |
528 |
|
5801 |
19 Dec 19 |
nicklas |
if (item.ParameterSet) |
5801 |
19 Dec 19 |
nicklas |
530 |
{ |
5801 |
19 Dec 19 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
5801 |
19 Dec 19 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
5801 |
19 Dec 19 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
5801 |
19 Dec 19 |
nicklas |
url += '&targetId='+target.id; |
5801 |
19 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, demux.parameterSetInfoLoaded); |
5801 |
19 Dec 19 |
nicklas |
536 |
} |
5801 |
19 Dec 19 |
nicklas |
537 |
} |
5801 |
19 Dec 19 |
nicklas |
538 |
|
5801 |
19 Dec 19 |
nicklas |
demux.parameterSetInfoLoaded = function(response) |
5801 |
19 Dec 19 |
nicklas |
540 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
5801 |
19 Dec 19 |
nicklas |
542 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
5801 |
19 Dec 19 |
nicklas |
544 |
} |
5801 |
19 Dec 19 |
nicklas |
545 |
} |
5801 |
19 Dec 19 |
nicklas |
546 |
|
5801 |
19 Dec 19 |
nicklas |
547 |
|
5801 |
19 Dec 19 |
nicklas |
demux.validateStep2 = function(event) |
5801 |
19 Dec 19 |
nicklas |
549 |
{ |
5801 |
19 Dec 19 |
nicklas |
550 |
|
7372 |
06 Oct 23 |
nicklas |
if (!clusterIsValid) |
5801 |
19 Dec 19 |
nicklas |
552 |
{ |
5801 |
19 Dec 19 |
nicklas |
event.preventDefault(); |
5801 |
19 Dec 19 |
nicklas |
return; |
5801 |
19 Dec 19 |
nicklas |
555 |
} |
5801 |
19 Dec 19 |
nicklas |
556 |
|
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
559 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
5801 |
19 Dec 19 |
nicklas |
561 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (!Wizard.isValid(frm['readString.'+seqNo])) |
5801 |
19 Dec 19 |
nicklas |
563 |
{ |
5801 |
19 Dec 19 |
nicklas |
event.preventDefault(); |
5801 |
19 Dec 19 |
nicklas |
return; |
5801 |
19 Dec 19 |
nicklas |
566 |
} |
5801 |
19 Dec 19 |
nicklas |
567 |
} |
5801 |
19 Dec 19 |
nicklas |
568 |
} |
5801 |
19 Dec 19 |
nicklas |
569 |
} |
5801 |
19 Dec 19 |
nicklas |
570 |
|
5801 |
19 Dec 19 |
nicklas |
demux.submit = function() |
5801 |
19 Dec 19 |
nicklas |
572 |
{ |
5801 |
19 Dec 19 |
nicklas |
var frm = document.forms['reggie']; |
5801 |
19 Dec 19 |
nicklas |
var submitInfo = {}; |
5801 |
19 Dec 19 |
nicklas |
submitInfo.demuxSoftware = parseInt(frm.demuxSoftware.value); |
5801 |
19 Dec 19 |
nicklas |
submitInfo.demuxProtocol = parseInt(frm.demuxProtocol.value); |
5801 |
19 Dec 19 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
5801 |
19 Dec 19 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
5801 |
19 Dec 19 |
nicklas |
579 |
{ |
5801 |
19 Dec 19 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
5801 |
19 Dec 19 |
nicklas |
581 |
} |
5801 |
19 Dec 19 |
nicklas |
submitInfo.debug = frm.debug.checked; |
5801 |
19 Dec 19 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
5801 |
19 Dec 19 |
nicklas |
584 |
|
5801 |
19 Dec 19 |
nicklas |
var sequencingRuns = []; |
5801 |
19 Dec 19 |
nicklas |
submitInfo.sequencingRuns = sequencingRuns; |
5801 |
19 Dec 19 |
nicklas |
587 |
|
5801 |
19 Dec 19 |
nicklas |
for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) |
5801 |
19 Dec 19 |
nicklas |
589 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (frm.seqRuns[seqNo].selected) |
5801 |
19 Dec 19 |
nicklas |
591 |
{ |
5801 |
19 Dec 19 |
nicklas |
var seqRun = {}; |
5801 |
19 Dec 19 |
nicklas |
seqRun.id = frm.seqRuns[seqNo].seqRun.id; |
5801 |
19 Dec 19 |
nicklas |
seqRun.ReadString = frm['readString.'+seqNo].value; |
5801 |
19 Dec 19 |
nicklas |
595 |
|
5801 |
19 Dec 19 |
nicklas |
var omitLanes = []; |
5801 |
19 Dec 19 |
nicklas |
var checkboxes = frm['omitLanes.'+seqNo]; |
5801 |
19 Dec 19 |
nicklas |
for (var i = 0; i < checkboxes.length; i++) |
5801 |
19 Dec 19 |
nicklas |
599 |
{ |
5801 |
19 Dec 19 |
nicklas |
if (checkboxes[i].checked) |
5801 |
19 Dec 19 |
nicklas |
601 |
{ |
5801 |
19 Dec 19 |
nicklas |
omitLanes[omitLanes.length] = parseInt(checkboxes[i].value); |
5801 |
19 Dec 19 |
nicklas |
603 |
} |
5801 |
19 Dec 19 |
nicklas |
604 |
} |
5801 |
19 Dec 19 |
nicklas |
seqRun.OmitLanes = omitLanes; |
5801 |
19 Dec 19 |
nicklas |
if (frm['excludeDoNotUse.'+seqNo]) |
5801 |
19 Dec 19 |
nicklas |
607 |
{ |
5801 |
19 Dec 19 |
nicklas |
seqRun.excludeDoNotUse = frm['excludeDoNotUse.'+seqNo].checked; |
5801 |
19 Dec 19 |
nicklas |
609 |
} |
5801 |
19 Dec 19 |
nicklas |
sequencingRuns[sequencingRuns.length] = seqRun; |
5801 |
19 Dec 19 |
nicklas |
611 |
} |
5801 |
19 Dec 19 |
nicklas |
612 |
} |
5801 |
19 Dec 19 |
nicklas |
613 |
|
5801 |
19 Dec 19 |
nicklas |
var url = '../DemuxMerge.servlet?ID='+App.getSessionId(); |
5801 |
19 Dec 19 |
nicklas |
url += '&cmd=StartDemuxAndMerge&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
5801 |
19 Dec 19 |
nicklas |
616 |
|
5801 |
19 Dec 19 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
5801 |
19 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, demux.submissionResults, 'POST', JSON.stringify(submitInfo)); |
5801 |
19 Dec 19 |
nicklas |
619 |
} |
5801 |
19 Dec 19 |
nicklas |
620 |
|
5801 |
19 Dec 19 |
nicklas |
demux.submissionResults = function(response) |
5801 |
19 Dec 19 |
nicklas |
622 |
{ |
5801 |
19 Dec 19 |
nicklas |
Wizard.showFinalMessage(response.messages); |
5801 |
19 Dec 19 |
nicklas |
Doc.show('gorestart'); |
5801 |
19 Dec 19 |
nicklas |
625 |
} |
5801 |
19 Dec 19 |
nicklas |
626 |
|
5801 |
19 Dec 19 |
nicklas |
return demux; |
5801 |
19 Dec 19 |
nicklas |
628 |
}(); |
5801 |
19 Dec 19 |
nicklas |
629 |
|
5801 |
19 Dec 19 |
nicklas |
Doc.onLoad(Demux.initPage); |
5801 |
19 Dec 19 |
nicklas |
631 |
|