2648 |
10 Sep 14 |
nicklas |
var Sequencing = function() |
2648 |
10 Sep 14 |
nicklas |
2 |
{ |
2648 |
10 Sep 14 |
nicklas |
var sequencing = {}; |
2656 |
11 Sep 14 |
nicklas |
var debug = 0; |
2648 |
10 Sep 14 |
nicklas |
5 |
|
3632 |
30 Nov 15 |
nicklas |
var runParameters; |
3632 |
30 Nov 15 |
nicklas |
var sequencers; |
2648 |
10 Sep 14 |
nicklas |
var endDateIsValid = false; |
2648 |
10 Sep 14 |
nicklas |
9 |
|
3718 |
22 Jan 16 |
nicklas |
var JOB_IMAGE = { 'DONE': 'ok.png', 'ERROR': 'error.png'}; |
3718 |
22 Jan 16 |
nicklas |
11 |
|
2648 |
10 Sep 14 |
nicklas |
// Page initialization |
2648 |
10 Sep 14 |
nicklas |
sequencing.initPage = function() |
2648 |
10 Sep 14 |
nicklas |
14 |
{ |
2648 |
10 Sep 14 |
nicklas |
// Step 1 |
2648 |
10 Sep 14 |
nicklas |
Events.addEventHandler('seqRuns', 'change', sequencing.sequencingRunOnChange); |
3632 |
30 Nov 15 |
nicklas |
Events.addEventHandler('runParametersXml', 'change', sequencing.runParametersXmlFileOnChange); |
3632 |
30 Nov 15 |
nicklas |
Buttons.addClickHandler('searchRunArchive', sequencing.searchRunArchive); |
3632 |
30 Nov 15 |
nicklas |
Events.addEventHandler('endDate', 'blur', sequencing.endDateTimeOnChange); |
3632 |
30 Nov 15 |
nicklas |
Events.addEventHandler('endTime', 'blur', sequencing.endDateTimeOnChange); |
3632 |
30 Nov 15 |
nicklas |
21 |
|
2648 |
10 Sep 14 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', sequencing.validateStep1); |
3632 |
30 Nov 15 |
nicklas |
23 |
|
2648 |
10 Sep 14 |
nicklas |
// Navigation |
2648 |
10 Sep 14 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2648 |
10 Sep 14 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2648 |
10 Sep 14 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2648 |
10 Sep 14 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2648 |
10 Sep 14 |
nicklas |
29 |
|
2648 |
10 Sep 14 |
nicklas |
// Final registration |
2648 |
10 Sep 14 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', sequencing.submit); |
3632 |
30 Nov 15 |
nicklas |
32 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
3632 |
30 Nov 15 |
nicklas |
var frm = document.forms['reggie']; |
6633 |
08 Mar 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=run-archive'; |
3632 |
30 Nov 15 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
3632 |
30 Nov 15 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.asyncJsonRequest(url, sequencing.clustersLoaded); |
3632 |
30 Nov 15 |
nicklas |
39 |
|
3632 |
30 Nov 15 |
nicklas |
// Load sequencers |
3632 |
30 Nov 15 |
nicklas |
var url = '../Hardware.servlet?ID='+App.getSessionId(); |
3632 |
30 Nov 15 |
nicklas |
url += '&cmd=GetHardware&subtype=SEQUENCER&annotations=SERIAL_NUMBER'; |
3632 |
30 Nov 15 |
nicklas |
Wizard.asyncJsonRequest(url, sequencing.sequencersLoaded); |
3632 |
30 Nov 15 |
nicklas |
44 |
|
2648 |
10 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Loading sequencing runs...'); |
2648 |
10 Sep 14 |
nicklas |
var url = '../SequencingRun.servlet?ID='+App.getSessionId(); |
5471 |
05 Jun 19 |
nicklas |
url += '&cmd=GetActiveSequencingRuns&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
2648 |
10 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, sequencing.initializeStep1); |
2648 |
10 Sep 14 |
nicklas |
49 |
} |
2648 |
10 Sep 14 |
nicklas |
50 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.clustersLoaded = function(response) |
3632 |
30 Nov 15 |
nicklas |
52 |
{ |
3632 |
30 Nov 15 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
3632 |
30 Nov 15 |
nicklas |
var frm = document.forms['reggie']; |
4306 |
17 Jan 17 |
nicklas |
var clusters = response.hosts; |
3632 |
30 Nov 15 |
nicklas |
frm.clusters.length = 0; |
3632 |
30 Nov 15 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
3632 |
30 Nov 15 |
nicklas |
58 |
{ |
3632 |
30 Nov 15 |
nicklas |
var cl = clusters[i]; |
4306 |
17 Jan 17 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
3632 |
30 Nov 15 |
nicklas |
option.cluster = cl; |
3632 |
30 Nov 15 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
3632 |
30 Nov 15 |
nicklas |
63 |
} |
3632 |
30 Nov 15 |
nicklas |
if (frm.clusters.length == 0) |
3632 |
30 Nov 15 |
nicklas |
65 |
{ |
6735 |
09 May 22 |
nicklas |
frm.clusters[frm.clusters.length] = new Option('No available clusters'); |
3632 |
30 Nov 15 |
nicklas |
frm.clusters.disabled = true; |
3632 |
30 Nov 15 |
nicklas |
Doc.addClass('searchRunArchive', 'disabled'); |
3632 |
30 Nov 15 |
nicklas |
69 |
} |
3632 |
30 Nov 15 |
nicklas |
70 |
} |
3632 |
30 Nov 15 |
nicklas |
71 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.sequencersLoaded = function(response) |
3632 |
30 Nov 15 |
nicklas |
73 |
{ |
3632 |
30 Nov 15 |
nicklas |
sequencers = response.hardware; |
3632 |
30 Nov 15 |
nicklas |
75 |
} |
2648 |
10 Sep 14 |
nicklas |
76 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.initializeStep1 = function(response) |
2648 |
10 Sep 14 |
nicklas |
78 |
{ |
2648 |
10 Sep 14 |
nicklas |
var seqRuns = response.sequencingRuns; |
2648 |
10 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2648 |
10 Sep 14 |
nicklas |
81 |
|
2648 |
10 Sep 14 |
nicklas |
if (seqRuns.length > 0) |
2648 |
10 Sep 14 |
nicklas |
83 |
{ |
2648 |
10 Sep 14 |
nicklas |
for (var runNo=0; runNo < seqRuns.length; runNo++) |
2648 |
10 Sep 14 |
nicklas |
85 |
{ |
2648 |
10 Sep 14 |
nicklas |
var seqRun = seqRuns[runNo]; |
2648 |
10 Sep 14 |
nicklas |
var option = sequencing.getOptionForSeqRun(seqRun); |
2648 |
10 Sep 14 |
nicklas |
frm.seqRuns.options[frm.seqRuns.length] = option; |
2648 |
10 Sep 14 |
nicklas |
89 |
} |
2648 |
10 Sep 14 |
nicklas |
90 |
} |
2648 |
10 Sep 14 |
nicklas |
else |
2648 |
10 Sep 14 |
nicklas |
92 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.setFatalError('No sequencing runs available for processing.'); |
2648 |
10 Sep 14 |
nicklas |
return; |
2648 |
10 Sep 14 |
nicklas |
95 |
} |
2648 |
10 Sep 14 |
nicklas |
96 |
|
2648 |
10 Sep 14 |
nicklas |
Doc.show('step-1'); |
3632 |
30 Nov 15 |
nicklas |
Doc.show('gocancel'); |
3632 |
30 Nov 15 |
nicklas |
Doc.show('goregister'); |
2648 |
10 Sep 14 |
nicklas |
100 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.sequencingRunOnChange(); |
2648 |
10 Sep 14 |
nicklas |
frm.seqRuns.focus(); |
2648 |
10 Sep 14 |
nicklas |
103 |
} |
2648 |
10 Sep 14 |
nicklas |
104 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.getOptionForSeqRun = function(seqRun) |
2648 |
10 Sep 14 |
nicklas |
106 |
{ |
2648 |
10 Sep 14 |
nicklas |
var flowCell = seqRun.flowCell; |
2648 |
10 Sep 14 |
nicklas |
var name = seqRun.name+': '; |
2648 |
10 Sep 14 |
nicklas |
var numPools = flowCell.pools.length; |
2648 |
10 Sep 14 |
nicklas |
var firstPoolNum = sequencing.getPoolNum(flowCell.pools[0].name); |
2648 |
10 Sep 14 |
nicklas |
var lastPoolNum = sequencing.getPoolNum(flowCell.pools[flowCell.pools.length-1].name); |
2648 |
10 Sep 14 |
nicklas |
112 |
|
2648 |
10 Sep 14 |
nicklas |
if (lastPoolNum - firstPoolNum == numPools - 1) |
2648 |
10 Sep 14 |
nicklas |
114 |
{ |
2648 |
10 Sep 14 |
nicklas |
if (numPools > 1) |
2648 |
10 Sep 14 |
nicklas |
116 |
{ |
2648 |
10 Sep 14 |
nicklas |
// Display: PoolN -- PoolY |
2648 |
10 Sep 14 |
nicklas |
name += flowCell.pools[0].name + ' — ' + flowCell.pools[flowCell.pools.length-1].name; |
2648 |
10 Sep 14 |
nicklas |
119 |
} |
2648 |
10 Sep 14 |
nicklas |
else |
2648 |
10 Sep 14 |
nicklas |
121 |
{ |
2648 |
10 Sep 14 |
nicklas |
name += flowCell.pools[0].name; |
2648 |
10 Sep 14 |
nicklas |
123 |
} |
2648 |
10 Sep 14 |
nicklas |
124 |
} |
2648 |
10 Sep 14 |
nicklas |
else |
2648 |
10 Sep 14 |
nicklas |
126 |
{ |
2648 |
10 Sep 14 |
nicklas |
// Display: PoolN + x more... |
2648 |
10 Sep 14 |
nicklas |
name += flowCell.pools[0].name + ' + ' + (numPools-1) + ' more...'; |
2648 |
10 Sep 14 |
nicklas |
129 |
} |
2648 |
10 Sep 14 |
nicklas |
130 |
|
2648 |
10 Sep 14 |
nicklas |
// Tooltip is always all pools |
2648 |
10 Sep 14 |
nicklas |
var title = ''; |
2648 |
10 Sep 14 |
nicklas |
for (var poolNo=0; poolNo < numPools; poolNo++) |
2648 |
10 Sep 14 |
nicklas |
134 |
{ |
2648 |
10 Sep 14 |
nicklas |
var pool = flowCell.pools[poolNo]; |
2648 |
10 Sep 14 |
nicklas |
if (poolNo > 0) title += ', '; |
2648 |
10 Sep 14 |
nicklas |
title += pool.name; |
2648 |
10 Sep 14 |
nicklas |
138 |
} |
2648 |
10 Sep 14 |
nicklas |
139 |
|
5471 |
05 Jun 19 |
nicklas |
var opt = []; |
5471 |
05 Jun 19 |
nicklas |
if (flowCell.FlowCellType) opt[opt.length] = flowCell.FlowCellType; |
5471 |
05 Jun 19 |
nicklas |
opt[opt.length] = seqRun.pipeline; |
5478 |
10 Jun 19 |
nicklas |
if (seqRun.autoAnalyze) opt[opt.length] = 'auto-analyze'; |
5471 |
05 Jun 19 |
nicklas |
name += ' [' + opt.join('; ') + ']'; |
2648 |
10 Sep 14 |
nicklas |
145 |
|
2648 |
10 Sep 14 |
nicklas |
var option = new Option(name, seqRun.id); |
2648 |
10 Sep 14 |
nicklas |
option.title = title; |
2648 |
10 Sep 14 |
nicklas |
option.seqRun = seqRun; |
2648 |
10 Sep 14 |
nicklas |
return option; |
2648 |
10 Sep 14 |
nicklas |
150 |
} |
2648 |
10 Sep 14 |
nicklas |
151 |
|
2648 |
10 Sep 14 |
nicklas |
152 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.getPoolNum = function(poolName) |
2648 |
10 Sep 14 |
nicklas |
154 |
{ |
2648 |
10 Sep 14 |
nicklas |
var num = poolName.match(/Pool(\d+)/); |
2648 |
10 Sep 14 |
nicklas |
return num ? parseInt(num[1], 10) : null; |
2648 |
10 Sep 14 |
nicklas |
157 |
} |
2648 |
10 Sep 14 |
nicklas |
158 |
|
2648 |
10 Sep 14 |
nicklas |
159 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.sequencingRunOnChange = function() |
2648 |
10 Sep 14 |
nicklas |
161 |
{ |
3632 |
30 Nov 15 |
nicklas |
sequencing.resetSeqRunInfo(); |
3632 |
30 Nov 15 |
nicklas |
163 |
} |
3632 |
30 Nov 15 |
nicklas |
164 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.resetSeqRunInfo = function() |
3632 |
30 Nov 15 |
nicklas |
166 |
{ |
2648 |
10 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2648 |
10 Sep 14 |
nicklas |
var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; |
2648 |
10 Sep 14 |
nicklas |
169 |
|
3692 |
13 Jan 16 |
nicklas |
if (seqRun.autoAnalyze) |
3692 |
13 Jan 16 |
nicklas |
171 |
{ |
3718 |
22 Jan 16 |
nicklas |
var aa = seqRun.autoAnalyze; |
3718 |
22 Jan 16 |
nicklas |
var img = JOB_IMAGE[aa.status] || 'info.png'; |
3718 |
22 Jan 16 |
nicklas |
var msg = '<span id="autoAnalyzeJob" class="link" data-item-type="JOB" data-item-id="'+aa.id+'"><img src="../images/'+img+'" style="margin-right: 0.5em;"></span>'; |
3718 |
22 Jan 16 |
nicklas |
175 |
|
3718 |
22 Jan 16 |
nicklas |
msg += '<span class="itemsubtype">['+aa.status+']</span> '; |
3718 |
22 Jan 16 |
nicklas |
if (aa.status == 'EXECUTING') |
3718 |
22 Jan 16 |
nicklas |
178 |
{ |
3718 |
22 Jan 16 |
nicklas |
msg += aa.progress + '% '; |
3718 |
22 Jan 16 |
nicklas |
180 |
} |
3718 |
22 Jan 16 |
nicklas |
msg += Strings.encodeTags(seqRun.autoAnalyze.message); |
3718 |
22 Jan 16 |
nicklas |
Wizard.setInputStatus('autoAnalyze', 'warning', 'Auto-analyze has been selected for this sequencing run. Manual registration in this step will stop the automatic processing.'); |
3718 |
22 Jan 16 |
nicklas |
Doc.element('autoAnalyze').innerHTML = msg; |
3718 |
22 Jan 16 |
nicklas |
Doc.show('autoAnalyzeSection'); |
3718 |
22 Jan 16 |
nicklas |
Events.addEventHandler('autoAnalyzeJob', 'click', Items.itemOnClick); |
3718 |
22 Jan 16 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Check to verify registration of an auto-analyze sequencing run.'); |
3692 |
13 Jan 16 |
nicklas |
187 |
} |
3718 |
22 Jan 16 |
nicklas |
else |
3718 |
22 Jan 16 |
nicklas |
189 |
{ |
3718 |
22 Jan 16 |
nicklas |
Doc.hide('autoAnalyzeSection'); |
3718 |
22 Jan 16 |
nicklas |
Wizard.hideGoNextConfirmation(); |
3718 |
22 Jan 16 |
nicklas |
192 |
} |
3692 |
13 Jan 16 |
nicklas |
193 |
|
3632 |
30 Nov 15 |
nicklas |
// Flow cell info |
2648 |
10 Sep 14 |
nicklas |
var fc = seqRun.flowCell; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('externalId').innerHTML = Strings.encodeTags(fc.FlowCellID || ''); |
2648 |
10 Sep 14 |
nicklas |
Doc.element('flowCellType').innerHTML = Strings.encodeTags(fc.FlowCellType || ''); |
2648 |
10 Sep 14 |
nicklas |
var pools = fc.pools; |
5473 |
05 Jun 19 |
nicklas |
199 |
|
5473 |
05 Jun 19 |
nicklas |
var poolNames = []; |
5473 |
05 Jun 19 |
nicklas |
var libPlateNames = []; |
2648 |
10 Sep 14 |
nicklas |
for (var poolNo = 0; poolNo < pools.length; poolNo++) |
2648 |
10 Sep 14 |
nicklas |
203 |
{ |
2648 |
10 Sep 14 |
nicklas |
var pool = pools[poolNo]; |
5473 |
05 Jun 19 |
nicklas |
poolNames[poolNames.length] = pool.name; |
5473 |
05 Jun 19 |
nicklas |
if (pool.libPlates) |
2648 |
10 Sep 14 |
nicklas |
207 |
{ |
5473 |
05 Jun 19 |
nicklas |
for (var plateNo = 0; plateNo < pool.libPlates.length; plateNo++) |
5473 |
05 Jun 19 |
nicklas |
209 |
{ |
5473 |
05 Jun 19 |
nicklas |
var plateName = pool.libPlates[plateNo].name; |
5473 |
05 Jun 19 |
nicklas |
if (libPlateNames.indexOf(plateName) == -1) |
5473 |
05 Jun 19 |
nicklas |
212 |
{ |
5473 |
05 Jun 19 |
nicklas |
libPlateNames[libPlateNames.length] = plateName; |
5473 |
05 Jun 19 |
nicklas |
214 |
} |
5473 |
05 Jun 19 |
nicklas |
215 |
} |
2648 |
10 Sep 14 |
nicklas |
216 |
} |
2648 |
10 Sep 14 |
nicklas |
217 |
} |
5473 |
05 Jun 19 |
nicklas |
Doc.element('pools').innerHTML = Strings.encodeTags(poolNames.join(', ')); |
5473 |
05 Jun 19 |
nicklas |
Doc.element('libPlates').innerHTML = Strings.encodeTags(libPlateNames.join(', ')) || 'n/a'; |
3632 |
30 Nov 15 |
nicklas |
220 |
|
3632 |
30 Nov 15 |
nicklas |
// Sequencing info |
3632 |
30 Nov 15 |
nicklas |
var sequencer = seqRun.sequencer; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('startDate').innerHTML = Reggie.reformatDate(seqRun.SequencingStart); |
3632 |
30 Nov 15 |
nicklas |
Doc.element('position').innerHTML = Strings.encodeTags(seqRun.HiSeqPosition); |
3632 |
30 Nov 15 |
nicklas |
Doc.element('sequencingCycles').innerHTML = Strings.encodeTags(fc.SequencingCycles); |
3632 |
30 Nov 15 |
nicklas |
Doc.element('sequencer').innerHTML = sequencer ? |
3632 |
30 Nov 15 |
nicklas |
Strings.encodeTags(sequencer.name + ' ('+sequencer.SerialNumber+')') : ''; |
3632 |
30 Nov 15 |
nicklas |
frm.comments.value = seqRun.comments; |
3632 |
30 Nov 15 |
nicklas |
229 |
|
3632 |
30 Nov 15 |
nicklas |
// Loaded from RunParameters.xml |
3632 |
30 Nov 15 |
nicklas |
Doc.element('experimentName').innerHTML = ''; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('runId').innerHTML = ''; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('runNumber').innerHTML = ''; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('dataFolder').innerHTML = ''; |
3636 |
01 Dec 15 |
nicklas |
Doc.element('endDate').value = ''; |
3636 |
01 Dec 15 |
nicklas |
Doc.element('endTime').value = ''; |
3636 |
01 Dec 15 |
nicklas |
237 |
|
3632 |
30 Nov 15 |
nicklas |
runParameters = null; |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('externalId'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('startDate'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('sequencingCycles'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('sequencer'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('position'); |
2648 |
10 Sep 14 |
nicklas |
245 |
} |
2648 |
10 Sep 14 |
nicklas |
246 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.runParametersXmlFileOnChange = function(event) |
2648 |
10 Sep 14 |
nicklas |
248 |
{ |
3632 |
30 Nov 15 |
nicklas |
sequencing.resetSeqRunInfo(); |
3632 |
30 Nov 15 |
nicklas |
Wizard.setNoConfirmOnFirstStep(false); |
3632 |
30 Nov 15 |
nicklas |
var file = event.target.files[0]; |
2648 |
10 Sep 14 |
nicklas |
252 |
|
3632 |
30 Nov 15 |
nicklas |
var reader = new FileReader(); |
3632 |
30 Nov 15 |
nicklas |
reader.onload = sequencing.runParametersXmlFileLoaded; |
3632 |
30 Nov 15 |
nicklas |
reader.readAsText(file); |
2648 |
10 Sep 14 |
nicklas |
256 |
} |
2648 |
10 Sep 14 |
nicklas |
257 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.runParametersXmlFileLoaded = function(event) |
2648 |
10 Sep 14 |
nicklas |
259 |
{ |
3632 |
30 Nov 15 |
nicklas |
runParameters = sequencing.parseRunParametersXmlFile(event.target.result); |
3632 |
30 Nov 15 |
nicklas |
sequencing.validateAndCopyRunParameters(runParameters); |
3632 |
30 Nov 15 |
nicklas |
262 |
} |
3632 |
30 Nov 15 |
nicklas |
263 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.searchRunArchive = function() |
3632 |
30 Nov 15 |
nicklas |
265 |
{ |
3632 |
30 Nov 15 |
nicklas |
sequencing.resetSeqRunInfo(); |
3632 |
30 Nov 15 |
nicklas |
267 |
|
2648 |
10 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
3632 |
30 Nov 15 |
nicklas |
var flowCell = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun.flowCell; |
2648 |
10 Sep 14 |
nicklas |
270 |
|
3632 |
30 Nov 15 |
nicklas |
var url = '../SequencingRun.servlet?ID='+App.getSessionId(); |
3632 |
30 Nov 15 |
nicklas |
url += '&cmd=SearchRunArchive'; |
3632 |
30 Nov 15 |
nicklas |
url += '&FlowCellID='+encodeURIComponent(flowCell.FlowCellID); |
3632 |
30 Nov 15 |
nicklas |
url += '&cluster='+encodeURIComponent(frm.clusters.value); |
2648 |
10 Sep 14 |
nicklas |
275 |
|
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml', 'checking', 'Searching...'); |
3632 |
30 Nov 15 |
nicklas |
Wizard.asyncJsonRequest(url, sequencing.runArchiveSearched); |
3632 |
30 Nov 15 |
nicklas |
278 |
} |
3632 |
30 Nov 15 |
nicklas |
279 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.runArchiveSearched = function(response) |
3632 |
30 Nov 15 |
nicklas |
281 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml'); |
3632 |
30 Nov 15 |
nicklas |
if (response.exitStatus != 0) |
2648 |
10 Sep 14 |
nicklas |
284 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml', 'invalid', Strings.encodeTags(response.stderr).replace(/\n/g, '<br>')); |
3632 |
30 Nov 15 |
nicklas |
return; |
3632 |
30 Nov 15 |
nicklas |
287 |
} |
3632 |
30 Nov 15 |
nicklas |
Wizard.setNoConfirmOnFirstStep(false); |
3632 |
30 Nov 15 |
nicklas |
289 |
|
3632 |
30 Nov 15 |
nicklas |
Doc.element('dataFolder').innerHTML = Strings.encodeTags(response.dataFolder); |
3636 |
01 Dec 15 |
nicklas |
if (response.endDateTime) |
3636 |
01 Dec 15 |
nicklas |
292 |
{ |
3636 |
01 Dec 15 |
nicklas |
Doc.element('endDate').value = response.endDateTime.substr(0, 8); |
3636 |
01 Dec 15 |
nicklas |
Doc.element('endTime').value = response.endDateTime.substr(9, 4); |
3636 |
01 Dec 15 |
nicklas |
295 |
} |
3632 |
30 Nov 15 |
nicklas |
296 |
|
3632 |
30 Nov 15 |
nicklas |
runParameters = sequencing.parseRunParametersXmlFile(response.runParameters); |
3632 |
30 Nov 15 |
nicklas |
sequencing.validateAndCopyRunParameters(runParameters); |
3632 |
30 Nov 15 |
nicklas |
299 |
} |
3632 |
30 Nov 15 |
nicklas |
300 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.parseRunParametersXmlFile = function(data) |
3632 |
30 Nov 15 |
nicklas |
302 |
{ |
5471 |
05 Jun 19 |
nicklas |
var frm = document.forms['reggie']; |
5471 |
05 Jun 19 |
nicklas |
var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; |
5471 |
05 Jun 19 |
nicklas |
var fc = seqRun.flowCell; |
3632 |
30 Nov 15 |
nicklas |
var doc; |
3632 |
30 Nov 15 |
nicklas |
var info = {}; |
3632 |
30 Nov 15 |
nicklas |
try |
3632 |
30 Nov 15 |
nicklas |
309 |
{ |
3632 |
30 Nov 15 |
nicklas |
var parser = new DOMParser(); |
3632 |
30 Nov 15 |
nicklas |
doc = parser.parseFromString(data, "application/xml"); |
3632 |
30 Nov 15 |
nicklas |
312 |
|
3632 |
30 Nov 15 |
nicklas |
if (doc.documentElement.tagName == 'parsererror') |
2648 |
10 Sep 14 |
nicklas |
314 |
{ |
3632 |
30 Nov 15 |
nicklas |
throw new Error(doc.documentElement.firstChild.textContent.split(/\n/)[0]); |
2648 |
10 Sep 14 |
nicklas |
316 |
} |
3632 |
30 Nov 15 |
nicklas |
317 |
|
5471 |
05 Jun 19 |
nicklas |
if (fc.FlowCellType == 'NextSeq') |
5471 |
05 Jun 19 |
nicklas |
319 |
{ |
5471 |
05 Jun 19 |
nicklas |
info.ExperimentName = sequencing.getTextValue(doc, 'ExperimentName'); |
5471 |
05 Jun 19 |
nicklas |
info.RunID = sequencing.getTextValue(doc, 'RunID'); |
5471 |
05 Jun 19 |
nicklas |
info.HiSeqPosition = 'A'; |
5471 |
05 Jun 19 |
nicklas |
info.ScannerID = sequencing.getTextValue(doc, 'InstrumentID'); |
5471 |
05 Jun 19 |
nicklas |
info.ScanNumber = parseInt(sequencing.getTextValue(doc, 'RunNumber')); |
5471 |
05 Jun 19 |
nicklas |
info.FlowCellID = sequencing.getTextValue(doc, 'FlowCellSerial'); |
5869 |
19 Mar 20 |
nicklas |
326 |
|
5869 |
19 Mar 20 |
nicklas |
var read1 = sequencing.getTextValue(doc, 'Read1'); |
5869 |
19 Mar 20 |
nicklas |
var index1 = sequencing.getTextValue(doc, 'Index1Read'); |
5869 |
19 Mar 20 |
nicklas |
var index2 = sequencing.getTextValue(doc, 'Index2Read'); |
5869 |
19 Mar 20 |
nicklas |
var read2 = sequencing.getTextValue(doc, 'Read2'); |
5869 |
19 Mar 20 |
nicklas |
info.SequencingCycles = sequencing.getSequencingCycles(read1, index1, index2, read2); |
5471 |
05 Jun 19 |
nicklas |
info.SequencingStart = '20'+sequencing.getTextValue(doc, 'RunStartDate'); |
5471 |
05 Jun 19 |
nicklas |
333 |
} |
5471 |
05 Jun 19 |
nicklas |
else if (fc.FlowCellType == 'HiSeq') |
5471 |
05 Jun 19 |
nicklas |
335 |
{ |
5471 |
05 Jun 19 |
nicklas |
info.ExperimentName = sequencing.getTextValue(doc, 'ExperimentName'); |
5471 |
05 Jun 19 |
nicklas |
info.RunID = sequencing.getTextValue(doc, 'RunID'); |
5471 |
05 Jun 19 |
nicklas |
info.HiSeqPosition = sequencing.getTextValue(doc, 'FCPosition'); |
5471 |
05 Jun 19 |
nicklas |
info.ScannerID = sequencing.getTextValue(doc, 'ScannerID'); |
5471 |
05 Jun 19 |
nicklas |
info.ScanNumber = parseInt(sequencing.getTextValue(doc, 'ScanNumber')); |
5471 |
05 Jun 19 |
nicklas |
info.FlowCellID = sequencing.getTextValue(doc, 'Barcode'); |
5869 |
19 Mar 20 |
nicklas |
342 |
|
5869 |
19 Mar 20 |
nicklas |
var read1 = sequencing.getTextValue(doc, 'Read1'); |
5869 |
19 Mar 20 |
nicklas |
var index1 = sequencing.getTextValue(doc, 'Index1Read'); |
5869 |
19 Mar 20 |
nicklas |
var index2 = sequencing.getTextValue(doc, 'Index2Read'); |
5869 |
19 Mar 20 |
nicklas |
var read2 = sequencing.getTextValue(doc, 'Read2'); |
5869 |
19 Mar 20 |
nicklas |
info.SequencingCycles = sequencing.getSequencingCycles(read1, index1, index2, read2); |
5471 |
05 Jun 19 |
nicklas |
info.SequencingStart = '20'+sequencing.getTextValue(doc, 'RunStartDate'); |
5471 |
05 Jun 19 |
nicklas |
349 |
} |
5857 |
10 Mar 20 |
nicklas |
else if (fc.FlowCellType == 'NovaSeq') |
5857 |
10 Mar 20 |
nicklas |
351 |
{ |
5857 |
10 Mar 20 |
nicklas |
info.ExperimentName = sequencing.getTextValue(doc, 'ExperimentName'); |
5857 |
10 Mar 20 |
nicklas |
info.RunID = sequencing.getTextValue(doc, 'RunId'); // Note! "RunId" instead of "RunID" |
5857 |
10 Mar 20 |
nicklas |
info.HiSeqPosition = sequencing.getTextValue(doc, 'Side'); |
5857 |
10 Mar 20 |
nicklas |
info.ScannerID = sequencing.getTextValue(doc, 'InstrumentName'); |
5857 |
10 Mar 20 |
nicklas |
info.ScanNumber = parseInt(sequencing.getTextValue(doc, 'RunNumber')); |
5857 |
10 Mar 20 |
nicklas |
info.FlowCellID = sequencing.getTextValue(doc, 'RfidsInfo>FlowCellSerialBarcode'); |
5869 |
19 Mar 20 |
nicklas |
var read1 = sequencing.getTextValue(doc, 'Read1NumberOfCycles'); |
5869 |
19 Mar 20 |
nicklas |
var index1 = sequencing.getTextValue(doc, 'IndexRead1NumberOfCycles'); |
5869 |
19 Mar 20 |
nicklas |
var index2 = sequencing.getTextValue(doc, 'IndexRead2NumberOfCycles'); |
5869 |
19 Mar 20 |
nicklas |
var read2 = sequencing.getTextValue(doc, 'Read2NumberOfCycles'); |
5869 |
19 Mar 20 |
nicklas |
info.SequencingCycles = sequencing.getSequencingCycles(read1, index1, index2, read2); |
5857 |
10 Mar 20 |
nicklas |
info.SequencingStart = '20'+sequencing.getTextValue(doc, 'RunStartDate'); |
5857 |
10 Mar 20 |
nicklas |
364 |
} |
2648 |
10 Sep 14 |
nicklas |
365 |
} |
3632 |
30 Nov 15 |
nicklas |
catch (err) |
2648 |
10 Sep 14 |
nicklas |
367 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml', 'invalid', err.toString()); |
3632 |
30 Nov 15 |
nicklas |
info.error = true; |
3632 |
30 Nov 15 |
nicklas |
370 |
} |
3632 |
30 Nov 15 |
nicklas |
371 |
|
3632 |
30 Nov 15 |
nicklas |
if (debug) App.debug(JSON.stringify(info)); |
3632 |
30 Nov 15 |
nicklas |
return info; |
3632 |
30 Nov 15 |
nicklas |
374 |
} |
2648 |
10 Sep 14 |
nicklas |
375 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.getTextValue = function(doc, selector) |
3632 |
30 Nov 15 |
nicklas |
377 |
{ |
3632 |
30 Nov 15 |
nicklas |
var el = doc.querySelector(selector); |
3632 |
30 Nov 15 |
nicklas |
if (el == null) |
3632 |
30 Nov 15 |
nicklas |
380 |
{ |
3632 |
30 Nov 15 |
nicklas |
throw new Error("Can't find tag <"+selector+">"); |
3632 |
30 Nov 15 |
nicklas |
382 |
} |
3632 |
30 Nov 15 |
nicklas |
return el.textContent; |
3632 |
30 Nov 15 |
nicklas |
384 |
} |
5869 |
19 Mar 20 |
nicklas |
385 |
|
5869 |
19 Mar 20 |
nicklas |
sequencing.getSequencingCycles = function(read1, index1, index2, read2) |
5869 |
19 Mar 20 |
nicklas |
387 |
{ |
5869 |
19 Mar 20 |
nicklas |
return read1+'-'+index1+'-'+(index2=='0'?'':index2+'-')+read2; |
5869 |
19 Mar 20 |
nicklas |
389 |
} |
3632 |
30 Nov 15 |
nicklas |
390 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.validateAndCopyRunParameters = function(info) |
3632 |
30 Nov 15 |
nicklas |
392 |
{ |
3632 |
30 Nov 15 |
nicklas |
if (info.error) return; |
3632 |
30 Nov 15 |
nicklas |
var frm = document.forms['reggie']; |
3632 |
30 Nov 15 |
nicklas |
var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; |
3632 |
30 Nov 15 |
nicklas |
var fc = seqRun.flowCell; |
3632 |
30 Nov 15 |
nicklas |
397 |
|
3632 |
30 Nov 15 |
nicklas |
// Flow cell info |
3632 |
30 Nov 15 |
nicklas |
Doc.element('externalId').innerHTML = info.FlowCellID || ''; |
3632 |
30 Nov 15 |
nicklas |
if (fc.FlowCellID != info.FlowCellID) |
3632 |
30 Nov 15 |
nicklas |
401 |
{ |
3632 |
30 Nov 15 |
nicklas |
if (fc.FlowCellID.toLowerCase() != info.FlowCellID.toLowerCase()) |
2648 |
10 Sep 14 |
nicklas |
403 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('externalId', 'invalid', 'Not same as registered barcode ('+Strings.encodeTags(fc.FlowCellID)+').'); |
3632 |
30 Nov 15 |
nicklas |
info.error = true; |
2648 |
10 Sep 14 |
nicklas |
406 |
} |
3632 |
30 Nov 15 |
nicklas |
else |
3632 |
30 Nov 15 |
nicklas |
408 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('externalId', 'warning', 'Not same as registered barcode ('+Strings.encodeTags(fc.FlowCellID)+').'); |
3632 |
30 Nov 15 |
nicklas |
410 |
} |
2648 |
10 Sep 14 |
nicklas |
411 |
} |
3632 |
30 Nov 15 |
nicklas |
412 |
|
3632 |
30 Nov 15 |
nicklas |
// Seq run info |
3632 |
30 Nov 15 |
nicklas |
Doc.element('startDate').innerHTML = Reggie.reformatDate(info.SequencingStart) || ''; |
5869 |
19 Mar 20 |
nicklas |
if (seqRun.SequencingStart && seqRun.SequencingStart != info.SequencingStart) |
2648 |
10 Sep 14 |
nicklas |
416 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('startDate', 'warning', 'Not same as registered start date ('+Reggie.reformatDate(seqRun.SequencingStart)+').'); |
2648 |
10 Sep 14 |
nicklas |
418 |
} |
3632 |
30 Nov 15 |
nicklas |
Doc.element('sequencingCycles').innerHTML = info.SequencingCycles || ''; |
5869 |
19 Mar 20 |
nicklas |
if (fc.SequencingCycles && fc.SequencingCycles != info.SequencingCycles) |
2648 |
10 Sep 14 |
nicklas |
421 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('sequencingCycles', 'warning', 'Not same as planned SequencingCycles ('+Strings.encodeTags(fc.SequencingCycles)+').'); |
3632 |
30 Nov 15 |
nicklas |
423 |
} |
3632 |
30 Nov 15 |
nicklas |
Doc.element('position').innerHTML = info.HiSeqPosition || ''; |
5869 |
19 Mar 20 |
nicklas |
if (seqRun.HiSeqPosition && seqRun.HiSeqPosition != info.HiSeqPosition) |
3632 |
30 Nov 15 |
nicklas |
426 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('position', 'warning', 'Not same as planned position ('+Strings.encodeTags(seqRun.HiSeqPosition)+').'); |
3632 |
30 Nov 15 |
nicklas |
428 |
} |
3632 |
30 Nov 15 |
nicklas |
429 |
|
5869 |
19 Mar 20 |
nicklas |
if (info.ScannerID && (!seqRun.sequencer || seqRun.sequencer.SerialNumber != info.ScannerID)) |
3632 |
30 Nov 15 |
nicklas |
431 |
{ |
5869 |
19 Mar 20 |
nicklas |
if (seqRun.sequencer && seqRun.sequencer.SerialNumber != info.ScannerID) |
2648 |
10 Sep 14 |
nicklas |
433 |
{ |
3632 |
30 Nov 15 |
nicklas |
Doc.element('sequencer').innerHTML = info.ScannerID; |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('sequencer', 'warning', 'Not same as registered sequencer ('+Strings.encodeTags(seqRun.sequencer.name)+').'); |
5869 |
19 Mar 20 |
nicklas |
436 |
} |
5869 |
19 Mar 20 |
nicklas |
437 |
|
5869 |
19 Mar 20 |
nicklas |
// Try to find the sequencer |
5869 |
19 Mar 20 |
nicklas |
if (sequencers && sequencers.length) |
5869 |
19 Mar 20 |
nicklas |
440 |
{ |
5869 |
19 Mar 20 |
nicklas |
for (var i = 0; i < sequencers.length; i++) |
3632 |
30 Nov 15 |
nicklas |
442 |
{ |
5869 |
19 Mar 20 |
nicklas |
var seq = sequencers[i]; |
5869 |
19 Mar 20 |
nicklas |
if (seq.SerialNumber == info.ScannerID) |
3632 |
30 Nov 15 |
nicklas |
445 |
{ |
5869 |
19 Mar 20 |
nicklas |
Doc.element('sequencer').innerHTML = Strings.encodeTags(seq.name + ' ('+seq.SerialNumber + ')'); |
5869 |
19 Mar 20 |
nicklas |
info.sequencer = seq; |
5869 |
19 Mar 20 |
nicklas |
break; |
3632 |
30 Nov 15 |
nicklas |
449 |
} |
3632 |
30 Nov 15 |
nicklas |
450 |
} |
2648 |
10 Sep 14 |
nicklas |
451 |
} |
2648 |
10 Sep 14 |
nicklas |
452 |
} |
2648 |
10 Sep 14 |
nicklas |
453 |
|
3632 |
30 Nov 15 |
nicklas |
454 |
|
3632 |
30 Nov 15 |
nicklas |
Doc.element('experimentName').innerHTML = info.ExperimentName || ''; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('runId').innerHTML = info.RunID || ''; |
3632 |
30 Nov 15 |
nicklas |
Doc.element('runNumber').innerHTML = info.ScanNumber || ''; |
3632 |
30 Nov 15 |
nicklas |
458 |
|
3632 |
30 Nov 15 |
nicklas |
if (!info.error) Wizard.setInputStatus('runParametersXml', 'valid'); |
3632 |
30 Nov 15 |
nicklas |
frm.endDate.focus(); |
3632 |
30 Nov 15 |
nicklas |
461 |
|
2648 |
10 Sep 14 |
nicklas |
462 |
} |
2648 |
10 Sep 14 |
nicklas |
463 |
|
3632 |
30 Nov 15 |
nicklas |
sequencing.validateStep1 = function(event) |
3632 |
30 Nov 15 |
nicklas |
465 |
{ |
3632 |
30 Nov 15 |
nicklas |
if (!runParameters) |
3632 |
30 Nov 15 |
nicklas |
467 |
{ |
3632 |
30 Nov 15 |
nicklas |
Wizard.setInputStatus('runParametersXml', 'invalid', 'Missing'); |
3632 |
30 Nov 15 |
nicklas |
469 |
} |
3718 |
22 Jan 16 |
nicklas |
if (!runParameters || runParameters.error || !endDateIsValid) |
3632 |
30 Nov 15 |
nicklas |
471 |
{ |
3632 |
30 Nov 15 |
nicklas |
event.preventDefault(); |
3632 |
30 Nov 15 |
nicklas |
473 |
} |
3632 |
30 Nov 15 |
nicklas |
474 |
} |
3632 |
30 Nov 15 |
nicklas |
475 |
|
3632 |
30 Nov 15 |
nicklas |
476 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.endDateTimeOnChange = function() |
2648 |
10 Sep 14 |
nicklas |
478 |
{ |
2648 |
10 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2648 |
10 Sep 14 |
nicklas |
endDateIsValid = false; |
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate'); |
2648 |
10 Sep 14 |
nicklas |
482 |
|
2648 |
10 Sep 14 |
nicklas |
var endDate = frm.endDate.value; |
2648 |
10 Sep 14 |
nicklas |
var endTime = frm.endTime.value; |
2648 |
10 Sep 14 |
nicklas |
485 |
|
2648 |
10 Sep 14 |
nicklas |
if (endDate == '') |
2648 |
10 Sep 14 |
nicklas |
487 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate', 'invalid', 'Missing date'); |
2648 |
10 Sep 14 |
nicklas |
return; |
2648 |
10 Sep 14 |
nicklas |
490 |
} |
2648 |
10 Sep 14 |
nicklas |
else |
2648 |
10 Sep 14 |
nicklas |
492 |
{ |
2648 |
10 Sep 14 |
nicklas |
// Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits. |
2648 |
10 Sep 14 |
nicklas |
endDate = Reggie.autoFillDate(endDate); |
2648 |
10 Sep 14 |
nicklas |
frm.endDate.value = endDate; |
2648 |
10 Sep 14 |
nicklas |
496 |
|
2648 |
10 Sep 14 |
nicklas |
if (!Dates.isDate(endDate, 'yyyyMMdd')) |
2648 |
10 Sep 14 |
nicklas |
498 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate', 'invalid', 'Not a valid date'); |
2648 |
10 Sep 14 |
nicklas |
return; |
2648 |
10 Sep 14 |
nicklas |
501 |
} |
2648 |
10 Sep 14 |
nicklas |
502 |
} |
2648 |
10 Sep 14 |
nicklas |
503 |
|
2648 |
10 Sep 14 |
nicklas |
if (endTime == '') |
2648 |
10 Sep 14 |
nicklas |
505 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate', 'invalid', 'Missing time'); |
2648 |
10 Sep 14 |
nicklas |
return; |
2648 |
10 Sep 14 |
nicklas |
508 |
} |
2648 |
10 Sep 14 |
nicklas |
else |
2648 |
10 Sep 14 |
nicklas |
510 |
{ |
2648 |
10 Sep 14 |
nicklas |
endTime = Reggie.autoFillTime(endTime); |
2648 |
10 Sep 14 |
nicklas |
frm.endTime.value = endTime; |
2648 |
10 Sep 14 |
nicklas |
513 |
|
2648 |
10 Sep 14 |
nicklas |
if (!Dates.isDate(endDate + ' ' + endTime, 'yyyyMMdd HHmm')) |
2648 |
10 Sep 14 |
nicklas |
515 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate', 'invalid', 'Not a valid time'); |
2648 |
10 Sep 14 |
nicklas |
return; |
2648 |
10 Sep 14 |
nicklas |
518 |
} |
2648 |
10 Sep 14 |
nicklas |
519 |
} |
2648 |
10 Sep 14 |
nicklas |
520 |
|
2648 |
10 Sep 14 |
nicklas |
521 |
|
2648 |
10 Sep 14 |
nicklas |
Wizard.setInputStatus('endDate', 'valid'); |
2648 |
10 Sep 14 |
nicklas |
endDateIsValid = true; |
2648 |
10 Sep 14 |
nicklas |
524 |
} |
2648 |
10 Sep 14 |
nicklas |
525 |
|
2648 |
10 Sep 14 |
nicklas |
526 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.submit = function() |
2648 |
10 Sep 14 |
nicklas |
528 |
{ |
2648 |
10 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2648 |
10 Sep 14 |
nicklas |
var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; |
2648 |
10 Sep 14 |
nicklas |
seqRun.endDate = Strings.trim(frm.endDate.value + ' ' + frm.endTime.value); |
3632 |
30 Nov 15 |
nicklas |
seqRun.comments = frm.comments.value; |
2648 |
10 Sep 14 |
nicklas |
533 |
|
2648 |
10 Sep 14 |
nicklas |
var submitInfo = {}; |
2648 |
10 Sep 14 |
nicklas |
submitInfo.sequencingRun = seqRun; |
3632 |
30 Nov 15 |
nicklas |
submitInfo.runParameters = runParameters; |
3632 |
30 Nov 15 |
nicklas |
537 |
|
2648 |
10 Sep 14 |
nicklas |
var url = '../SequencingRun.servlet?ID='+App.getSessionId(); |
5488 |
12 Jun 19 |
nicklas |
url += '&cmd=RegisterSequencingEnded&pipeline='+encodeURIComponent(Data.get('page-data', 'pipeline')); |
5488 |
12 Jun 19 |
nicklas |
540 |
|
2648 |
10 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
2648 |
10 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, sequencing.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2648 |
10 Sep 14 |
nicklas |
543 |
} |
2648 |
10 Sep 14 |
nicklas |
544 |
|
2648 |
10 Sep 14 |
nicklas |
sequencing.submissionResults = function(response) |
2648 |
10 Sep 14 |
nicklas |
546 |
{ |
2648 |
10 Sep 14 |
nicklas |
Wizard.showFinalMessage(response.messages); |
2648 |
10 Sep 14 |
nicklas |
Doc.show('gorestart'); |
2648 |
10 Sep 14 |
nicklas |
549 |
} |
2648 |
10 Sep 14 |
nicklas |
550 |
|
2648 |
10 Sep 14 |
nicklas |
return sequencing; |
2648 |
10 Sep 14 |
nicklas |
552 |
}(); |
2648 |
10 Sep 14 |
nicklas |
553 |
|
2648 |
10 Sep 14 |
nicklas |
Doc.onLoad(Sequencing.initPage); |
2648 |
10 Sep 14 |
nicklas |
555 |
|