6180 |
24 Mar 21 |
nicklas |
var Fastq = function() |
6180 |
24 Mar 21 |
nicklas |
2 |
{ |
6180 |
24 Mar 21 |
nicklas |
var fastq = {}; |
6935 |
05 Dec 22 |
nicklas |
var debug = 0; |
6180 |
24 Mar 21 |
nicklas |
var selectionIsValid = false; |
6180 |
24 Mar 21 |
nicklas |
var clusterIsValid = false; |
6180 |
24 Mar 21 |
nicklas |
7 |
|
6180 |
24 Mar 21 |
nicklas |
// Page initialization |
6180 |
24 Mar 21 |
nicklas |
fastq.initPage = function() |
6180 |
24 Mar 21 |
nicklas |
10 |
{ |
6180 |
24 Mar 21 |
nicklas |
11 |
|
6180 |
24 Mar 21 |
nicklas |
// Step 1 |
6215 |
16 Apr 21 |
nicklas |
Events.addEventHandler('demuxedSequences', 'change', fastq.demuxedSequencesOnChange); |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', fastq.validateStep1); |
6180 |
24 Mar 21 |
nicklas |
15 |
|
6180 |
24 Mar 21 |
nicklas |
// Step 2 |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', fastq.initializeStep2); |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', fastq.validateStep2); |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('clusters', 'change', fastq.clusterOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('debug', 'change', fastq.debugOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('override', 'change', fastq.overrideOnChange); |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('mergeSoftware', 'change', fastq.softwareOnChange); |
6180 |
24 Mar 21 |
nicklas |
23 |
|
6180 |
24 Mar 21 |
nicklas |
// Navigation |
6180 |
24 Mar 21 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
6180 |
24 Mar 21 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
6180 |
24 Mar 21 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
6180 |
24 Mar 21 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
6180 |
24 Mar 21 |
nicklas |
29 |
|
6180 |
24 Mar 21 |
nicklas |
// Final registration |
6180 |
24 Mar 21 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', fastq.submit); |
6180 |
24 Mar 21 |
nicklas |
32 |
|
6180 |
24 Mar 21 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
6180 |
24 Mar 21 |
nicklas |
var url = '../Fastq.servlet?ID='+App.getSessionId(); |
6215 |
16 Apr 21 |
nicklas |
url += '&cmd=GetDemuxedSequencesForImport'; |
6180 |
24 Mar 21 |
nicklas |
Wizard.asyncJsonRequest(url, fastq.initializeStep1); |
6180 |
24 Mar 21 |
nicklas |
37 |
} |
6180 |
24 Mar 21 |
nicklas |
38 |
|
6180 |
24 Mar 21 |
nicklas |
// --- Step 1 ----------------------------------- |
6180 |
24 Mar 21 |
nicklas |
fastq.initializeStep1 = function(response) |
6180 |
24 Mar 21 |
nicklas |
41 |
{ |
6215 |
16 Apr 21 |
nicklas |
var demuxedSequences = response.demuxedSequences; |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6215 |
16 Apr 21 |
nicklas |
if (demuxedSequences.length == 0) |
6180 |
24 Mar 21 |
nicklas |
45 |
{ |
6215 |
16 Apr 21 |
nicklas |
Wizard.setFatalError('No demuxed sequences available for importing.'); |
6180 |
24 Mar 21 |
nicklas |
return; |
6180 |
24 Mar 21 |
nicklas |
48 |
} |
6180 |
24 Mar 21 |
nicklas |
49 |
|
6180 |
24 Mar 21 |
nicklas |
var firstPlate = null; |
6215 |
16 Apr 21 |
nicklas |
for (var msNo=0; msNo < demuxedSequences.length; msNo++) |
6180 |
24 Mar 21 |
nicklas |
52 |
{ |
6215 |
16 Apr 21 |
nicklas |
var ms = demuxedSequences[msNo]; |
6180 |
24 Mar 21 |
nicklas |
var libPlate = ms.lib.bioWell ? ms.lib.bioWell.bioPlate : null; |
6180 |
24 Mar 21 |
nicklas |
if (firstPlate == null && libPlate != null) firstPlate = libPlate.name; |
6180 |
24 Mar 21 |
nicklas |
var option = fastq.createListOption(msNo+1, ms, ms.DO_NOT_USE == null && libPlate != null && libPlate.name==firstPlate) |
6215 |
16 Apr 21 |
nicklas |
frm.demuxedSequences.options[frm.demuxedSequences.length] = option; |
6180 |
24 Mar 21 |
nicklas |
58 |
} |
6215 |
16 Apr 21 |
nicklas |
Events.sendChangeEvent('demuxedSequences'); |
6180 |
24 Mar 21 |
nicklas |
60 |
|
6180 |
24 Mar 21 |
nicklas |
Doc.show('step-1'); |
6180 |
24 Mar 21 |
nicklas |
Doc.show('gonext'); |
6180 |
24 Mar 21 |
nicklas |
63 |
|
6215 |
16 Apr 21 |
nicklas |
frm.demuxedSequences.focus(); |
6180 |
24 Mar 21 |
nicklas |
65 |
} |
6180 |
24 Mar 21 |
nicklas |
66 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.validateStep1 = function(event) |
6180 |
24 Mar 21 |
nicklas |
68 |
{ |
6180 |
24 Mar 21 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
6180 |
24 Mar 21 |
nicklas |
70 |
} |
6180 |
24 Mar 21 |
nicklas |
71 |
|
6215 |
16 Apr 21 |
nicklas |
fastq.createListOption = function(index, demuxItem, selected) |
6180 |
24 Mar 21 |
nicklas |
73 |
{ |
6215 |
16 Apr 21 |
nicklas |
var lib = demuxItem.lib; |
6180 |
24 Mar 21 |
nicklas |
var isYellow = lib.specimen && lib.specimen.YellowLabel != null; |
6180 |
24 Mar 21 |
nicklas |
var libPlate = lib.bioWell ? lib.bioWell.bioPlate : null; |
6180 |
24 Mar 21 |
nicklas |
77 |
|
6180 |
24 Mar 21 |
nicklas |
var tooltip = null; |
6180 |
24 Mar 21 |
nicklas |
var name = (index) + ': '; |
6180 |
24 Mar 21 |
nicklas |
if (libPlate) name += libPlate.name + ' - '; |
6215 |
16 Apr 21 |
nicklas |
name += demuxItem.name; |
6180 |
24 Mar 21 |
nicklas |
82 |
|
6215 |
16 Apr 21 |
nicklas |
if (demuxItem.DO_NOT_USE) |
6180 |
24 Mar 21 |
nicklas |
84 |
{ |
6180 |
24 Mar 21 |
nicklas |
name += ' [DoNotUse]'; |
6215 |
16 Apr 21 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(demuxItem.DO_NOT_USE+': '+demuxItem.DO_NOT_USE_COMMENT); |
6180 |
24 Mar 21 |
nicklas |
87 |
} |
6215 |
16 Apr 21 |
nicklas |
else if (demuxItem.AutoProcess == 'ReProcess') |
6180 |
24 Mar 21 |
nicklas |
89 |
{ |
6180 |
24 Mar 21 |
nicklas |
name += ' [R]'; |
6180 |
24 Mar 21 |
nicklas |
91 |
} |
6180 |
24 Mar 21 |
nicklas |
92 |
|
6215 |
16 Apr 21 |
nicklas |
var option = new Option(name, demuxItem.id, false, selected); |
6180 |
24 Mar 21 |
nicklas |
if (isYellow) option.className = 'yellow'; |
6180 |
24 Mar 21 |
nicklas |
if (tooltip) option.title = tooltip; |
6215 |
16 Apr 21 |
nicklas |
option.demuxedSequences = demuxItem; |
6180 |
24 Mar 21 |
nicklas |
return option; |
6180 |
24 Mar 21 |
nicklas |
98 |
} |
6180 |
24 Mar 21 |
nicklas |
99 |
|
6215 |
16 Apr 21 |
nicklas |
fastq.demuxedSequencesOnChange = function() |
6180 |
24 Mar 21 |
nicklas |
101 |
{ |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6180 |
24 Mar 21 |
nicklas |
selectionIsValid = false; |
6180 |
24 Mar 21 |
nicklas |
var numSelected = 0; |
6180 |
24 Mar 21 |
nicklas |
var numDoNotUse = 0; |
6214 |
15 Apr 21 |
nicklas |
var invalidSelection = null; |
6180 |
24 Mar 21 |
nicklas |
107 |
|
6215 |
16 Apr 21 |
nicklas |
Wizard.setInputStatus('demuxedSequences'); |
6180 |
24 Mar 21 |
nicklas |
Wizard.hideGoNextConfirmation(); |
6215 |
16 Apr 21 |
nicklas |
for (var msNo = 0; msNo < frm.demuxedSequences.length; msNo++) |
6180 |
24 Mar 21 |
nicklas |
111 |
{ |
6215 |
16 Apr 21 |
nicklas |
if (frm.demuxedSequences[msNo].selected) |
6180 |
24 Mar 21 |
nicklas |
113 |
{ |
6180 |
24 Mar 21 |
nicklas |
numSelected++; |
6215 |
16 Apr 21 |
nicklas |
var ms = frm.demuxedSequences[msNo].demuxedSequences; |
6180 |
24 Mar 21 |
nicklas |
if (ms.DO_NOT_USE) numDoNotUse++; |
6180 |
24 Mar 21 |
nicklas |
if (ms.pipeline && ms.pipeline != 'RNAseq') |
6180 |
24 Mar 21 |
nicklas |
118 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the RNAseq pipeline.'; |
6180 |
24 Mar 21 |
nicklas |
120 |
} |
6214 |
15 Apr 21 |
nicklas |
else if (ms.rawFastq.length == 0) |
6213 |
15 Apr 21 |
nicklas |
122 |
{ |
6214 |
15 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(ms.name+' is missing RawFASTQ information'); |
6213 |
15 Apr 21 |
nicklas |
124 |
} |
6215 |
16 Apr 21 |
nicklas |
else if (!ms.DataFilesFolder) |
6214 |
15 Apr 21 |
nicklas |
126 |
{ |
6215 |
16 Apr 21 |
nicklas |
invalidSelection = Strings.encodeTags(ms.name+' is missing DataFilesFolder information'); |
6214 |
15 Apr 21 |
nicklas |
128 |
} |
6180 |
24 Mar 21 |
nicklas |
129 |
} |
6180 |
24 Mar 21 |
nicklas |
130 |
} |
6180 |
24 Mar 21 |
nicklas |
131 |
|
6180 |
24 Mar 21 |
nicklas |
if (numSelected == 0) |
6180 |
24 Mar 21 |
nicklas |
133 |
{ |
6215 |
16 Apr 21 |
nicklas |
Wizard.setInputStatus('demuxedSequences', 'invalid', 'Select at least one item'); |
6180 |
24 Mar 21 |
nicklas |
return; |
6180 |
24 Mar 21 |
nicklas |
136 |
} |
6214 |
15 Apr 21 |
nicklas |
if (invalidSelection) |
6180 |
24 Mar 21 |
nicklas |
138 |
{ |
6215 |
16 Apr 21 |
nicklas |
Wizard.setInputStatus('demuxedSequences', 'invalid', invalidSelection); |
6180 |
24 Mar 21 |
nicklas |
return; |
6180 |
24 Mar 21 |
nicklas |
141 |
} |
6180 |
24 Mar 21 |
nicklas |
selectionIsValid = true; |
6180 |
24 Mar 21 |
nicklas |
143 |
|
6180 |
24 Mar 21 |
nicklas |
if (numDoNotUse > 0) |
6180 |
24 Mar 21 |
nicklas |
145 |
{ |
6215 |
16 Apr 21 |
nicklas |
Wizard.setInputStatus('demuxedSequences', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
6180 |
24 Mar 21 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
6180 |
24 Mar 21 |
nicklas |
148 |
} |
6180 |
24 Mar 21 |
nicklas |
else |
6180 |
24 Mar 21 |
nicklas |
150 |
{ |
6215 |
16 Apr 21 |
nicklas |
Wizard.setInputStatus('demuxedSequences', 'valid'); |
6180 |
24 Mar 21 |
nicklas |
152 |
} |
6180 |
24 Mar 21 |
nicklas |
153 |
} |
6180 |
24 Mar 21 |
nicklas |
154 |
|
6180 |
24 Mar 21 |
nicklas |
// --- Step 2 ----------------------------------- |
6180 |
24 Mar 21 |
nicklas |
fastq.initializeStep2 = function() |
6180 |
24 Mar 21 |
nicklas |
157 |
{ |
6180 |
24 Mar 21 |
nicklas |
Wizard.setCurrentStep(2); |
6180 |
24 Mar 21 |
nicklas |
159 |
|
6180 |
24 Mar 21 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6180 |
24 Mar 21 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
6180 |
24 Mar 21 |
nicklas |
163 |
|
6213 |
15 Apr 21 |
nicklas |
Reggie.loadProtocols('MERGE_PROTOCOL', 'mergeProtocol', 'PIPELINE,MERGE_TYPE', 'RNAseq,Import'); |
6213 |
15 Apr 21 |
nicklas |
Reggie.loadSoftware('MERGE_SOFTWARE', 'mergeSoftware', 'PIPELINE,MERGE_TYPE,PARAMETER_SET', 'RNAseq,Import'); |
6180 |
24 Mar 21 |
nicklas |
166 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
7372 |
06 Oct 23 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=demux'; |
6180 |
24 Mar 21 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
6180 |
24 Mar 21 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
6180 |
24 Mar 21 |
nicklas |
Wizard.asyncJsonRequest(url, fastq.clustersLoaded); |
6180 |
24 Mar 21 |
nicklas |
172 |
|
6180 |
24 Mar 21 |
nicklas |
Doc.show('goregister'); |
6180 |
24 Mar 21 |
nicklas |
Doc.show('gocancel'); |
6180 |
24 Mar 21 |
nicklas |
175 |
} |
6180 |
24 Mar 21 |
nicklas |
176 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.validateStep2 = function(event) |
6180 |
24 Mar 21 |
nicklas |
178 |
{ |
6180 |
24 Mar 21 |
nicklas |
if (!clusterIsValid) event.preventDefault(); |
6180 |
24 Mar 21 |
nicklas |
180 |
} |
6180 |
24 Mar 21 |
nicklas |
181 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.clustersLoaded = function(response) |
6180 |
24 Mar 21 |
nicklas |
183 |
{ |
6180 |
24 Mar 21 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6180 |
24 Mar 21 |
nicklas |
var clusters = response.hosts; |
6180 |
24 Mar 21 |
nicklas |
frm.clusters.length = 0; |
6180 |
24 Mar 21 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
6180 |
24 Mar 21 |
nicklas |
189 |
{ |
6180 |
24 Mar 21 |
nicklas |
var cl = clusters[i]; |
6180 |
24 Mar 21 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
6180 |
24 Mar 21 |
nicklas |
option.cluster = cl; |
6180 |
24 Mar 21 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
6180 |
24 Mar 21 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
6180 |
24 Mar 21 |
nicklas |
clusterIsValid = true; |
6180 |
24 Mar 21 |
nicklas |
196 |
} |
6180 |
24 Mar 21 |
nicklas |
if (frm.clusters.length == 0) |
6180 |
24 Mar 21 |
nicklas |
198 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
6180 |
24 Mar 21 |
nicklas |
clusterIsValid = false; |
6180 |
24 Mar 21 |
nicklas |
201 |
} |
6180 |
24 Mar 21 |
nicklas |
else |
6180 |
24 Mar 21 |
nicklas |
203 |
{ |
6180 |
24 Mar 21 |
nicklas |
fastq.clusterOnChange(); |
6180 |
24 Mar 21 |
nicklas |
205 |
} |
6180 |
24 Mar 21 |
nicklas |
206 |
} |
6180 |
24 Mar 21 |
nicklas |
207 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.softwareOnChange = function(event) |
6180 |
24 Mar 21 |
nicklas |
209 |
{ |
6180 |
24 Mar 21 |
nicklas |
var target = event.currentTarget; |
6180 |
24 Mar 21 |
nicklas |
var item = target[target.selectedIndex].item; |
6180 |
24 Mar 21 |
nicklas |
if (!item) item = {}; |
6180 |
24 Mar 21 |
nicklas |
213 |
|
6180 |
24 Mar 21 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
6180 |
24 Mar 21 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
6180 |
24 Mar 21 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
6180 |
24 Mar 21 |
nicklas |
217 |
|
6180 |
24 Mar 21 |
nicklas |
if (item.ParameterSet) |
6180 |
24 Mar 21 |
nicklas |
219 |
{ |
6180 |
24 Mar 21 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
6180 |
24 Mar 21 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
6180 |
24 Mar 21 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
6180 |
24 Mar 21 |
nicklas |
url += '&targetId='+target.id; |
6180 |
24 Mar 21 |
nicklas |
Wizard.asyncJsonRequest(url, fastq.parameterSetInfoLoaded); |
6180 |
24 Mar 21 |
nicklas |
225 |
} |
7372 |
06 Oct 23 |
nicklas |
fastq.updateSubmitOptions(); |
6180 |
24 Mar 21 |
nicklas |
227 |
} |
6180 |
24 Mar 21 |
nicklas |
228 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.parameterSetInfoLoaded = function(response) |
6180 |
24 Mar 21 |
nicklas |
230 |
{ |
6180 |
24 Mar 21 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
6180 |
24 Mar 21 |
nicklas |
232 |
{ |
6180 |
24 Mar 21 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
6180 |
24 Mar 21 |
nicklas |
234 |
} |
6180 |
24 Mar 21 |
nicklas |
235 |
} |
6180 |
24 Mar 21 |
nicklas |
236 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.clusterOnChange = function() |
6180 |
24 Mar 21 |
nicklas |
238 |
{ |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6180 |
24 Mar 21 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
6180 |
24 Mar 21 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
6180 |
24 Mar 21 |
nicklas |
242 |
{ |
6180 |
24 Mar 21 |
nicklas |
frm.priority.length = 0; |
6180 |
24 Mar 21 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
6180 |
24 Mar 21 |
nicklas |
245 |
{ |
6180 |
24 Mar 21 |
nicklas |
var p = cluster.priorities[pNo]; |
6180 |
24 Mar 21 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
6180 |
24 Mar 21 |
nicklas |
248 |
} |
6180 |
24 Mar 21 |
nicklas |
Doc.show('job-priority'); |
6180 |
24 Mar 21 |
nicklas |
250 |
} |
6180 |
24 Mar 21 |
nicklas |
else |
6180 |
24 Mar 21 |
nicklas |
252 |
{ |
6180 |
24 Mar 21 |
nicklas |
Doc.hide('job-priority'); |
6180 |
24 Mar 21 |
nicklas |
254 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
256 |
{ |
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 |
259 |
{ |
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 |
264 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
266 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
268 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
270 |
} |
7372 |
06 Oct 23 |
nicklas |
fastq.updateSubmitOptions(); |
6180 |
24 Mar 21 |
nicklas |
272 |
} |
6180 |
24 Mar 21 |
nicklas |
273 |
|
7372 |
06 Oct 23 |
nicklas |
fastq.debugOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
275 |
{ |
7372 |
06 Oct 23 |
nicklas |
fastq.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
277 |
} |
7372 |
06 Oct 23 |
nicklas |
278 |
|
7372 |
06 Oct 23 |
nicklas |
fastq.updateSubmitOptions = function() |
7372 |
06 Oct 23 |
nicklas |
280 |
{ |
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) |
7372 |
06 Oct 23 |
nicklas |
284 |
{ |
7372 |
06 Oct 23 |
nicklas |
var parameterSet = frm.mergeSoftware[frm.mergeSoftware.selectedIndex]?.item?.ParameterSet; |
7372 |
06 Oct 23 |
nicklas |
Doc.element('submitOptions').innerHTML = Reggie.getSubmitOptions(config, frm.debug.checked, parameterSet, 'submit-import'); |
7372 |
06 Oct 23 |
nicklas |
frm.override.disabled = false; |
7372 |
06 Oct 23 |
nicklas |
288 |
} |
7372 |
06 Oct 23 |
nicklas |
289 |
} |
7372 |
06 Oct 23 |
nicklas |
290 |
|
7372 |
06 Oct 23 |
nicklas |
fastq.overrideOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
292 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
Doc.showHide('submitOptions', !frm.override.checked); |
7372 |
06 Oct 23 |
nicklas |
Doc.showHide('submitOptionsOverride', frm.override.checked); |
7372 |
06 Oct 23 |
nicklas |
if (frm.submitOptionsOverride.value=='') |
7372 |
06 Oct 23 |
nicklas |
297 |
{ |
7372 |
06 Oct 23 |
nicklas |
frm.submitOptionsOverride.value = Doc.element('submitOptions').innerHTML; |
7372 |
06 Oct 23 |
nicklas |
299 |
} |
7372 |
06 Oct 23 |
nicklas |
300 |
} |
6180 |
24 Mar 21 |
nicklas |
301 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.submit = function() |
6180 |
24 Mar 21 |
nicklas |
303 |
{ |
6180 |
24 Mar 21 |
nicklas |
var frm = document.forms['reggie']; |
6180 |
24 Mar 21 |
nicklas |
305 |
|
6180 |
24 Mar 21 |
nicklas |
var submitInfo = {}; |
6180 |
24 Mar 21 |
nicklas |
submitInfo.mergeSoftware = parseInt(frm.mergeSoftware.value); |
6180 |
24 Mar 21 |
nicklas |
submitInfo.mergeProtocol = parseInt(frm.mergeProtocol.value); |
6180 |
24 Mar 21 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
6180 |
24 Mar 21 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
6180 |
24 Mar 21 |
nicklas |
311 |
{ |
6180 |
24 Mar 21 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
6180 |
24 Mar 21 |
nicklas |
313 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
315 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
317 |
} |
7372 |
06 Oct 23 |
nicklas |
if (frm.override.checked) |
7372 |
06 Oct 23 |
nicklas |
319 |
{ |
7372 |
06 Oct 23 |
nicklas |
submitInfo.submitOptionsOverride = frm.submitOptionsOverride.value; |
7372 |
06 Oct 23 |
nicklas |
321 |
} |
6180 |
24 Mar 21 |
nicklas |
submitInfo.debug = frm.debug.checked; |
6180 |
24 Mar 21 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
6180 |
24 Mar 21 |
nicklas |
324 |
|
6215 |
16 Apr 21 |
nicklas |
var demuxedSequences = []; |
6215 |
16 Apr 21 |
nicklas |
submitInfo.demuxedSequences = demuxedSequences; |
6180 |
24 Mar 21 |
nicklas |
327 |
|
6215 |
16 Apr 21 |
nicklas |
for (var msNo = 0; msNo < frm.demuxedSequences.length; msNo++) |
6180 |
24 Mar 21 |
nicklas |
329 |
{ |
6215 |
16 Apr 21 |
nicklas |
if (frm.demuxedSequences[msNo].selected) |
6180 |
24 Mar 21 |
nicklas |
331 |
{ |
6180 |
24 Mar 21 |
nicklas |
var ms = {}; |
6215 |
16 Apr 21 |
nicklas |
ms.id = frm.demuxedSequences[msNo].demuxedSequences.id; |
6215 |
16 Apr 21 |
nicklas |
demuxedSequences[demuxedSequences.length] = ms; |
6180 |
24 Mar 21 |
nicklas |
335 |
} |
6180 |
24 Mar 21 |
nicklas |
336 |
} |
6180 |
24 Mar 21 |
nicklas |
337 |
|
6180 |
24 Mar 21 |
nicklas |
var url = '../Fastq.servlet?ID='+App.getSessionId(); |
6180 |
24 Mar 21 |
nicklas |
url += '&cmd=ImportFastq'; |
6180 |
24 Mar 21 |
nicklas |
340 |
|
6180 |
24 Mar 21 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
6180 |
24 Mar 21 |
nicklas |
Wizard.asyncJsonRequest(url, fastq.submissionResults, 'POST', JSON.stringify(submitInfo)); |
6180 |
24 Mar 21 |
nicklas |
343 |
} |
6180 |
24 Mar 21 |
nicklas |
344 |
|
6180 |
24 Mar 21 |
nicklas |
fastq.submissionResults = function(response) |
6180 |
24 Mar 21 |
nicklas |
346 |
{ |
6180 |
24 Mar 21 |
nicklas |
Wizard.showFinalMessage(response.messages); |
6180 |
24 Mar 21 |
nicklas |
Doc.show('gorestart'); |
6180 |
24 Mar 21 |
nicklas |
349 |
} |
6180 |
24 Mar 21 |
nicklas |
350 |
|
6180 |
24 Mar 21 |
nicklas |
return fastq; |
6180 |
24 Mar 21 |
nicklas |
352 |
}(); |
6180 |
24 Mar 21 |
nicklas |
353 |
|
6180 |
24 Mar 21 |
nicklas |
Doc.onLoad(Fastq.initPage); |
6180 |
24 Mar 21 |
nicklas |
355 |
|