5685 |
25 Oct 19 |
nicklas |
var VCall = function() |
5685 |
25 Oct 19 |
nicklas |
2 |
{ |
5685 |
25 Oct 19 |
nicklas |
var vcall = {}; |
5685 |
25 Oct 19 |
nicklas |
var debug = 0; |
5685 |
25 Oct 19 |
nicklas |
var selectionIsValid = false; |
5685 |
25 Oct 19 |
nicklas |
var subtypeAlignedSequences = null; |
5685 |
25 Oct 19 |
nicklas |
var annotationTypePipeline = null; |
5685 |
25 Oct 19 |
nicklas |
var fileTypeBAM = null; |
5685 |
25 Oct 19 |
nicklas |
9 |
|
5685 |
25 Oct 19 |
nicklas |
var clusterIsValid = false; |
5685 |
25 Oct 19 |
nicklas |
var manuallySelected = []; |
5685 |
25 Oct 19 |
nicklas |
12 |
|
5685 |
25 Oct 19 |
nicklas |
// Page initialization |
5685 |
25 Oct 19 |
nicklas |
vcall.initPage = function() |
5685 |
25 Oct 19 |
nicklas |
15 |
{ |
5685 |
25 Oct 19 |
nicklas |
16 |
|
5685 |
25 Oct 19 |
nicklas |
// Step 1 |
5685 |
25 Oct 19 |
nicklas |
Buttons.addClickHandler('btnSelectAlignedSequences', vcall.selectAlignedSequences); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('alignedSequences', 'base-selected', vcall.setAlignedSequenceCallback); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('alignedSequences', 'change', vcall.alignedSequencesOnChange); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', vcall.validateStep1); |
5685 |
25 Oct 19 |
nicklas |
22 |
|
5685 |
25 Oct 19 |
nicklas |
// Step 2 |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', vcall.initializeStep2); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', vcall.validateStep2); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('clusters', 'change', vcall.clusterOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('debug', 'change', vcall.debugOnChange); |
7372 |
06 Oct 23 |
nicklas |
Events.addEventHandler('override', 'change', vcall.overrideOnChange); |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('vcallSoftware', 'change', vcall.softwareOnChange); |
5685 |
25 Oct 19 |
nicklas |
30 |
|
5685 |
25 Oct 19 |
nicklas |
// Navigation |
5685 |
25 Oct 19 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
5685 |
25 Oct 19 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
5685 |
25 Oct 19 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
5685 |
25 Oct 19 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
5685 |
25 Oct 19 |
nicklas |
36 |
|
5685 |
25 Oct 19 |
nicklas |
// Final registration |
5685 |
25 Oct 19 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', vcall.submit); |
5685 |
25 Oct 19 |
nicklas |
39 |
|
5685 |
25 Oct 19 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
5685 |
25 Oct 19 |
nicklas |
var url = '../VariantCalling.servlet?ID='+App.getSessionId(); |
5685 |
25 Oct 19 |
nicklas |
url += '&cmd=GetAlignedSequencesForVariantCalling'; |
5685 |
25 Oct 19 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.initializeStep1); |
5685 |
25 Oct 19 |
nicklas |
44 |
} |
5685 |
25 Oct 19 |
nicklas |
45 |
|
5685 |
25 Oct 19 |
nicklas |
// --- Step 1 ----------------------------------- |
5685 |
25 Oct 19 |
nicklas |
vcall.initializeStep1 = function(response) |
5685 |
25 Oct 19 |
nicklas |
48 |
{ |
5685 |
25 Oct 19 |
nicklas |
var alignedSequences = response.alignedSequences; |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
51 |
|
5685 |
25 Oct 19 |
nicklas |
if (alignedSequences != null && alignedSequences.length > 0) |
5685 |
25 Oct 19 |
nicklas |
53 |
{ |
5685 |
25 Oct 19 |
nicklas |
var firstPlate = null; |
5685 |
25 Oct 19 |
nicklas |
for (var asNo=0; asNo < alignedSequences.length; asNo++) |
5685 |
25 Oct 19 |
nicklas |
56 |
{ |
5685 |
25 Oct 19 |
nicklas |
var as = alignedSequences[asNo]; |
5685 |
25 Oct 19 |
nicklas |
var libPlate = as.lib.bioWell ? as.lib.bioWell.bioPlate : null; |
5685 |
25 Oct 19 |
nicklas |
if (firstPlate == null && libPlate != null) firstPlate = libPlate.name; |
5685 |
25 Oct 19 |
nicklas |
var option = vcall.createListOption(asNo+1, as, as.DO_NOT_USE == null && libPlate != null && libPlate.name==firstPlate) |
5685 |
25 Oct 19 |
nicklas |
frm.alignedSequences.options[frm.alignedSequences.length] = option; |
5685 |
25 Oct 19 |
nicklas |
62 |
} |
5685 |
25 Oct 19 |
nicklas |
Events.sendChangeEvent('alignedSequences'); |
5685 |
25 Oct 19 |
nicklas |
64 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
66 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences', 'invalid', 'No new sequences available for processing'); |
5685 |
25 Oct 19 |
nicklas |
68 |
} |
5685 |
25 Oct 19 |
nicklas |
69 |
|
5685 |
25 Oct 19 |
nicklas |
Doc.show('step-1'); |
5685 |
25 Oct 19 |
nicklas |
Doc.show('gonext'); |
5685 |
25 Oct 19 |
nicklas |
72 |
|
5685 |
25 Oct 19 |
nicklas |
frm.alignedSequences.focus(); |
5685 |
25 Oct 19 |
nicklas |
74 |
} |
5685 |
25 Oct 19 |
nicklas |
75 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.validateStep1 = function(event) |
5685 |
25 Oct 19 |
nicklas |
77 |
{ |
5685 |
25 Oct 19 |
nicklas |
if (!selectionIsValid) event.preventDefault(); |
5685 |
25 Oct 19 |
nicklas |
79 |
} |
5685 |
25 Oct 19 |
nicklas |
80 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.selectAlignedSequences = function() |
5685 |
25 Oct 19 |
nicklas |
82 |
{ |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
if (frm.alignedSequences.disabled) return; |
5685 |
25 Oct 19 |
nicklas |
85 |
|
5685 |
25 Oct 19 |
nicklas |
if (subtypeAlignedSequences == null) |
5685 |
25 Oct 19 |
nicklas |
87 |
{ |
5685 |
25 Oct 19 |
nicklas |
subtypeAlignedSequences = Reggie.getSubtypeInfo('ALIGNED_SEQUENCES'); |
5685 |
25 Oct 19 |
nicklas |
89 |
} |
5685 |
25 Oct 19 |
nicklas |
if (fileTypeBAM == null) |
5685 |
25 Oct 19 |
nicklas |
91 |
{ |
5685 |
25 Oct 19 |
nicklas |
fileTypeBAM = Reggie.getDataFileTypeInfo('BAM'); |
5685 |
25 Oct 19 |
nicklas |
93 |
} |
5685 |
25 Oct 19 |
nicklas |
if (annotationTypePipeline == null) |
5685 |
25 Oct 19 |
nicklas |
95 |
{ |
5685 |
25 Oct 19 |
nicklas |
annotationTypePipeline = Reggie.getAnnotationTypeInfo('PIPELINE'); |
5685 |
25 Oct 19 |
nicklas |
97 |
} |
5685 |
25 Oct 19 |
nicklas |
98 |
|
5685 |
25 Oct 19 |
nicklas |
// Reset list |
5685 |
25 Oct 19 |
nicklas |
manuallySelected = []; |
5685 |
25 Oct 19 |
nicklas |
var url = '&resetTemporary=1'; |
5685 |
25 Oct 19 |
nicklas |
// Alignments with Hisat gives us 'AlignedSequences' items with 'alignment.bam' |
5685 |
25 Oct 19 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeAlignedSequences.id; |
5685 |
25 Oct 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('ยค'+fileTypeBAM.id+'(file.name)')+'=alignment.bam'; |
5685 |
25 Oct 19 |
nicklas |
url += '&tmpfilter:STRING:'+encodeURIComponent('#')+annotationTypePipeline.id+'='+encodeURIComponent('RNAseq/Hisat/StringTie'); |
5685 |
25 Oct 19 |
nicklas |
106 |
|
5685 |
25 Oct 19 |
nicklas |
Dialogs.selectItem('DERIVEDBIOASSAY', 'alignedSequences', 1, url); |
5685 |
25 Oct 19 |
nicklas |
108 |
} |
5685 |
25 Oct 19 |
nicklas |
109 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.setAlignedSequenceCallback = function(event) |
5685 |
25 Oct 19 |
nicklas |
111 |
{ |
5685 |
25 Oct 19 |
nicklas |
var ms = event.detail; |
5685 |
25 Oct 19 |
nicklas |
113 |
|
5685 |
25 Oct 19 |
nicklas |
var opt = Reggie.getListOption('alignedSequences', ms.id); |
5685 |
25 Oct 19 |
nicklas |
if (opt) |
5685 |
25 Oct 19 |
nicklas |
116 |
{ |
5685 |
25 Oct 19 |
nicklas |
opt.selected = true; |
5685 |
25 Oct 19 |
nicklas |
118 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
120 |
{ |
5685 |
25 Oct 19 |
nicklas |
manuallySelected[manuallySelected.length] = ms.id; |
5685 |
25 Oct 19 |
nicklas |
122 |
} |
5685 |
25 Oct 19 |
nicklas |
123 |
|
5685 |
25 Oct 19 |
nicklas |
if (ms.remaining == 0 && manuallySelected.length > 0) |
5685 |
25 Oct 19 |
nicklas |
125 |
{ |
5685 |
25 Oct 19 |
nicklas |
var url = '../VariantCalling.servlet?ID='+App.getSessionId(); |
5685 |
25 Oct 19 |
nicklas |
url += '&cmd=GetAlignedSequencesForVariantCalling'; |
5685 |
25 Oct 19 |
nicklas |
url += '&items='+manuallySelected.join(','); |
5685 |
25 Oct 19 |
nicklas |
Wizard.showLoadingAnimation('Loading bioassays...'); |
5685 |
25 Oct 19 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.manuallySelected); |
5685 |
25 Oct 19 |
nicklas |
131 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
133 |
{ |
5685 |
25 Oct 19 |
nicklas |
Events.sendChangeEvent('alignedSequences'); |
5685 |
25 Oct 19 |
nicklas |
135 |
} |
5685 |
25 Oct 19 |
nicklas |
136 |
} |
5685 |
25 Oct 19 |
nicklas |
137 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.manuallySelected = function(response) |
5685 |
25 Oct 19 |
nicklas |
139 |
{ |
5685 |
25 Oct 19 |
nicklas |
var alignedSequences = response.alignedSequences; |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
142 |
|
5685 |
25 Oct 19 |
nicklas |
if (alignedSequences != null && alignedSequences.length > 0) |
5685 |
25 Oct 19 |
nicklas |
144 |
{ |
5685 |
25 Oct 19 |
nicklas |
var offset = frm.alignedSequences.length+1; |
5685 |
25 Oct 19 |
nicklas |
for (var asNo=0; asNo < alignedSequences.length; asNo++) |
5685 |
25 Oct 19 |
nicklas |
147 |
{ |
5685 |
25 Oct 19 |
nicklas |
var as = alignedSequences[asNo]; |
5685 |
25 Oct 19 |
nicklas |
var option = vcall.createListOption(asNo+offset, as, as.DO_NOT_USE == null); |
5685 |
25 Oct 19 |
nicklas |
frm.alignedSequences.options[frm.alignedSequences.length] = option; |
5685 |
25 Oct 19 |
nicklas |
151 |
} |
5685 |
25 Oct 19 |
nicklas |
Events.sendChangeEvent('alignedSequences'); |
5685 |
25 Oct 19 |
nicklas |
153 |
} |
5685 |
25 Oct 19 |
nicklas |
154 |
} |
5685 |
25 Oct 19 |
nicklas |
155 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.createListOption = function(index, alignedItem, selected) |
5685 |
25 Oct 19 |
nicklas |
157 |
{ |
5685 |
25 Oct 19 |
nicklas |
var lib = alignedItem.lib; |
5685 |
25 Oct 19 |
nicklas |
var isYellow = lib.specimen && lib.specimen.YellowLabel != null; |
5685 |
25 Oct 19 |
nicklas |
var libPlate = lib.bioWell ? lib.bioWell.bioPlate : null; |
5685 |
25 Oct 19 |
nicklas |
161 |
|
5685 |
25 Oct 19 |
nicklas |
var tooltip = null; |
5685 |
25 Oct 19 |
nicklas |
var name = (index) + ': '; |
5685 |
25 Oct 19 |
nicklas |
if (libPlate) name += libPlate.name + ' - '; |
5685 |
25 Oct 19 |
nicklas |
name += alignedItem.name; |
5685 |
25 Oct 19 |
nicklas |
166 |
|
5713 |
12 Nov 19 |
nicklas |
var tags = []; |
5685 |
25 Oct 19 |
nicklas |
if (alignedItem.DO_NOT_USE) |
5685 |
25 Oct 19 |
nicklas |
169 |
{ |
5713 |
12 Nov 19 |
nicklas |
tags[tags.length] = 'DoNotUse'; |
5685 |
25 Oct 19 |
nicklas |
tooltip = 'DoNotUse-'+Strings.encodeTags(alignedItem.DO_NOT_USE+': '+alignedItem.DO_NOT_USE_COMMENT); |
5685 |
25 Oct 19 |
nicklas |
172 |
} |
5713 |
12 Nov 19 |
nicklas |
if (alignedItem.AutoProcess == 'ReProcess') |
5685 |
25 Oct 19 |
nicklas |
174 |
{ |
5713 |
12 Nov 19 |
nicklas |
tags[tags.length] = 'R'; |
5685 |
25 Oct 19 |
nicklas |
176 |
} |
5713 |
12 Nov 19 |
nicklas |
if (alignedItem.rawVariants) |
5713 |
12 Nov 19 |
nicklas |
178 |
{ |
5713 |
12 Nov 19 |
nicklas |
tags[tags.length] = 'V'; |
5713 |
12 Nov 19 |
nicklas |
180 |
} |
5713 |
12 Nov 19 |
nicklas |
if (tags.length) name += ' [' + tags.join('; ') + ']'; |
5685 |
25 Oct 19 |
nicklas |
182 |
|
5685 |
25 Oct 19 |
nicklas |
var option = new Option(name, alignedItem.id, false, selected); |
5685 |
25 Oct 19 |
nicklas |
if (isYellow) option.className = 'yellow'; |
5685 |
25 Oct 19 |
nicklas |
if (tooltip) option.title = tooltip; |
5685 |
25 Oct 19 |
nicklas |
option.alignedSequences = alignedItem; |
5685 |
25 Oct 19 |
nicklas |
return option; |
5685 |
25 Oct 19 |
nicklas |
188 |
} |
5685 |
25 Oct 19 |
nicklas |
189 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.alignedSequencesOnChange = function() |
5685 |
25 Oct 19 |
nicklas |
191 |
{ |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
selectionIsValid = false; |
5685 |
25 Oct 19 |
nicklas |
var numSelected = 0; |
5685 |
25 Oct 19 |
nicklas |
var numDoNotUse = 0; |
5685 |
25 Oct 19 |
nicklas |
var invalidPipeline = null; |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences'); |
5685 |
25 Oct 19 |
nicklas |
Wizard.hideGoNextConfirmation(); |
5685 |
25 Oct 19 |
nicklas |
199 |
|
5685 |
25 Oct 19 |
nicklas |
for (var asNo = 0; asNo < frm.alignedSequences.length; asNo++) |
5685 |
25 Oct 19 |
nicklas |
201 |
{ |
5685 |
25 Oct 19 |
nicklas |
if (frm.alignedSequences[asNo].selected) |
5685 |
25 Oct 19 |
nicklas |
203 |
{ |
5685 |
25 Oct 19 |
nicklas |
numSelected++; |
5685 |
25 Oct 19 |
nicklas |
var as = frm.alignedSequences[asNo].alignedSequences; |
5685 |
25 Oct 19 |
nicklas |
if (as.DO_NOT_USE) numDoNotUse++; |
5685 |
25 Oct 19 |
nicklas |
if (as.pipeline && as.pipeline != 'RNAseq/Hisat/StringTie') |
5685 |
25 Oct 19 |
nicklas |
208 |
{ |
5685 |
25 Oct 19 |
nicklas |
invalidPipeline = Strings.encodeTags(as.name+' ('+as.pipeline)+') is not intended for the RNAseq/Hisat/StringTie pipeline.'; |
5685 |
25 Oct 19 |
nicklas |
210 |
} |
5685 |
25 Oct 19 |
nicklas |
211 |
} |
5685 |
25 Oct 19 |
nicklas |
212 |
} |
5685 |
25 Oct 19 |
nicklas |
213 |
|
5685 |
25 Oct 19 |
nicklas |
if (numSelected == 0) |
5685 |
25 Oct 19 |
nicklas |
215 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences', 'invalid', 'Select at least one item'); |
5685 |
25 Oct 19 |
nicklas |
return; |
5685 |
25 Oct 19 |
nicklas |
218 |
} |
5685 |
25 Oct 19 |
nicklas |
if (invalidPipeline) |
5685 |
25 Oct 19 |
nicklas |
220 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences', 'invalid', invalidPipeline); |
5685 |
25 Oct 19 |
nicklas |
return; |
5685 |
25 Oct 19 |
nicklas |
223 |
} |
5685 |
25 Oct 19 |
nicklas |
selectionIsValid = true; |
5685 |
25 Oct 19 |
nicklas |
225 |
|
5685 |
25 Oct 19 |
nicklas |
if (numDoNotUse > 0) |
5685 |
25 Oct 19 |
nicklas |
227 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences', 'warning', numDoNotUse + ' selected items marked as DoNotUse'); |
5685 |
25 Oct 19 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Confirm ' + numDoNotUse + ' items marked as DoNotUse'); |
5685 |
25 Oct 19 |
nicklas |
230 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
232 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('alignedSequences', 'valid'); |
5685 |
25 Oct 19 |
nicklas |
234 |
} |
5685 |
25 Oct 19 |
nicklas |
235 |
} |
5685 |
25 Oct 19 |
nicklas |
236 |
|
5685 |
25 Oct 19 |
nicklas |
// --- Step 2 ----------------------------------- |
5685 |
25 Oct 19 |
nicklas |
vcall.initializeStep2 = function() |
5685 |
25 Oct 19 |
nicklas |
239 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setCurrentStep(2); |
5685 |
25 Oct 19 |
nicklas |
241 |
|
5685 |
25 Oct 19 |
nicklas |
// Check debug by default if debug is set or not on a secure server (=production server) |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
frm.debug.checked = debug || location.protocol != 'https:'; |
5685 |
25 Oct 19 |
nicklas |
245 |
|
7400 |
07 Nov 23 |
nicklas |
Reggie.loadSoftware('VARIANT_CALLING_SOFTWARE', 'vcallSoftware', 'VARIANT_CALL_TYPE,PIPELINE,PARAMETER_SET', 'VariantCall,RNAseq/Hisat/VariantCall'); |
5685 |
25 Oct 19 |
nicklas |
247 |
|
6735 |
09 May 22 |
nicklas |
// Load clusters |
6633 |
08 Mar 22 |
nicklas |
var url = '../OpenGrid.servlet?ID='+App.getSessionId() + '&cmd=GetHostInfo&config=variant-call'; |
5685 |
25 Oct 19 |
nicklas |
Doc.addClass('clusters', 'list-loading'); |
5685 |
25 Oct 19 |
nicklas |
frm.clusters[0] = new Option('loading...'); |
5685 |
25 Oct 19 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.clustersLoaded); |
5685 |
25 Oct 19 |
nicklas |
253 |
|
5685 |
25 Oct 19 |
nicklas |
Doc.show('goregister'); |
5685 |
25 Oct 19 |
nicklas |
Doc.show('gocancel'); |
5685 |
25 Oct 19 |
nicklas |
256 |
} |
5685 |
25 Oct 19 |
nicklas |
257 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.validateStep2 = function(event) |
5685 |
25 Oct 19 |
nicklas |
259 |
{ |
5685 |
25 Oct 19 |
nicklas |
if (!clusterIsValid) event.preventDefault(); |
5685 |
25 Oct 19 |
nicklas |
261 |
} |
5685 |
25 Oct 19 |
nicklas |
262 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.clustersLoaded = function(response) |
5685 |
25 Oct 19 |
nicklas |
264 |
{ |
5685 |
25 Oct 19 |
nicklas |
Doc.removeClass('clusters', 'list-loading'); |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
var clusters = response.hosts; |
5685 |
25 Oct 19 |
nicklas |
frm.clusters.length = 0; |
5685 |
25 Oct 19 |
nicklas |
for (var i = 0; i < clusters.length; i++) |
5685 |
25 Oct 19 |
nicklas |
270 |
{ |
5685 |
25 Oct 19 |
nicklas |
var cl = clusters[i]; |
5685 |
25 Oct 19 |
nicklas |
var option = new Option(cl.connection.name, cl.id); |
5685 |
25 Oct 19 |
nicklas |
option.cluster = cl; |
5685 |
25 Oct 19 |
nicklas |
frm.clusters[frm.clusters.length] = option; |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus('clusters', 'valid'); |
5685 |
25 Oct 19 |
nicklas |
clusterIsValid = true; |
5685 |
25 Oct 19 |
nicklas |
277 |
} |
5685 |
25 Oct 19 |
nicklas |
if (frm.clusters.length == 0) |
5685 |
25 Oct 19 |
nicklas |
279 |
{ |
6735 |
09 May 22 |
nicklas |
Wizard.setInputStatus('clusters', 'invalid', 'No available clusters'); |
5685 |
25 Oct 19 |
nicklas |
clusterIsValid = false; |
5685 |
25 Oct 19 |
nicklas |
282 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
284 |
{ |
5685 |
25 Oct 19 |
nicklas |
vcall.clusterOnChange(); |
5685 |
25 Oct 19 |
nicklas |
286 |
} |
5685 |
25 Oct 19 |
nicklas |
287 |
} |
5685 |
25 Oct 19 |
nicklas |
288 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.softwareOnChange = function(event) |
5685 |
25 Oct 19 |
nicklas |
290 |
{ |
5685 |
25 Oct 19 |
nicklas |
var target = event.currentTarget; |
5685 |
25 Oct 19 |
nicklas |
var item = target[target.selectedIndex].item; |
5685 |
25 Oct 19 |
nicklas |
if (!item) item = {}; |
5685 |
25 Oct 19 |
nicklas |
294 |
|
5685 |
25 Oct 19 |
nicklas |
Doc.element(target.id+'.parameterSet').innerHTML = Strings.encodeTags(item.ParameterSet || 'default'); |
5685 |
25 Oct 19 |
nicklas |
Doc.element(target.id+'.description').innerHTML = Strings.encodeTags(item.description); |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus(target.id, 'valid'); |
5685 |
25 Oct 19 |
nicklas |
298 |
|
5685 |
25 Oct 19 |
nicklas |
if (item.ParameterSet) |
5685 |
25 Oct 19 |
nicklas |
300 |
{ |
5685 |
25 Oct 19 |
nicklas |
var url = '../Install.servlet?ID='+App.getSessionId(); |
5685 |
25 Oct 19 |
nicklas |
url += '&cmd=GetParameterSetInfo'; |
5685 |
25 Oct 19 |
nicklas |
url += '¶meterSet='+encodeURIComponent(item.ParameterSet); |
5685 |
25 Oct 19 |
nicklas |
url += '&targetId='+target.id; |
5685 |
25 Oct 19 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.parameterSetInfoLoaded); |
5685 |
25 Oct 19 |
nicklas |
306 |
} |
7372 |
06 Oct 23 |
nicklas |
vcall.updateSubmitOptions(); |
5685 |
25 Oct 19 |
nicklas |
308 |
} |
5685 |
25 Oct 19 |
nicklas |
309 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.parameterSetInfoLoaded = function(response) |
5685 |
25 Oct 19 |
nicklas |
311 |
{ |
5685 |
25 Oct 19 |
nicklas |
if (!response.parameters || response.parameters.length == 0) |
5685 |
25 Oct 19 |
nicklas |
313 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.setInputStatus(response.targetId, 'warning', 'Can\'t find \'' + Strings.encodeTags(response.parameterSet) + '\' parameter set in reggie-config.xml'); |
5685 |
25 Oct 19 |
nicklas |
315 |
} |
5685 |
25 Oct 19 |
nicklas |
316 |
} |
5685 |
25 Oct 19 |
nicklas |
317 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.clusterOnChange = function() |
5685 |
25 Oct 19 |
nicklas |
319 |
{ |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
var cluster = frm.clusters[frm.clusters.selectedIndex].cluster; |
5685 |
25 Oct 19 |
nicklas |
if (cluster.priorities && cluster.priorities.length > 0) |
5685 |
25 Oct 19 |
nicklas |
323 |
{ |
5685 |
25 Oct 19 |
nicklas |
frm.priority.length = 0; |
5685 |
25 Oct 19 |
nicklas |
for (var pNo = 0; pNo < cluster.priorities.length; pNo++) |
5685 |
25 Oct 19 |
nicklas |
326 |
{ |
5685 |
25 Oct 19 |
nicklas |
var p = cluster.priorities[pNo]; |
5685 |
25 Oct 19 |
nicklas |
frm.priority[frm.priority.length] = new Option(p.name + ' ('+p.value+')', p.value, p['default'], p['default']); |
5685 |
25 Oct 19 |
nicklas |
329 |
} |
5685 |
25 Oct 19 |
nicklas |
Doc.show('job-priority'); |
5685 |
25 Oct 19 |
nicklas |
331 |
} |
5685 |
25 Oct 19 |
nicklas |
else |
5685 |
25 Oct 19 |
nicklas |
333 |
{ |
5685 |
25 Oct 19 |
nicklas |
Doc.hide('job-priority'); |
5685 |
25 Oct 19 |
nicklas |
335 |
} |
6980 |
17 Jan 23 |
nicklas |
if (cluster.partitions && cluster.partitions.length > 0) |
6980 |
17 Jan 23 |
nicklas |
337 |
{ |
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 |
340 |
{ |
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 |
345 |
} |
6980 |
17 Jan 23 |
nicklas |
Doc.show('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
347 |
} |
6980 |
17 Jan 23 |
nicklas |
else |
6980 |
17 Jan 23 |
nicklas |
349 |
{ |
6980 |
17 Jan 23 |
nicklas |
Doc.hide('job-partition'); |
6980 |
17 Jan 23 |
nicklas |
351 |
} |
7372 |
06 Oct 23 |
nicklas |
vcall.updateSubmitOptions(); |
5685 |
25 Oct 19 |
nicklas |
353 |
} |
7372 |
06 Oct 23 |
nicklas |
354 |
|
7372 |
06 Oct 23 |
nicklas |
vcall.debugOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
356 |
{ |
7372 |
06 Oct 23 |
nicklas |
vcall.updateSubmitOptions(); |
7372 |
06 Oct 23 |
nicklas |
358 |
} |
7372 |
06 Oct 23 |
nicklas |
359 |
|
7372 |
06 Oct 23 |
nicklas |
vcall.updateSubmitOptions = function() |
7372 |
06 Oct 23 |
nicklas |
361 |
{ |
7372 |
06 Oct 23 |
nicklas |
var frm = document.forms['reggie']; |
7372 |
06 Oct 23 |
nicklas |
var config = frm.clusters[frm.clusters.selectedIndex]?.cluster?.config?.['variant-call']; |
7372 |
06 Oct 23 |
nicklas |
if (config) |
7372 |
06 Oct 23 |
nicklas |
365 |
{ |
7372 |
06 Oct 23 |
nicklas |
var parameterSet = frm.vcallSoftware[frm.vcallSoftware.selectedIndex]?.item?.ParameterSet; |
7372 |
06 Oct 23 |
nicklas |
Doc.element('submitOptions').innerHTML = Reggie.getSubmitOptions(config, frm.debug.checked, parameterSet); |
7372 |
06 Oct 23 |
nicklas |
frm.override.disabled = false; |
7372 |
06 Oct 23 |
nicklas |
369 |
} |
7372 |
06 Oct 23 |
nicklas |
370 |
} |
7372 |
06 Oct 23 |
nicklas |
371 |
|
7372 |
06 Oct 23 |
nicklas |
vcall.overrideOnChange = function() |
7372 |
06 Oct 23 |
nicklas |
373 |
{ |
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 |
378 |
{ |
7372 |
06 Oct 23 |
nicklas |
frm.submitOptionsOverride.value = Doc.element('submitOptions').innerHTML; |
7372 |
06 Oct 23 |
nicklas |
380 |
} |
7372 |
06 Oct 23 |
nicklas |
381 |
} |
5685 |
25 Oct 19 |
nicklas |
382 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.submit = function() |
5685 |
25 Oct 19 |
nicklas |
384 |
{ |
5685 |
25 Oct 19 |
nicklas |
var frm = document.forms['reggie']; |
5685 |
25 Oct 19 |
nicklas |
386 |
|
5685 |
25 Oct 19 |
nicklas |
var submitInfo = {}; |
5713 |
12 Nov 19 |
nicklas |
submitInfo.skipRaw = frm.skipRaw.checked; |
5714 |
12 Nov 19 |
nicklas |
submitInfo.rawOnly = frm['callType.rawOnly'].checked; |
5685 |
25 Oct 19 |
nicklas |
submitInfo.vcallSoftware = parseInt(frm.vcallSoftware.value); |
5685 |
25 Oct 19 |
nicklas |
submitInfo.cluster = frm.clusters.value; |
5685 |
25 Oct 19 |
nicklas |
if (frm.priority.selectedIndex >= 0) |
5685 |
25 Oct 19 |
nicklas |
393 |
{ |
5685 |
25 Oct 19 |
nicklas |
submitInfo.priority = parseInt(frm.priority.value); |
5685 |
25 Oct 19 |
nicklas |
395 |
} |
6980 |
17 Jan 23 |
nicklas |
if (frm.partition.selectedIndex >= 0) |
6980 |
17 Jan 23 |
nicklas |
397 |
{ |
6980 |
17 Jan 23 |
nicklas |
submitInfo.partition = frm.partition.value; |
6980 |
17 Jan 23 |
nicklas |
399 |
} |
7372 |
06 Oct 23 |
nicklas |
if (frm.override.checked) |
7372 |
06 Oct 23 |
nicklas |
401 |
{ |
7372 |
06 Oct 23 |
nicklas |
submitInfo.submitOptionsOverride = frm.submitOptionsOverride.value; |
7372 |
06 Oct 23 |
nicklas |
403 |
} |
5685 |
25 Oct 19 |
nicklas |
submitInfo.debug = frm.debug.checked; |
5685 |
25 Oct 19 |
nicklas |
submitInfo.autoConfirm = frm.autoConfirm.checked; |
5685 |
25 Oct 19 |
nicklas |
406 |
|
5685 |
25 Oct 19 |
nicklas |
var alignedSequences = []; |
5685 |
25 Oct 19 |
nicklas |
submitInfo.alignedSequences = alignedSequences; |
5685 |
25 Oct 19 |
nicklas |
409 |
|
5685 |
25 Oct 19 |
nicklas |
for (var asNo = 0; asNo < frm.alignedSequences.length; asNo++) |
5685 |
25 Oct 19 |
nicklas |
411 |
{ |
5685 |
25 Oct 19 |
nicklas |
if (frm.alignedSequences[asNo].selected) |
5685 |
25 Oct 19 |
nicklas |
413 |
{ |
5685 |
25 Oct 19 |
nicklas |
var as = {}; |
5685 |
25 Oct 19 |
nicklas |
as.id = frm.alignedSequences[asNo].alignedSequences.id; |
5685 |
25 Oct 19 |
nicklas |
alignedSequences[alignedSequences.length] = as; |
5685 |
25 Oct 19 |
nicklas |
417 |
} |
5685 |
25 Oct 19 |
nicklas |
418 |
} |
5685 |
25 Oct 19 |
nicklas |
419 |
|
5685 |
25 Oct 19 |
nicklas |
var url = '../VariantCalling.servlet?ID='+App.getSessionId(); |
5685 |
25 Oct 19 |
nicklas |
url += '&cmd=StartVariantCalling'; |
5685 |
25 Oct 19 |
nicklas |
422 |
|
5685 |
25 Oct 19 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
5685 |
25 Oct 19 |
nicklas |
Wizard.asyncJsonRequest(url, vcall.submissionResults, 'POST', JSON.stringify(submitInfo)); |
5685 |
25 Oct 19 |
nicklas |
425 |
} |
5685 |
25 Oct 19 |
nicklas |
426 |
|
5685 |
25 Oct 19 |
nicklas |
vcall.submissionResults = function(response) |
5685 |
25 Oct 19 |
nicklas |
428 |
{ |
5685 |
25 Oct 19 |
nicklas |
Wizard.showFinalMessage(response.messages); |
5685 |
25 Oct 19 |
nicklas |
Doc.show('gorestart'); |
5685 |
25 Oct 19 |
nicklas |
431 |
} |
5685 |
25 Oct 19 |
nicklas |
432 |
|
5685 |
25 Oct 19 |
nicklas |
return vcall; |
5685 |
25 Oct 19 |
nicklas |
434 |
}(); |
5685 |
25 Oct 19 |
nicklas |
435 |
|
5685 |
25 Oct 19 |
nicklas |
Doc.onLoad(VCall.initPage); |
5685 |
25 Oct 19 |
nicklas |
437 |
|