2688 |
23 Sep 14 |
nicklas |
var ExtractionReg = function() |
2688 |
23 Sep 14 |
nicklas |
2 |
{ |
2688 |
23 Sep 14 |
nicklas |
var exreg = {}; |
5607 |
16 Sep 19 |
nicklas |
var debug = 0; |
2688 |
23 Sep 14 |
nicklas |
5 |
|
3468 |
26 Aug 15 |
nicklas |
// QIAcube positions to be used for a given number of samples |
3468 |
26 Aug 15 |
nicklas |
// Ordered from 1 to 12 samples |
3468 |
26 Aug 15 |
nicklas |
var QIACUBE_POS = [ |
3468 |
26 Aug 15 |
nicklas |
[1], |
3468 |
26 Aug 15 |
nicklas |
[1, 7], |
3468 |
26 Aug 15 |
nicklas |
[1, 5, 9], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 7, 8], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 5, 8, 9], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 7, 8, 9], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 6, 7, 9, 10], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 4, 7, 8, 9, 10], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 5, 6, 7, 9, 10, 11], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 4, 5, 7, 8, 9, 10, 11], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], |
3468 |
26 Aug 15 |
nicklas |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] |
3468 |
26 Aug 15 |
nicklas |
21 |
]; |
3468 |
26 Aug 15 |
nicklas |
22 |
|
3468 |
26 Aug 15 |
nicklas |
var selectedLysates; |
4094 |
12 Sep 16 |
nicklas |
var allLysatesAreReExtraction; |
3468 |
26 Aug 15 |
nicklas |
25 |
|
3168 |
05 Mar 15 |
nicklas |
var latestRna; |
3168 |
05 Mar 15 |
nicklas |
var latestLysate; |
3168 |
05 Mar 15 |
nicklas |
28 |
|
2690 |
24 Sep 14 |
nicklas |
exreg.REAGENTS = [ |
2690 |
24 Sep 14 |
nicklas |
'rltPlusBuffer', 'betaMercaptoetanol', 'reagentDx', 'qiaShredderColumn', |
2690 |
24 Sep 14 |
nicklas |
'allPrepMiniKit', 'etoh70', 'bufferRw1', 'bufferRpe', 'bufferAw1', |
2690 |
24 Sep 14 |
nicklas |
'bufferAw2', 'bufferEb', 'rnaseFreeWater', 'allPrepDnaColumn', 'rneasyColumn' |
2690 |
24 Sep 14 |
nicklas |
33 |
]; |
2690 |
24 Sep 14 |
nicklas |
34 |
|
2690 |
24 Sep 14 |
nicklas |
35 |
|
2688 |
23 Sep 14 |
nicklas |
var DEFAULT_LYSATE_VOLUME = 700; |
2688 |
23 Sep 14 |
nicklas |
var DEFAULT_LYSATE_USED = 350; |
2688 |
23 Sep 14 |
nicklas |
var DEFAULT_DNA_VOLUME = 95; |
3545 |
16 Oct 15 |
nicklas |
var DEFAULT_RNA_VOLUME = 53; |
2688 |
23 Sep 14 |
nicklas |
var DEFAULT_FT_VOLUME = 550; |
5356 |
12 Apr 19 |
nicklas |
var MINIMAL_PRE_NORMALIZE_QUANTITY_RNA = 0; // µg, =0 since we no longer handle NotEnoughQuantity in this wizard |
5356 |
12 Apr 19 |
nicklas |
var MINIMAL_PRE_NORMALIZE_QUANTITY_DNA = 0; // µg, =0 since we no longer handle NotEnoughQuantity in this wizard |
2688 |
23 Sep 14 |
nicklas |
43 |
|
5591 |
04 Sep 19 |
nicklas |
var ENABLE_DNA_PRENORMALIZE = false; // Changed to TRUE if we find at least one protocol with subtype DNANormalization |
5591 |
04 Sep 19 |
nicklas |
var ENABLE_RNA_PRENORMALIZE = false; // Changed to TRUE if we find at least one protocol with subtype RNANormalization |
5591 |
04 Sep 19 |
nicklas |
46 |
|
2688 |
23 Sep 14 |
nicklas |
var lysatesIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
var qiacubeDateIsAfterLysisDate = true; |
2688 |
23 Sep 14 |
nicklas |
var qiacubeRunNoIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
var qiacubePositionsAreValid = false; |
2688 |
23 Sep 14 |
nicklas |
var nanoDropFileIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
var createdRna = []; |
2688 |
23 Sep 14 |
nicklas |
53 |
|
2688 |
23 Sep 14 |
nicklas |
// Page initialization |
2688 |
23 Sep 14 |
nicklas |
exreg.initPage = function() |
2688 |
23 Sep 14 |
nicklas |
56 |
{ |
2688 |
23 Sep 14 |
nicklas |
// Step 1 |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', exreg.validateStep1); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('lysates', 'change', exreg.lysatesOnChange); |
4099 |
14 Sep 16 |
nicklas |
Events.addEventHandler('reextraction', 'change', exreg.lysatesOnChange); |
5304 |
15 Feb 19 |
nicklas |
Buttons.addClickHandler('downloadLabelsCsv', exreg.downloadLabels); |
5304 |
15 Feb 19 |
nicklas |
Buttons.addClickHandler('downloadLabelsXlsx', exreg.downloadLabels); |
2688 |
23 Sep 14 |
nicklas |
63 |
|
2688 |
23 Sep 14 |
nicklas |
// Step 2 |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', exreg.initializeStep2); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', exreg.validateStep2); |
2688 |
23 Sep 14 |
nicklas |
67 |
|
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('lysisDate', 'change', Wizard.validateDate); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('qiacubeDate', 'change', Wizard.validateDate); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('lysisDate', 'change', exreg.qiacubeDateOnChange); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('qiacubeDate', 'change', exreg.qiacubeDateOnChange); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('qiacubeRunNo', 'change', exreg.qiacubeRunNoOnChange); |
2688 |
23 Sep 14 |
nicklas |
73 |
|
3168 |
05 Mar 15 |
nicklas |
Buttons.addClickHandler('btnUseLatestLysateReagents', exreg.useLatestReagents); |
3168 |
05 Mar 15 |
nicklas |
Buttons.addClickHandler('btnUseLatestRnaReagents', exreg.useLatestReagents); |
3168 |
05 Mar 15 |
nicklas |
76 |
|
2688 |
23 Sep 14 |
nicklas |
// Step 3 |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('step-3', 'wizard-initialize', exreg.initializeStep3); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('step-3', 'wizard-validate', exreg.validateStep3); |
2688 |
23 Sep 14 |
nicklas |
80 |
|
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('downloadSampleIdFile', exreg.downloadSampleIdFile); |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('btnFakeNanoFropFile', exreg.generateFakeNanoDropFile); |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('nanoDropFile', 'change', exreg.nanoDropFileOnChange); |
2688 |
23 Sep 14 |
nicklas |
84 |
|
2688 |
23 Sep 14 |
nicklas |
// Navigation |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler('rnaQcWizard', exreg.goRnaQc); |
2688 |
23 Sep 14 |
nicklas |
91 |
|
2688 |
23 Sep 14 |
nicklas |
// Final registration |
2688 |
23 Sep 14 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', exreg.submit); |
2688 |
23 Sep 14 |
nicklas |
94 |
|
2688 |
23 Sep 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
4094 |
12 Sep 16 |
nicklas |
url += '&cmd=GetUnprocessedLysates&includeReprocess=1'; |
2688 |
23 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Loading Lysate extracts...'); |
2688 |
23 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.initializeStep1); |
2688 |
23 Sep 14 |
nicklas |
99 |
} |
2688 |
23 Sep 14 |
nicklas |
100 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.initializeStep1 = function(response) |
2688 |
23 Sep 14 |
nicklas |
102 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var lysates = response.lysates; |
2688 |
23 Sep 14 |
nicklas |
105 |
|
2688 |
23 Sep 14 |
nicklas |
var lysateList = frm.lysates; |
4099 |
14 Sep 16 |
nicklas |
var reextractList = frm.reextraction; |
2688 |
23 Sep 14 |
nicklas |
if (lysates.length > 0) |
2688 |
23 Sep 14 |
nicklas |
109 |
{ |
3469 |
27 Aug 15 |
nicklas |
// Check if we have any lysate reserved by the current user |
3740 |
11 Feb 16 |
nicklas |
// and count the number of YellowLabel specimen |
3469 |
27 Aug 15 |
nicklas |
var currentUser = Data.get(lysateList, 'current-user'); |
3469 |
27 Aug 15 |
nicklas |
var hasReserved = false; |
3740 |
11 Feb 16 |
nicklas |
var numYellow = 0; |
2688 |
23 Sep 14 |
nicklas |
for (var i=0; i < lysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
116 |
{ |
3740 |
11 Feb 16 |
nicklas |
var lysate = lysates[i]; |
3740 |
11 Feb 16 |
nicklas |
if (lysate.ReservedBy == currentUser) hasReserved = true; |
3740 |
11 Feb 16 |
nicklas |
if (lysate.specimen.YellowLabel != null) numYellow++; |
4094 |
12 Sep 16 |
nicklas |
lysate.isReProcess = lysate.AutoProcessing == 'ReProcess'; |
3469 |
27 Aug 15 |
nicklas |
121 |
} |
3469 |
27 Aug 15 |
nicklas |
122 |
|
3469 |
27 Aug 15 |
nicklas |
var numSelected = 0; |
3740 |
11 Feb 16 |
nicklas |
var maxNonYellow = 12-numYellow; |
3469 |
27 Aug 15 |
nicklas |
for (var i=0; i < lysates.length; i++) |
3469 |
27 Aug 15 |
nicklas |
126 |
{ |
2688 |
23 Sep 14 |
nicklas |
var lysate = lysates[i]; |
3740 |
11 Feb 16 |
nicklas |
var isYellow = lysate.specimen.YellowLabel != null; |
2688 |
23 Sep 14 |
nicklas |
var name = (i+1) + ': ' + Strings.encodeTags(lysate.name); |
2688 |
23 Sep 14 |
nicklas |
if (lysate.bioWell) |
2688 |
23 Sep 14 |
nicklas |
131 |
{ |
2688 |
23 Sep 14 |
nicklas |
name += ' -- ' + Strings.encodeTags(lysate.bioWell.bioPlate.name + ' (' + lysate.bioWell.location+')'); |
2688 |
23 Sep 14 |
nicklas |
133 |
} |
3469 |
27 Aug 15 |
nicklas |
if (lysate.ReservedBy) |
3469 |
27 Aug 15 |
nicklas |
135 |
{ |
3469 |
27 Aug 15 |
nicklas |
name += ' ['+lysate.ReservedBy+']'; |
3469 |
27 Aug 15 |
nicklas |
137 |
} |
3469 |
27 Aug 15 |
nicklas |
138 |
|
3469 |
27 Aug 15 |
nicklas |
// We only auto-select items reserved by the current user (if it has any) |
3469 |
27 Aug 15 |
nicklas |
// and never any items reserved by other users |
3469 |
27 Aug 15 |
nicklas |
var selected = false; |
3469 |
27 Aug 15 |
nicklas |
if (numSelected < 12) |
3469 |
27 Aug 15 |
nicklas |
143 |
{ |
3740 |
11 Feb 16 |
nicklas |
if (hasReserved) |
3740 |
11 Feb 16 |
nicklas |
145 |
{ |
3740 |
11 Feb 16 |
nicklas |
selected = lysate.ReservedBy == currentUser; |
3740 |
11 Feb 16 |
nicklas |
147 |
} |
3740 |
11 Feb 16 |
nicklas |
else |
3740 |
11 Feb 16 |
nicklas |
149 |
{ |
3740 |
11 Feb 16 |
nicklas |
selected = isYellow || maxNonYellow > 0; |
3740 |
11 Feb 16 |
nicklas |
151 |
} |
3740 |
11 Feb 16 |
nicklas |
if (selected) |
3740 |
11 Feb 16 |
nicklas |
153 |
{ |
3740 |
11 Feb 16 |
nicklas |
numSelected++; |
3740 |
11 Feb 16 |
nicklas |
if (!isYellow) maxNonYellow--; |
3740 |
11 Feb 16 |
nicklas |
156 |
} |
3469 |
27 Aug 15 |
nicklas |
157 |
} |
3469 |
27 Aug 15 |
nicklas |
158 |
|
2688 |
23 Sep 14 |
nicklas |
var option = new Option(name, lysate.id, selected, selected); |
3740 |
11 Feb 16 |
nicklas |
if (isYellow) option.className = 'yellow'; |
2688 |
23 Sep 14 |
nicklas |
option.lysate = lysate; |
4099 |
14 Sep 16 |
nicklas |
if (lysate.isReProcess) |
4099 |
14 Sep 16 |
nicklas |
163 |
{ |
4099 |
14 Sep 16 |
nicklas |
reextractList.options[reextractList.length] = option; |
4099 |
14 Sep 16 |
nicklas |
165 |
} |
4099 |
14 Sep 16 |
nicklas |
else |
4099 |
14 Sep 16 |
nicklas |
167 |
{ |
4099 |
14 Sep 16 |
nicklas |
lysateList.options[lysateList.length] = option; |
4099 |
14 Sep 16 |
nicklas |
169 |
} |
2688 |
23 Sep 14 |
nicklas |
170 |
} |
4099 |
14 Sep 16 |
nicklas |
if (lysateList.length == 0) Doc.hide('regularFlowRow'); |
4099 |
14 Sep 16 |
nicklas |
if (reextractList.length > 0) Doc.show('reExtractionRow'); |
2688 |
23 Sep 14 |
nicklas |
exreg.lysatesOnChange(); |
2688 |
23 Sep 14 |
nicklas |
174 |
} |
2688 |
23 Sep 14 |
nicklas |
else |
2688 |
23 Sep 14 |
nicklas |
176 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setFatalError('No Lysate available for processing.'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
179 |
} |
2688 |
23 Sep 14 |
nicklas |
180 |
|
2688 |
23 Sep 14 |
nicklas |
Doc.show('step-1'); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('gonext'); |
2688 |
23 Sep 14 |
nicklas |
183 |
} |
2688 |
23 Sep 14 |
nicklas |
184 |
|
2688 |
23 Sep 14 |
nicklas |
185 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.lysatesOnChange = function() |
2688 |
23 Sep 14 |
nicklas |
187 |
{ |
2688 |
23 Sep 14 |
nicklas |
lysatesIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('lysates'); |
4099 |
14 Sep 16 |
nicklas |
Wizard.setInputStatus('reextraction'); |
2688 |
23 Sep 14 |
nicklas |
191 |
|
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
193 |
|
4099 |
14 Sep 16 |
nicklas |
var numLysates = 0; |
4099 |
14 Sep 16 |
nicklas |
var numReextraction = 0; |
4099 |
14 Sep 16 |
nicklas |
for (var i = 0; i < frm.lysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
197 |
{ |
4099 |
14 Sep 16 |
nicklas |
if (frm.lysates[i].selected) numLysates++; |
2688 |
23 Sep 14 |
nicklas |
199 |
} |
4099 |
14 Sep 16 |
nicklas |
for (var i = 0; i < frm.reextraction.length; i++) |
4099 |
14 Sep 16 |
nicklas |
201 |
{ |
4099 |
14 Sep 16 |
nicklas |
if (frm.reextraction[i].selected) numReextraction++; |
4099 |
14 Sep 16 |
nicklas |
203 |
} |
3468 |
26 Aug 15 |
nicklas |
204 |
|
4907 |
11 Jul 18 |
nicklas |
if (numReextraction > 0) |
4907 |
11 Jul 18 |
nicklas |
206 |
{ |
5304 |
15 Feb 19 |
nicklas |
Doc.removeClass('downloadLabelsCsv', 'disabled'); |
5304 |
15 Feb 19 |
nicklas |
Doc.removeClass('downloadLabelsXlsx', 'disabled'); |
4907 |
11 Jul 18 |
nicklas |
209 |
} |
4907 |
11 Jul 18 |
nicklas |
else |
4907 |
11 Jul 18 |
nicklas |
211 |
{ |
5304 |
15 Feb 19 |
nicklas |
Doc.addClass('downloadLabelsCsv', 'disabled'); |
5304 |
15 Feb 19 |
nicklas |
Doc.addClass('downloadLabelsXlsx', 'disabled'); |
4907 |
11 Jul 18 |
nicklas |
214 |
} |
4907 |
11 Jul 18 |
nicklas |
215 |
|
4099 |
14 Sep 16 |
nicklas |
if (numReextraction == 0 && numLysates == 0) |
2688 |
23 Sep 14 |
nicklas |
217 |
{ |
4099 |
14 Sep 16 |
nicklas |
Wizard.setInputStatus('lysates', 'invalid', 'At least one lysate must be selected'); |
4099 |
14 Sep 16 |
nicklas |
Wizard.setInputStatus('reextraction', 'invalid', 'At least one lysate must be selected'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
221 |
} |
4099 |
14 Sep 16 |
nicklas |
222 |
|
4099 |
14 Sep 16 |
nicklas |
if (numReextraction+numLysates > 12) |
3468 |
26 Aug 15 |
nicklas |
224 |
{ |
4099 |
14 Sep 16 |
nicklas |
if (numLysates > 0) Wizard.setInputStatus('lysates', 'invalid', 'Must not select more than 12 items.'); |
4099 |
14 Sep 16 |
nicklas |
if (numReextraction > 0) Wizard.setInputStatus('reextraction', 'invalid', 'Must not select more than 12 items.'); |
3468 |
26 Aug 15 |
nicklas |
return; |
3468 |
26 Aug 15 |
nicklas |
228 |
} |
2688 |
23 Sep 14 |
nicklas |
229 |
|
2688 |
23 Sep 14 |
nicklas |
lysatesIsValid = true; |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('lysates', 'valid'); |
4099 |
14 Sep 16 |
nicklas |
Wizard.setInputStatus('reextraction', 'valid'); |
2688 |
23 Sep 14 |
nicklas |
233 |
} |
2688 |
23 Sep 14 |
nicklas |
234 |
|
5304 |
15 Feb 19 |
nicklas |
exreg.downloadLabels = function(event) |
4907 |
11 Jul 18 |
nicklas |
236 |
{ |
4907 |
11 Jul 18 |
nicklas |
var frm = document.forms['reggie']; |
5304 |
15 Feb 19 |
nicklas |
var format = Data.get(event.currentTarget, 'format'); |
4907 |
11 Jul 18 |
nicklas |
var lysates = []; |
4907 |
11 Jul 18 |
nicklas |
for (var i = 0; i < frm.reextraction.length; i++) |
4907 |
11 Jul 18 |
nicklas |
241 |
{ |
4907 |
11 Jul 18 |
nicklas |
var lysate = frm.reextraction[i].lysate; |
4907 |
11 Jul 18 |
nicklas |
if (frm.reextraction[i].selected) |
4907 |
11 Jul 18 |
nicklas |
244 |
{ |
4907 |
11 Jul 18 |
nicklas |
lysates[lysates.length] = lysate.id; |
4907 |
11 Jul 18 |
nicklas |
246 |
} |
4907 |
11 Jul 18 |
nicklas |
247 |
} |
4907 |
11 Jul 18 |
nicklas |
248 |
|
4907 |
11 Jul 18 |
nicklas |
var frm = document.forms['reggie']; |
4907 |
11 Jul 18 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
4907 |
11 Jul 18 |
nicklas |
url += '&cmd=DownloadLabelFile'; |
4907 |
11 Jul 18 |
nicklas |
url += '&lysates=' + encodeURIComponent(lysates.join(',')); |
5304 |
15 Feb 19 |
nicklas |
url += '&format='+encodeURIComponent(format); |
4907 |
11 Jul 18 |
nicklas |
window.open(url); |
4907 |
11 Jul 18 |
nicklas |
255 |
} |
2688 |
23 Sep 14 |
nicklas |
256 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.validateStep1 = function(event) |
2688 |
23 Sep 14 |
nicklas |
258 |
{ |
2688 |
23 Sep 14 |
nicklas |
if (!lysatesIsValid) |
2688 |
23 Sep 14 |
nicklas |
260 |
{ |
2688 |
23 Sep 14 |
nicklas |
event.preventDefault(); |
2688 |
23 Sep 14 |
nicklas |
262 |
} |
2688 |
23 Sep 14 |
nicklas |
263 |
} |
2688 |
23 Sep 14 |
nicklas |
264 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.initializeStep2 = function() |
2688 |
23 Sep 14 |
nicklas |
266 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
frm.lysates.disabled = true; |
2688 |
23 Sep 14 |
nicklas |
269 |
|
4094 |
12 Sep 16 |
nicklas |
selectedLysates = []; |
4094 |
12 Sep 16 |
nicklas |
allLysatesAreReExtraction = true; |
4095 |
13 Sep 16 |
nicklas |
var lysateIds = []; |
4094 |
12 Sep 16 |
nicklas |
for (var i = 0; i < frm.lysates.length; i++) |
4094 |
12 Sep 16 |
nicklas |
274 |
{ |
4094 |
12 Sep 16 |
nicklas |
if (frm.lysates[i].selected) |
4094 |
12 Sep 16 |
nicklas |
276 |
{ |
4094 |
12 Sep 16 |
nicklas |
var lys = frm.lysates[i].lysate; |
4094 |
12 Sep 16 |
nicklas |
selectedLysates[selectedLysates.length] = lys; |
4095 |
13 Sep 16 |
nicklas |
lysateIds[lysateIds.length] = lys.id; |
4099 |
14 Sep 16 |
nicklas |
allLysatesAreReExtraction = false; |
4094 |
12 Sep 16 |
nicklas |
281 |
} |
4094 |
12 Sep 16 |
nicklas |
282 |
} |
4099 |
14 Sep 16 |
nicklas |
for (var i = 0; i < frm.reextraction.length; i++) |
4099 |
14 Sep 16 |
nicklas |
284 |
{ |
4099 |
14 Sep 16 |
nicklas |
if (frm.reextraction[i].selected) |
4099 |
14 Sep 16 |
nicklas |
286 |
{ |
4099 |
14 Sep 16 |
nicklas |
var lys = frm.reextraction[i].lysate; |
4099 |
14 Sep 16 |
nicklas |
selectedLysates[selectedLysates.length] = lys; |
4099 |
14 Sep 16 |
nicklas |
lysateIds[lysateIds.length] = lys.id; |
4099 |
14 Sep 16 |
nicklas |
290 |
} |
4099 |
14 Sep 16 |
nicklas |
291 |
} |
4095 |
13 Sep 16 |
nicklas |
292 |
|
4095 |
13 Sep 16 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
4095 |
13 Sep 16 |
nicklas |
url += '&cmd=GetChildItemNames'; |
4095 |
13 Sep 16 |
nicklas |
url += '&lysates='+lysateIds.join(','); |
4095 |
13 Sep 16 |
nicklas |
Wizard.showLoadingAnimation('Loading child item names...'); |
4095 |
13 Sep 16 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.childNamesLoaded); |
4095 |
13 Sep 16 |
nicklas |
298 |
|
4095 |
13 Sep 16 |
nicklas |
299 |
} |
4095 |
13 Sep 16 |
nicklas |
300 |
|
4095 |
13 Sep 16 |
nicklas |
exreg.childNamesLoaded = function(response) |
4095 |
13 Sep 16 |
nicklas |
302 |
{ |
4095 |
13 Sep 16 |
nicklas |
var frm = document.forms['reggie']; |
4095 |
13 Sep 16 |
nicklas |
var childNames = response.childNames; |
4095 |
13 Sep 16 |
nicklas |
305 |
|
4095 |
13 Sep 16 |
nicklas |
// Create child RNA/DNA/FlowThrough items |
4095 |
13 Sep 16 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
4095 |
13 Sep 16 |
nicklas |
308 |
{ |
4095 |
13 Sep 16 |
nicklas |
var lysate = selectedLysates[i]; |
4095 |
13 Sep 16 |
nicklas |
310 |
|
4095 |
13 Sep 16 |
nicklas |
var rna = {}; |
4095 |
13 Sep 16 |
nicklas |
var dna = {}; |
4095 |
13 Sep 16 |
nicklas |
var ft = {}; |
4095 |
13 Sep 16 |
nicklas |
// DNA |
4095 |
13 Sep 16 |
nicklas |
dna.name = childNames[i].dna; |
4095 |
13 Sep 16 |
nicklas |
dna.volume = DEFAULT_DNA_VOLUME; |
4095 |
13 Sep 16 |
nicklas |
317 |
|
4095 |
13 Sep 16 |
nicklas |
// RNA |
4095 |
13 Sep 16 |
nicklas |
rna.name = childNames[i].rna; |
4095 |
13 Sep 16 |
nicklas |
rna.volume = DEFAULT_RNA_VOLUME; |
4095 |
13 Sep 16 |
nicklas |
321 |
|
4095 |
13 Sep 16 |
nicklas |
// FlowThrough |
4095 |
13 Sep 16 |
nicklas |
ft.name = childNames[i].ft; |
4095 |
13 Sep 16 |
nicklas |
ft.volume = DEFAULT_FT_VOLUME; |
4095 |
13 Sep 16 |
nicklas |
325 |
|
4095 |
13 Sep 16 |
nicklas |
lysate.rna = rna; |
4095 |
13 Sep 16 |
nicklas |
lysate.dna = dna; |
4095 |
13 Sep 16 |
nicklas |
lysate.ft = ft; |
4095 |
13 Sep 16 |
nicklas |
329 |
} |
4095 |
13 Sep 16 |
nicklas |
330 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setCurrentStep(2); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('gocancel'); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('gonext'); |
2688 |
23 Sep 14 |
nicklas |
334 |
|
4094 |
12 Sep 16 |
nicklas |
if (!allLysatesAreReExtraction) |
4094 |
12 Sep 16 |
nicklas |
336 |
{ |
4094 |
12 Sep 16 |
nicklas |
Reggie.loadProtocols('SAMPLE_HANDLING_PROTOCOL', 'lysisProtocol'); |
4094 |
12 Sep 16 |
nicklas |
338 |
} |
2688 |
23 Sep 14 |
nicklas |
Doc.addClass('dnaProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
frm.dnaProtocol[0] = new Option('loading...', ''); |
2688 |
23 Sep 14 |
nicklas |
Doc.addClass('rnaProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
frm.rnaProtocol[0] = new Option('loading...', ''); |
2688 |
23 Sep 14 |
nicklas |
Doc.addClass('ftProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
frm.ftProtocol[0] = new Option('loading...', ''); |
2688 |
23 Sep 14 |
nicklas |
var url = '../Protocol.servlet?ID='+App.getSessionId(); |
2688 |
23 Sep 14 |
nicklas |
url += '&cmd=GetProtocols&subtype=EXTRACTION_PROTOCOL'; |
2688 |
23 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.protocolsLoaded); |
2688 |
23 Sep 14 |
nicklas |
348 |
|
4094 |
12 Sep 16 |
nicklas |
if (allLysatesAreReExtraction) |
4094 |
12 Sep 16 |
nicklas |
350 |
{ |
4094 |
12 Sep 16 |
nicklas |
Doc.element('only-re-extraction').innerHTML = '(Disabled since all selected lysates are for re-extraction)'; |
4094 |
12 Sep 16 |
nicklas |
frm.lysisDate.value = ''; |
4094 |
12 Sep 16 |
nicklas |
frm.lysisDate.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.lysisProtocol.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.rltPlusBuffer.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.betaMercaptoetanol.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.reagentDx.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.qiaShredderColumn.disabled = true; |
4094 |
12 Sep 16 |
nicklas |
frm.qiacubeDate.focus(); |
4094 |
12 Sep 16 |
nicklas |
360 |
} |
4094 |
12 Sep 16 |
nicklas |
else |
4094 |
12 Sep 16 |
nicklas |
362 |
{ |
4094 |
12 Sep 16 |
nicklas |
frm.lysisDate.focus(); |
4094 |
12 Sep 16 |
nicklas |
Events.sendChangeEvent('lysisDate'); |
4094 |
12 Sep 16 |
nicklas |
365 |
} |
2688 |
23 Sep 14 |
nicklas |
Events.sendChangeEvent('qiacubeDate'); |
3168 |
05 Mar 15 |
nicklas |
367 |
|
3168 |
05 Mar 15 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3168 |
05 Mar 15 |
nicklas |
url += '&cmd=GetLatestReagentLotNumbers'; |
3168 |
05 Mar 15 |
nicklas |
Wizard.showLoadingAnimation('Loading recent reagent lot numbers...'); |
3168 |
05 Mar 15 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.reagentsLoaded); |
2688 |
23 Sep 14 |
nicklas |
372 |
} |
2688 |
23 Sep 14 |
nicklas |
373 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.protocolsLoaded = function(response) |
2688 |
23 Sep 14 |
nicklas |
375 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var protocols = response.protocols; |
2688 |
23 Sep 14 |
nicklas |
378 |
|
2688 |
23 Sep 14 |
nicklas |
Doc.removeClass('dnaProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
Doc.removeClass('rnaProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
Doc.removeClass('ftProtocol', 'list-loading'); |
2688 |
23 Sep 14 |
nicklas |
frm.dnaProtocol.length = 0; |
2688 |
23 Sep 14 |
nicklas |
frm.rnaProtocol.length = 0; |
2688 |
23 Sep 14 |
nicklas |
frm.ftProtocol.length = 0; |
2688 |
23 Sep 14 |
nicklas |
for (var i = 0; i < protocols.length; i++) |
2688 |
23 Sep 14 |
nicklas |
386 |
{ |
2688 |
23 Sep 14 |
nicklas |
var name = protocols[i].name; |
2688 |
23 Sep 14 |
nicklas |
var id = protocols[i].id; |
2688 |
23 Sep 14 |
nicklas |
frm.dnaProtocol[frm.dnaProtocol.length] = new Option(name, id, false, name == 'AllprepCustomPartA'); |
2688 |
23 Sep 14 |
nicklas |
frm.rnaProtocol[frm.rnaProtocol.length] = new Option(name, id, false, name == 'AllprepMod1partC'); |
2688 |
23 Sep 14 |
nicklas |
frm.ftProtocol[frm.ftProtocol.length] = new Option(name, id, false, name == 'AllprepMod1partB'); |
2688 |
23 Sep 14 |
nicklas |
392 |
} |
2688 |
23 Sep 14 |
nicklas |
393 |
|
2688 |
23 Sep 14 |
nicklas |
frm.dnaProtocol[frm.dnaProtocol.length] = new Option('- none -', ''); |
2688 |
23 Sep 14 |
nicklas |
frm.rnaProtocol[frm.rnaProtocol.length] = new Option('- none -', ''); |
2688 |
23 Sep 14 |
nicklas |
frm.ftProtocol[frm.ftProtocol.length] = new Option('- none -', ''); |
2688 |
23 Sep 14 |
nicklas |
397 |
} |
2688 |
23 Sep 14 |
nicklas |
398 |
|
3168 |
05 Mar 15 |
nicklas |
exreg.reagentsLoaded = function(response) |
3168 |
05 Mar 15 |
nicklas |
400 |
{ |
3168 |
05 Mar 15 |
nicklas |
latestRna = response.rna; |
6892 |
24 Nov 22 |
nicklas |
latestLysate = response.lysate || {}; |
3168 |
05 Mar 15 |
nicklas |
403 |
|
3168 |
05 Mar 15 |
nicklas |
if (!latestRna) return; |
3168 |
05 Mar 15 |
nicklas |
405 |
|
3168 |
05 Mar 15 |
nicklas |
var haveLatestLysateReagents = false; |
3168 |
05 Mar 15 |
nicklas |
var haveLatestRnaReagents = false; |
3168 |
05 Mar 15 |
nicklas |
for (var rgNo = 0; rgNo < exreg.REAGENTS.length; rgNo++) |
3168 |
05 Mar 15 |
nicklas |
409 |
{ |
3168 |
05 Mar 15 |
nicklas |
var rg = exreg.REAGENTS[rgNo]; |
3168 |
05 Mar 15 |
nicklas |
if (latestLysate[rg]) |
3168 |
05 Mar 15 |
nicklas |
412 |
{ |
3168 |
05 Mar 15 |
nicklas |
haveLatestLysateReagents = true; |
3168 |
05 Mar 15 |
nicklas |
414 |
} |
3168 |
05 Mar 15 |
nicklas |
if (latestRna[rg]) |
3168 |
05 Mar 15 |
nicklas |
416 |
{ |
3168 |
05 Mar 15 |
nicklas |
haveLatestRnaReagents = true; |
3168 |
05 Mar 15 |
nicklas |
418 |
} |
3168 |
05 Mar 15 |
nicklas |
419 |
} |
3168 |
05 Mar 15 |
nicklas |
420 |
|
4094 |
12 Sep 16 |
nicklas |
if (!allLysatesAreReExtraction && haveLatestLysateReagents) |
3168 |
05 Mar 15 |
nicklas |
422 |
{ |
3168 |
05 Mar 15 |
nicklas |
Doc.show('useLatestLysateReagents'); |
3168 |
05 Mar 15 |
nicklas |
Doc.element('latestLysisDate').innerHTML = '(Lysis date ' + Reggie.reformatDate(latestLysate.lysisDate) + ')'; |
3168 |
05 Mar 15 |
nicklas |
425 |
} |
3168 |
05 Mar 15 |
nicklas |
else |
3168 |
05 Mar 15 |
nicklas |
427 |
{ |
3168 |
05 Mar 15 |
nicklas |
latestLysate = null; |
3168 |
05 Mar 15 |
nicklas |
429 |
} |
3168 |
05 Mar 15 |
nicklas |
430 |
|
3168 |
05 Mar 15 |
nicklas |
if (haveLatestRnaReagents) |
3168 |
05 Mar 15 |
nicklas |
432 |
{ |
3168 |
05 Mar 15 |
nicklas |
Doc.show('useLatestRnaReagents'); |
3168 |
05 Mar 15 |
nicklas |
Doc.element('latestQiacubeDate').innerHTML = '(QiaCube run ' + Reggie.reformatDate(latestRna.QiaCubeDate) + ')'; |
3168 |
05 Mar 15 |
nicklas |
435 |
} |
3168 |
05 Mar 15 |
nicklas |
else |
3168 |
05 Mar 15 |
nicklas |
437 |
{ |
3168 |
05 Mar 15 |
nicklas |
latestRna = null; |
3168 |
05 Mar 15 |
nicklas |
439 |
} |
3168 |
05 Mar 15 |
nicklas |
440 |
} |
3168 |
05 Mar 15 |
nicklas |
441 |
|
3168 |
05 Mar 15 |
nicklas |
exreg.useLatestReagents = function(event) |
3168 |
05 Mar 15 |
nicklas |
443 |
{ |
3168 |
05 Mar 15 |
nicklas |
var which = Data.get(event.currentTarget, 'which'); |
3168 |
05 Mar 15 |
nicklas |
445 |
|
3168 |
05 Mar 15 |
nicklas |
var latestItem = which == 'rna' ? latestRna : latestLysate; |
3168 |
05 Mar 15 |
nicklas |
if (!latestItem) return; |
3168 |
05 Mar 15 |
nicklas |
448 |
|
3168 |
05 Mar 15 |
nicklas |
var frm = document.forms['reggie']; |
3168 |
05 Mar 15 |
nicklas |
for (var rgNo = 0; rgNo < exreg.REAGENTS.length; rgNo++) |
3168 |
05 Mar 15 |
nicklas |
451 |
{ |
3168 |
05 Mar 15 |
nicklas |
var rg = exreg.REAGENTS[rgNo]; |
3168 |
05 Mar 15 |
nicklas |
if (latestItem[rg]) |
3168 |
05 Mar 15 |
nicklas |
454 |
{ |
3168 |
05 Mar 15 |
nicklas |
frm[rg].value = latestItem[rg]; |
3168 |
05 Mar 15 |
nicklas |
456 |
} |
3168 |
05 Mar 15 |
nicklas |
457 |
} |
3168 |
05 Mar 15 |
nicklas |
458 |
} |
3168 |
05 Mar 15 |
nicklas |
459 |
|
5785 |
12 Dec 19 |
nicklas |
exreg.qiacubeDateOnChange = function(event) |
2688 |
23 Sep 14 |
nicklas |
461 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
463 |
|
2688 |
23 Sep 14 |
nicklas |
var lysisDateIsValid = Wizard.isValid('lysisDate'); |
2688 |
23 Sep 14 |
nicklas |
var qiacubeDateIsValid = Wizard.isValid('qiacubeDate'); |
2688 |
23 Sep 14 |
nicklas |
466 |
|
2688 |
23 Sep 14 |
nicklas |
if (!lysisDateIsValid || !qiacubeDateIsValid) return; |
2688 |
23 Sep 14 |
nicklas |
468 |
|
2688 |
23 Sep 14 |
nicklas |
var lysisDate = Dates.parseString(frm.lysisDate.value, 'yyyyMMdd'); |
2688 |
23 Sep 14 |
nicklas |
var qiacubeDate = Dates.parseString(frm.qiacubeDate.value, 'yyyyMMdd'); |
2688 |
23 Sep 14 |
nicklas |
if (lysisDate > qiacubeDate) |
2688 |
23 Sep 14 |
nicklas |
472 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('qiacubeDate', 'invalid', 'Qiacube date is before Lysis date'); |
2688 |
23 Sep 14 |
nicklas |
qiacubeDateIsAfterLysisDate = false; |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
476 |
} |
2688 |
23 Sep 14 |
nicklas |
477 |
|
2688 |
23 Sep 14 |
nicklas |
qiacubeDateIsAfterLysisDate = true; |
5785 |
12 Dec 19 |
nicklas |
Wizard.setInputStatus('qiacubeDate', 'valid'); |
2688 |
23 Sep 14 |
nicklas |
480 |
|
5785 |
12 Dec 19 |
nicklas |
if (event.target.id == 'qiacubeDate') |
5785 |
12 Dec 19 |
nicklas |
482 |
{ |
5785 |
12 Dec 19 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
5785 |
12 Dec 19 |
nicklas |
url += '&cmd=GetNextQiacubeRunNo&qiacubeDate='+encodeURIComponent(frm.qiacubeDate.value); |
5785 |
12 Dec 19 |
nicklas |
Wizard.showLoadingAnimation('Loading Qiacube run number...'); |
5785 |
12 Dec 19 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.gotNextRunNumber); |
5785 |
12 Dec 19 |
nicklas |
487 |
} |
2688 |
23 Sep 14 |
nicklas |
488 |
} |
2688 |
23 Sep 14 |
nicklas |
489 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.gotNextRunNumber = function(response) |
2688 |
23 Sep 14 |
nicklas |
491 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
frm.qiacubeRunNo.value = response.nextQiacubeRunNo; |
2688 |
23 Sep 14 |
nicklas |
Events.sendChangeEvent('qiacubeRunNo'); |
2688 |
23 Sep 14 |
nicklas |
495 |
} |
2688 |
23 Sep 14 |
nicklas |
496 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.qiacubeRunNoOnChange = function() |
2688 |
23 Sep 14 |
nicklas |
498 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var runNumber = frm.qiacubeRunNo.value; |
2688 |
23 Sep 14 |
nicklas |
qiacubeRunNoIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
502 |
|
2688 |
23 Sep 14 |
nicklas |
if (runNumber == '') |
2688 |
23 Sep 14 |
nicklas |
504 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('qiacubeRunNo', 'invalid', 'Missing'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
507 |
} |
2688 |
23 Sep 14 |
nicklas |
if (!(parseInt(runNumber, 10) >= 1)) |
2688 |
23 Sep 14 |
nicklas |
509 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('qiacubeRunNo', 'invalid', 'Must be at least 1'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
512 |
} |
2688 |
23 Sep 14 |
nicklas |
513 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('qiacubeRunNo', 'valid'); |
2688 |
23 Sep 14 |
nicklas |
qiacubeRunNoIsValid = true; |
2688 |
23 Sep 14 |
nicklas |
516 |
} |
2688 |
23 Sep 14 |
nicklas |
517 |
|
2688 |
23 Sep 14 |
nicklas |
518 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.validateStep2 = function(event) |
2688 |
23 Sep 14 |
nicklas |
520 |
{ |
2688 |
23 Sep 14 |
nicklas |
var valid = true; |
2688 |
23 Sep 14 |
nicklas |
valid &= Wizard.isValid('lysisDate'); |
2688 |
23 Sep 14 |
nicklas |
valid &= Wizard.isValid('qiacubeDate'); |
2688 |
23 Sep 14 |
nicklas |
valid &= qiacubeRunNoIsValid; |
2688 |
23 Sep 14 |
nicklas |
525 |
|
2688 |
23 Sep 14 |
nicklas |
if (!valid) event.preventDefault(); |
2688 |
23 Sep 14 |
nicklas |
527 |
} |
2688 |
23 Sep 14 |
nicklas |
528 |
|
2688 |
23 Sep 14 |
nicklas |
529 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.initializeStep3 = function() |
2688 |
23 Sep 14 |
nicklas |
531 |
{ |
2900 |
05 Nov 14 |
nicklas |
var html = '<table id="detailsTable" class="step-form">'; |
2688 |
23 Sep 14 |
nicklas |
// First header row |
2688 |
23 Sep 14 |
nicklas |
html += '<thead>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<tr>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th>Specimen</th>'; |
6725 |
04 May 22 |
nicklas |
html += '<th class="label">Label¹</th>' |
3468 |
26 Aug 15 |
nicklas |
html += '<th class="dottedleft">QIAcube</th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th colspan="3" class="dottedleft">Lysate</th>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<th colspan="5" class="dottedleft">DNA</th>'; |
2900 |
05 Nov 14 |
nicklas |
html += '<th colspan="5" class="dottedleft">RNA</th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th class="dottedleft">FT</th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th class="dottedleft comment">Comment</th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th></th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '</tr>'; |
2688 |
23 Sep 14 |
nicklas |
// Second header row |
2688 |
23 Sep 14 |
nicklas |
html += '<tr>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th></th>'; |
6725 |
04 May 22 |
nicklas |
html += '<th class="label"></th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th class="dottedleft">position</th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft">Storage</td><td>Total</td><td>Used</td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td class="dottedleft">NanoDrop</td><td>Vol.</td><td>Conc.</td><td>Quantity</td><td><span id="toggle-normalize-dna-1" data-prefix="dna" class="link" title="Toggle all">Pre-</span></td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td class="dottedleft">NanoDrop</td><td>Vol.</td><td>Conc.</td><td>Quantity</td><td><span id="toggle-normalize-rna-1" data-prefix="rna" class="link" title="Toggle all">Pre-</span></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft">Vol.</td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft comment"></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '</tr>'; |
2688 |
23 Sep 14 |
nicklas |
// Third header row |
2688 |
23 Sep 14 |
nicklas |
html += '<tr>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th></th>'; |
6725 |
04 May 22 |
nicklas |
html += '<th class="label"></th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<th class="dottedleft"></th>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft">box</td><td>(µl)</td><td>(µl)</td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td class="dottedleft">pos</td><td>(µl)</td><td>(ng/µl)</td><td>(µg)</td><td><span id="toggle-normalize-dna-2" data-prefix="dna" class="link" title="Toggle all">normalize</span></td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td class="dottedleft">pos</td><td>(µl)</td><td>(ng/µl)</td><td>(µg)</td><td><span id="toggle-normalize-rna-2" data-prefix="rna" class="link" title="Toggle all">normalize</span></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft">(µl)</td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td class="dottedleft comment"></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<td></td>'; |
2688 |
23 Sep 14 |
nicklas |
html += '</tr>'; |
2688 |
23 Sep 14 |
nicklas |
html += '</thead>'; |
2688 |
23 Sep 14 |
nicklas |
html += '<tbody>'; |
2688 |
23 Sep 14 |
nicklas |
572 |
|
3468 |
26 Aug 15 |
nicklas |
// Set default values for DNA/RNA extraction |
3468 |
26 Aug 15 |
nicklas |
var QPOS = QIACUBE_POS[selectedLysates.length-1]; |
6725 |
04 May 22 |
nicklas |
var numWithLabel = 0; |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
3468 |
26 Aug 15 |
nicklas |
577 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3740 |
11 Feb 16 |
nicklas |
var specimen = lysate.specimen; |
3740 |
11 Feb 16 |
nicklas |
var isYellow = specimen.YellowLabel != null; |
3468 |
26 Aug 15 |
nicklas |
var id = lysate.id; |
4094 |
12 Sep 16 |
nicklas |
if (!lysate.isReProcess) |
4094 |
12 Sep 16 |
nicklas |
583 |
{ |
4094 |
12 Sep 16 |
nicklas |
lysate.originalQuantity = DEFAULT_LYSATE_VOLUME; |
4094 |
12 Sep 16 |
nicklas |
585 |
} |
3468 |
26 Aug 15 |
nicklas |
lysate.processedQuantity = DEFAULT_LYSATE_USED; |
3468 |
26 Aug 15 |
nicklas |
lysate.qiacubePosition = QPOS[i]; |
3468 |
26 Aug 15 |
nicklas |
lysate.originalQiacubePosition = QPOS[i]; |
6725 |
04 May 22 |
nicklas |
if (lysate.label) numWithLabel++; |
6725 |
04 May 22 |
nicklas |
590 |
|
3740 |
11 Feb 16 |
nicklas |
var img = isYellow ? '<img src="../images/yellow-label.png">' : ''; |
3740 |
11 Feb 16 |
nicklas |
html += '<tr class="highlight'+(isYellow ? ' yellow-specimen' : '')+'">'; |
3741 |
12 Feb 16 |
nicklas |
html += '<th class="specimen if-yellow">'+img+Strings.encodeTags(specimen.name) + '</th>'; |
6725 |
04 May 22 |
nicklas |
html += '<th class="label if-yellow">'+Strings.encodeTags(lysate.label)+'</th>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="qiacubePosition'+id+'" class="dottedleft"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td class="dottedleft">'+Strings.encodeTags(lysate.bioWell.bioPlate.name + '[' + lysate.bioWell.location)+']</td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="lysateTotal'+id+'"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="lysateUsed'+id+'"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="dnaPos'+id+'" class="dottedleft"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="dnaVol'+id+'"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="dnaConc'+id+'" class="bg-filled-50 italic"></td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td id="dnaQuantity'+id+'" class="bg-filled-50 italic"></td>'; |
5356 |
12 Apr 19 |
nicklas |
html += '<td><input type="checkbox" name="dnaPreNormalize'+id+'" id="dnaPreNormalize'+id+'" disabled>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="rnaPos'+id+'" class="dottedleft"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="rnaVol'+id+'"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="rnaConc'+id+'" class="bg-filled-50 italic"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="rnaQuantity'+id+'" class="bg-filled-50 italic"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td><input type="checkbox" name="rnaPreNormalize'+id+'" id="rnaPreNormalize'+id+'" disabled>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<span id="rnaPreNormalize'+id+'.status" class="status"> </span></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="ftVol'+id+'" class="dottedleft"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td id="comments'+id+'" class="dottedleft comment"></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '<td><div class="button basicbutton interactable edit-details" style="width: 5em;" data-lysate-id="'+id+'">Edit…</div></td>'; |
3468 |
26 Aug 15 |
nicklas |
html += '</tr>'; |
2688 |
23 Sep 14 |
nicklas |
614 |
} |
2688 |
23 Sep 14 |
nicklas |
html += '</tbody>'; |
2688 |
23 Sep 14 |
nicklas |
html += '</table>'; |
2688 |
23 Sep 14 |
nicklas |
Doc.element('detailsSection').innerHTML = html; |
6725 |
04 May 22 |
nicklas |
if (numWithLabel > 0) |
6725 |
04 May 22 |
nicklas |
619 |
{ |
6725 |
04 May 22 |
nicklas |
Doc.removeClass('detailsSection', 'nolabels'); |
6725 |
04 May 22 |
nicklas |
Doc.show('label-info'); |
6725 |
04 May 22 |
nicklas |
622 |
} |
2688 |
23 Sep 14 |
nicklas |
var buttons = Doc.element('detailsSection').getElementsByClassName('edit-details'); |
2688 |
23 Sep 14 |
nicklas |
for (var i = 0; i < buttons.length; i++) |
2688 |
23 Sep 14 |
nicklas |
625 |
{ |
2688 |
23 Sep 14 |
nicklas |
Buttons.addClickHandler(buttons[i], exreg.editDnaRnaDetails); |
2688 |
23 Sep 14 |
nicklas |
627 |
} |
2688 |
23 Sep 14 |
nicklas |
628 |
|
5356 |
12 Apr 19 |
nicklas |
Events.addEventHandler('toggle-normalize-rna-1', 'click', exreg.toggleNormalize); |
5356 |
12 Apr 19 |
nicklas |
Events.addEventHandler('toggle-normalize-rna-2', 'click', exreg.toggleNormalize); |
5356 |
12 Apr 19 |
nicklas |
Events.addEventHandler('toggle-normalize-dna-1', 'click', exreg.toggleNormalize); |
5356 |
12 Apr 19 |
nicklas |
Events.addEventHandler('toggle-normalize-dna-2', 'click', exreg.toggleNormalize); |
2923 |
12 Nov 14 |
nicklas |
633 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.updateDetailsTable(); |
2688 |
23 Sep 14 |
nicklas |
635 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setCurrentStep(3); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('gocancel'); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('goregister'); |
2688 |
23 Sep 14 |
nicklas |
639 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'No file selected'); |
2691 |
24 Sep 14 |
nicklas |
Wizard.keepSessionAlive(); |
2688 |
23 Sep 14 |
nicklas |
642 |
|
2688 |
23 Sep 14 |
nicklas |
if (debug && location.protocol != 'https:') |
2688 |
23 Sep 14 |
nicklas |
644 |
{ |
2924 |
13 Nov 14 |
nicklas |
Wizard.showDebugTools(); |
2688 |
23 Sep 14 |
nicklas |
646 |
} |
5591 |
04 Sep 19 |
nicklas |
647 |
|
5591 |
04 Sep 19 |
nicklas |
var url = '../Protocol.servlet?ID='+App.getSessionId(); |
5591 |
04 Sep 19 |
nicklas |
url += '&cmd=CountProtocols&subtype=DNA_NORMALIZATION_PROTOCOL,RNA_NORMALIZATION_PROTOCOL'; |
5591 |
04 Sep 19 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.protocolsCounted); |
2688 |
23 Sep 14 |
nicklas |
651 |
} |
2688 |
23 Sep 14 |
nicklas |
652 |
|
5591 |
04 Sep 19 |
nicklas |
// This controls the default "checked" status of the Prenormalize checkboxes |
5591 |
04 Sep 19 |
nicklas |
exreg.protocolsCounted = function(response) |
5591 |
04 Sep 19 |
nicklas |
655 |
{ |
5591 |
04 Sep 19 |
nicklas |
ENABLE_DNA_PRENORMALIZE = response.DNA_NORMALIZATION_PROTOCOL > 0; |
5591 |
04 Sep 19 |
nicklas |
ENABLE_RNA_PRENORMALIZE = response.RNA_NORMALIZATION_PROTOCOL > 0; |
5591 |
04 Sep 19 |
nicklas |
658 |
} |
5591 |
04 Sep 19 |
nicklas |
659 |
|
5356 |
12 Apr 19 |
nicklas |
exreg.toggleNormalize = function(event) |
2923 |
12 Nov 14 |
nicklas |
661 |
{ |
5356 |
12 Apr 19 |
nicklas |
var prefix = Data.get(event.currentTarget, 'prefix'); // prefix is 'dna' or 'rna' |
2923 |
12 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2923 |
12 Nov 14 |
nicklas |
var check = null; |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2923 |
12 Nov 14 |
nicklas |
666 |
{ |
3468 |
26 Aug 15 |
nicklas |
var id = selectedLysates[i].id; |
5356 |
12 Apr 19 |
nicklas |
if (!frm[prefix+'PreNormalize'+id].disabled) |
2923 |
12 Nov 14 |
nicklas |
669 |
{ |
5356 |
12 Apr 19 |
nicklas |
if (check == null) check = !frm[prefix+'PreNormalize'+id].checked; |
5356 |
12 Apr 19 |
nicklas |
frm[prefix+'PreNormalize'+id].checked = check; |
2923 |
12 Nov 14 |
nicklas |
672 |
} |
2923 |
12 Nov 14 |
nicklas |
673 |
} |
2923 |
12 Nov 14 |
nicklas |
674 |
} |
2688 |
23 Sep 14 |
nicklas |
675 |
|
3468 |
26 Aug 15 |
nicklas |
exreg.calculateNanoDropPositions = function() |
3468 |
26 Aug 15 |
nicklas |
677 |
{ |
3468 |
26 Aug 15 |
nicklas |
var tmp = []; |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
3468 |
26 Aug 15 |
nicklas |
680 |
{ |
3468 |
26 Aug 15 |
nicklas |
var o = {}; |
3468 |
26 Aug 15 |
nicklas |
o.index = i; |
3468 |
26 Aug 15 |
nicklas |
o.qiapos = selectedLysates[i].qiacubePosition; |
3468 |
26 Aug 15 |
nicklas |
tmp[tmp.length] = o; |
3468 |
26 Aug 15 |
nicklas |
685 |
} |
3468 |
26 Aug 15 |
nicklas |
tmp.sort(exreg.sortByQiaCubePosition); |
3468 |
26 Aug 15 |
nicklas |
687 |
|
3468 |
26 Aug 15 |
nicklas |
var ndCol = 1; |
3468 |
26 Aug 15 |
nicklas |
var ndRow = 0; |
3468 |
26 Aug 15 |
nicklas |
var rnaOffset = selectedLysates.length > 7 ? 2 : 1; |
3468 |
26 Aug 15 |
nicklas |
691 |
|
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < tmp.length; i++) |
3468 |
26 Aug 15 |
nicklas |
693 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[tmp[i].index]; |
3468 |
26 Aug 15 |
nicklas |
lysate.nanoDropOrder = i; |
3468 |
26 Aug 15 |
nicklas |
lysate.dna.well = Reggie.wellToAlpha(ndRow) + ndCol; |
3468 |
26 Aug 15 |
nicklas |
lysate.rna.well = Reggie.wellToAlpha(ndRow) + (ndCol+rnaOffset); |
3468 |
26 Aug 15 |
nicklas |
ndRow++; |
3468 |
26 Aug 15 |
nicklas |
if (ndRow == 8) |
3468 |
26 Aug 15 |
nicklas |
700 |
{ |
3468 |
26 Aug 15 |
nicklas |
ndRow = 0; |
3468 |
26 Aug 15 |
nicklas |
ndCol++; |
3468 |
26 Aug 15 |
nicklas |
703 |
} |
3468 |
26 Aug 15 |
nicklas |
704 |
} |
3468 |
26 Aug 15 |
nicklas |
705 |
} |
3468 |
26 Aug 15 |
nicklas |
706 |
|
3468 |
26 Aug 15 |
nicklas |
exreg.sortByQiaCubePosition = function(a, b) |
3468 |
26 Aug 15 |
nicklas |
708 |
{ |
3468 |
26 Aug 15 |
nicklas |
return a.qiapos == b.qiapos ? a.index - b.index : a.qiapos - b.qiapos; |
3468 |
26 Aug 15 |
nicklas |
710 |
} |
3468 |
26 Aug 15 |
nicklas |
711 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.updateDetailsTable = function() |
2688 |
23 Sep 14 |
nicklas |
713 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var hasQiacubePosition = []; |
2688 |
23 Sep 14 |
nicklas |
var duplicatePosition = 0; |
2688 |
23 Sep 14 |
nicklas |
717 |
|
3468 |
26 Aug 15 |
nicklas |
exreg.calculateNanoDropPositions(); |
3468 |
26 Aug 15 |
nicklas |
719 |
|
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
721 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3468 |
26 Aug 15 |
nicklas |
var id = lysate.id; |
3468 |
26 Aug 15 |
nicklas |
Doc.element('qiacubePosition'+id).innerHTML = lysate.qiacubePosition; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('qiacubePosition'+id, 'nondefault', lysate.qiacubePosition != lysate.originalQiacubePosition); |
3468 |
26 Aug 15 |
nicklas |
726 |
|
3468 |
26 Aug 15 |
nicklas |
if (hasQiacubePosition[lysate.qiacubePosition]) |
2688 |
23 Sep 14 |
nicklas |
728 |
{ |
3468 |
26 Aug 15 |
nicklas |
duplicatePosition = lysate.qiacubePosition; |
3468 |
26 Aug 15 |
nicklas |
730 |
} |
3468 |
26 Aug 15 |
nicklas |
else |
3468 |
26 Aug 15 |
nicklas |
732 |
{ |
3468 |
26 Aug 15 |
nicklas |
hasQiacubePosition[lysate.qiacubePosition] = true; |
3468 |
26 Aug 15 |
nicklas |
734 |
} |
2688 |
23 Sep 14 |
nicklas |
735 |
|
4094 |
12 Sep 16 |
nicklas |
Doc.element('lysateTotal'+id).innerHTML = Numbers.formatNumber(lysate.originalQuantity || lysate.remainingQuantity, 0); |
4094 |
12 Sep 16 |
nicklas |
Doc.addOrRemoveClass('lysateTotal'+id, 'nondefault', !lysate.isReProcess && lysate.originalQuantity != DEFAULT_LYSATE_VOLUME); |
3468 |
26 Aug 15 |
nicklas |
738 |
|
3468 |
26 Aug 15 |
nicklas |
Doc.element('lysateUsed'+id).innerHTML = lysate.processedQuantity; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('lysateUsed'+id, 'nondefault', lysate.processedQuantity != DEFAULT_LYSATE_USED); |
3468 |
26 Aug 15 |
nicklas |
741 |
|
3468 |
26 Aug 15 |
nicklas |
Doc.element('dnaPos'+id).innerHTML = lysate.dna.well; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('dnaPos'+id, 'nondefault', lysate.qiacubePosition != lysate.originalQiacubePosition); |
3468 |
26 Aug 15 |
nicklas |
Doc.element('dnaVol'+id).innerHTML = lysate.dna.volume; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('dnaVol'+id, 'nondefault', lysate.dna.volume != DEFAULT_DNA_VOLUME); |
3468 |
26 Aug 15 |
nicklas |
var dnaConc = Doc.element('dnaConc'+id); |
3468 |
26 Aug 15 |
nicklas |
dnaConc.innerHTML = Reggie.formatNumber(lysate.dna.ndConc) || '-'; |
3470 |
27 Aug 15 |
nicklas |
Doc.addOrRemoveClass(dnaConc, 'low-conc', lysate.dna.ndConc < 1); |
3468 |
26 Aug 15 |
nicklas |
dnaConc.title = '260/280=' + lysate.dna.nd260by280 + '\n260/230=' + lysate.dna.nd260by230; |
3468 |
26 Aug 15 |
nicklas |
750 |
|
5356 |
12 Apr 19 |
nicklas |
lysate.dna.quantity = Math.max(0, lysate.dna.ndConc * lysate.dna.volume / 1000); |
5356 |
12 Apr 19 |
nicklas |
var enoughQuantity = lysate.dna.quantity > MINIMAL_PRE_NORMALIZE_QUANTITY_DNA; |
5356 |
12 Apr 19 |
nicklas |
lysate.dna.flag = enoughQuantity ? null : 'NotEnoughRemainingQuantity'; |
5356 |
12 Apr 19 |
nicklas |
frm['dnaPreNormalize'+id].disabled = !enoughQuantity; |
5356 |
12 Apr 19 |
nicklas |
Doc.element('dnaQuantity'+id).innerHTML = Reggie.formatNumber(lysate.dna.quantity || null, null, 2) || '-'; |
5785 |
12 Dec 19 |
nicklas |
frm['dnaPreNormalize'+id].checked = enoughQuantity && ENABLE_DNA_PRENORMALIZE && !Reggie.isExternal(lysate.name); |
5356 |
12 Apr 19 |
nicklas |
var warning = lysate.dna.quantity && !enoughQuantity; |
5356 |
12 Apr 19 |
nicklas |
Wizard.setInputStatus('dnaPreNormalize'+id, warning ? 'flag' : '', warning ? 'Not enough quantity' : ''); |
5356 |
12 Apr 19 |
nicklas |
759 |
|
3468 |
26 Aug 15 |
nicklas |
Doc.element('rnaPos'+id).innerHTML = lysate.rna.well; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('rnaPos'+id, 'nondefault', lysate.qiacubePosition != lysate.originalQiacubePosition); |
3468 |
26 Aug 15 |
nicklas |
Doc.element('rnaVol'+id).innerHTML = lysate.rna.volume; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('rnaVol'+id, 'nondefault', lysate.rna.volume != DEFAULT_RNA_VOLUME); |
3468 |
26 Aug 15 |
nicklas |
var rnaConc = Doc.element('rnaConc'+id); |
3468 |
26 Aug 15 |
nicklas |
rnaConc.innerHTML = Reggie.formatNumber(lysate.rna.ndConc) || '-'; |
3470 |
27 Aug 15 |
nicklas |
Doc.addOrRemoveClass(rnaConc, 'low-conc', lysate.rna.ndConc < 1); |
3468 |
26 Aug 15 |
nicklas |
rnaConc.title = '260/280=' + lysate.rna.nd260by280 + '\n260/230=' + lysate.rna.nd260by230; |
2688 |
23 Sep 14 |
nicklas |
768 |
|
3470 |
27 Aug 15 |
nicklas |
lysate.rna.quantity = Math.max(0, lysate.rna.ndConc * lysate.rna.volume / 1000); |
5356 |
12 Apr 19 |
nicklas |
var enoughQuantity = lysate.rna.quantity > MINIMAL_PRE_NORMALIZE_QUANTITY_RNA; |
3468 |
26 Aug 15 |
nicklas |
lysate.rna.flag = enoughQuantity ? null : 'NotEnoughRemainingQuantity'; |
3468 |
26 Aug 15 |
nicklas |
frm['rnaPreNormalize'+id].disabled = !enoughQuantity; |
3468 |
26 Aug 15 |
nicklas |
Doc.element('rnaQuantity'+id).innerHTML = Reggie.formatNumber(lysate.rna.quantity || null, null, 2) || '-'; |
5591 |
04 Sep 19 |
nicklas |
frm['rnaPreNormalize'+id].checked = enoughQuantity && ENABLE_RNA_PRENORMALIZE; |
3468 |
26 Aug 15 |
nicklas |
var warning = lysate.rna.quantity && !enoughQuantity; |
3468 |
26 Aug 15 |
nicklas |
Wizard.setInputStatus('rnaPreNormalize'+id, warning ? 'flag' : '', warning ? 'Not enough quantity' : ''); |
2688 |
23 Sep 14 |
nicklas |
777 |
|
3468 |
26 Aug 15 |
nicklas |
Doc.element('ftVol'+id).innerHTML = lysate.ft.volume; |
3468 |
26 Aug 15 |
nicklas |
Doc.addOrRemoveClass('ftVol'+id, 'nondefault', lysate.ft.volume != DEFAULT_FT_VOLUME); |
3468 |
26 Aug 15 |
nicklas |
780 |
|
3468 |
26 Aug 15 |
nicklas |
var cmnt = Doc.element('comments'+id); |
3468 |
26 Aug 15 |
nicklas |
var tooltip = []; |
3468 |
26 Aug 15 |
nicklas |
var comment = []; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.comment || lysate.dna.comment || lysate.rna.comment || lysate.ft.comment) |
3468 |
26 Aug 15 |
nicklas |
785 |
{ |
3468 |
26 Aug 15 |
nicklas |
comment[0] = 'Yes'; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.comment) tooltip[tooltip.length] = 'Lysate: ' + lysate.comment; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.dna.comment) tooltip[tooltip.length] = 'DNA: ' + lysate.dna.comment; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.rna.comment) tooltip[tooltip.length] = 'RNA: ' + lysate.rna.comment; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.ft.comment) tooltip[tooltip.length] = 'FlowThrough: ' + lysate.ft.comment; |
3468 |
26 Aug 15 |
nicklas |
791 |
} |
2688 |
23 Sep 14 |
nicklas |
792 |
|
3468 |
26 Aug 15 |
nicklas |
var modifiedReagents = false; |
3468 |
26 Aug 15 |
nicklas |
for (var rgNo = 0; rgNo < exreg.REAGENTS.length; rgNo++) |
3468 |
26 Aug 15 |
nicklas |
795 |
{ |
3468 |
26 Aug 15 |
nicklas |
var rg = exreg.REAGENTS[rgNo]; |
3468 |
26 Aug 15 |
nicklas |
if (lysate[rg]) |
2688 |
23 Sep 14 |
nicklas |
798 |
{ |
3468 |
26 Aug 15 |
nicklas |
tooltip[tooltip.length] = Doc.element(rg+'.title').innerHTML + ': ' + Strings.encodeTags(lysate[rg]); |
3468 |
26 Aug 15 |
nicklas |
modifiedReagents = true; |
2690 |
24 Sep 14 |
nicklas |
801 |
} |
2688 |
23 Sep 14 |
nicklas |
802 |
} |
3468 |
26 Aug 15 |
nicklas |
if (modifiedReagents) |
3468 |
26 Aug 15 |
nicklas |
804 |
{ |
3468 |
26 Aug 15 |
nicklas |
comment[comment.length] = 'Reagents'; |
3468 |
26 Aug 15 |
nicklas |
806 |
} |
3468 |
26 Aug 15 |
nicklas |
807 |
|
3468 |
26 Aug 15 |
nicklas |
if (tooltip.length > 0) |
3468 |
26 Aug 15 |
nicklas |
809 |
{ |
3468 |
26 Aug 15 |
nicklas |
cmnt.innerHTML = comment.join(', '); |
3468 |
26 Aug 15 |
nicklas |
Doc.addClass(cmnt, 'nondefault'); |
3468 |
26 Aug 15 |
nicklas |
cmnt.title = tooltip.join('\n'); |
3468 |
26 Aug 15 |
nicklas |
813 |
} |
3468 |
26 Aug 15 |
nicklas |
else |
3468 |
26 Aug 15 |
nicklas |
815 |
{ |
3468 |
26 Aug 15 |
nicklas |
cmnt.innerHTML = ''; |
3468 |
26 Aug 15 |
nicklas |
Doc.removeClass(cmnt, 'nondefault'); |
3468 |
26 Aug 15 |
nicklas |
cmnt.title = null; |
3468 |
26 Aug 15 |
nicklas |
819 |
} |
2688 |
23 Sep 14 |
nicklas |
820 |
} |
2688 |
23 Sep 14 |
nicklas |
821 |
|
2688 |
23 Sep 14 |
nicklas |
if (duplicatePosition) |
2688 |
23 Sep 14 |
nicklas |
823 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('downloadSampleIdFile', 'invalid', 'Duplicate Qiacube position: ' + duplicatePosition); |
2688 |
23 Sep 14 |
nicklas |
qiacubePositionsAreValid = false; |
2688 |
23 Sep 14 |
nicklas |
826 |
} |
2688 |
23 Sep 14 |
nicklas |
else |
2688 |
23 Sep 14 |
nicklas |
828 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('downloadSampleIdFile'); |
2688 |
23 Sep 14 |
nicklas |
qiacubePositionsAreValid = true; |
2688 |
23 Sep 14 |
nicklas |
831 |
} |
2688 |
23 Sep 14 |
nicklas |
832 |
} |
2688 |
23 Sep 14 |
nicklas |
833 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.editDnaRnaDetails = function(event) |
2688 |
23 Sep 14 |
nicklas |
835 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysateId = Data.int(event.currentTarget, 'lysate-id'); |
3468 |
26 Aug 15 |
nicklas |
var index = -1; |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
3468 |
26 Aug 15 |
nicklas |
839 |
{ |
3468 |
26 Aug 15 |
nicklas |
if (selectedLysates[i].id == lysateId) |
3468 |
26 Aug 15 |
nicklas |
841 |
{ |
3468 |
26 Aug 15 |
nicklas |
index = i; |
3468 |
26 Aug 15 |
nicklas |
break; |
3468 |
26 Aug 15 |
nicklas |
844 |
} |
3468 |
26 Aug 15 |
nicklas |
845 |
} |
3468 |
26 Aug 15 |
nicklas |
846 |
|
2688 |
23 Sep 14 |
nicklas |
var url = 'edit_dnarna_details.jsp?ID='+App.getSessionId(); |
2688 |
23 Sep 14 |
nicklas |
url += '&index='+index; |
3468 |
26 Aug 15 |
nicklas |
url += '&lysate=' + encodeURIComponent(selectedLysates[index].name); |
2690 |
24 Sep 14 |
nicklas |
Dialogs.openPopup(url, 'EditDnaRnaDetails'+index, 750, 500); |
2688 |
23 Sep 14 |
nicklas |
851 |
} |
2688 |
23 Sep 14 |
nicklas |
852 |
|
3468 |
26 Aug 15 |
nicklas |
exreg.getSelectedLysate = function(index) |
3468 |
26 Aug 15 |
nicklas |
854 |
{ |
3468 |
26 Aug 15 |
nicklas |
return selectedLysates[index]; |
3468 |
26 Aug 15 |
nicklas |
856 |
} |
3468 |
26 Aug 15 |
nicklas |
857 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.downloadSampleIdFile = function() |
2688 |
23 Sep 14 |
nicklas |
859 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
861 |
|
2688 |
23 Sep 14 |
nicklas |
if (!qiacubePositionsAreValid) |
2688 |
23 Sep 14 |
nicklas |
863 |
{ |
3468 |
26 Aug 15 |
nicklas |
Forms.showNotification('downloadSampleIdFile', 'QIAcube positions are not valid. Please fix before downloading the file.'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
866 |
} |
2688 |
23 Sep 14 |
nicklas |
867 |
|
4095 |
13 Sep 16 |
nicklas |
var rnaNames = []; |
4095 |
13 Sep 16 |
nicklas |
var dnaNames = []; |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2688 |
23 Sep 14 |
nicklas |
url += '&cmd=DownloadNanoDropSampleIdFile'; |
2688 |
23 Sep 14 |
nicklas |
url += '&qiacubeDate='+encodeURIComponent(frm.qiacubeDate.value); |
2688 |
23 Sep 14 |
nicklas |
url += '&qiacubeRunNo='+encodeURIComponent(frm.qiacubeRunNo.value); |
2688 |
23 Sep 14 |
nicklas |
875 |
|
3468 |
26 Aug 15 |
nicklas |
var selected = []; |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
878 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
4095 |
13 Sep 16 |
nicklas |
dnaNames[lysate.nanoDropOrder] = lysate.dna.name; |
4095 |
13 Sep 16 |
nicklas |
rnaNames[lysate.nanoDropOrder] = lysate.rna.name; |
2688 |
23 Sep 14 |
nicklas |
882 |
} |
4095 |
13 Sep 16 |
nicklas |
url += '&rnaNames=' + encodeURIComponent(rnaNames.join(',')); |
4095 |
13 Sep 16 |
nicklas |
url += '&dnaNames=' + encodeURIComponent(dnaNames.join(',')); |
2688 |
23 Sep 14 |
nicklas |
window.open(url); |
2688 |
23 Sep 14 |
nicklas |
886 |
} |
2688 |
23 Sep 14 |
nicklas |
887 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.nanoDropFileOnChange = function() |
2688 |
23 Sep 14 |
nicklas |
889 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
var file = frm.nanoDropFile.files[0]; |
2688 |
23 Sep 14 |
nicklas |
892 |
|
2688 |
23 Sep 14 |
nicklas |
var reader = new FileReader(); |
2688 |
23 Sep 14 |
nicklas |
reader.onload = exreg.nanoDropFileLoaded; |
2688 |
23 Sep 14 |
nicklas |
reader.readAsText(file); |
2688 |
23 Sep 14 |
nicklas |
896 |
} |
2688 |
23 Sep 14 |
nicklas |
897 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.nanoDropFileLoaded = function(event) |
2688 |
23 Sep 14 |
nicklas |
899 |
{ |
2688 |
23 Sep 14 |
nicklas |
exreg.parseNanoDropFile(event.target.result); |
2688 |
23 Sep 14 |
nicklas |
901 |
} |
2688 |
23 Sep 14 |
nicklas |
902 |
|
2688 |
23 Sep 14 |
nicklas |
903 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.parseNanoDropFile = function(data) |
2688 |
23 Sep 14 |
nicklas |
905 |
{ |
2688 |
23 Sep 14 |
nicklas |
nanoDropFileIsValid = false; |
2688 |
23 Sep 14 |
nicklas |
907 |
|
2688 |
23 Sep 14 |
nicklas |
try |
2688 |
23 Sep 14 |
nicklas |
909 |
{ |
2688 |
23 Sep 14 |
nicklas |
// Reset the existing values |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
912 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3468 |
26 Aug 15 |
nicklas |
lysate.dna.ndConc = null; |
3468 |
26 Aug 15 |
nicklas |
lysate.dna.nd260by280 = null; |
3468 |
26 Aug 15 |
nicklas |
lysate.dna.nd260by230 = null; |
3468 |
26 Aug 15 |
nicklas |
lysate.rna.ndConc = null; |
3468 |
26 Aug 15 |
nicklas |
lysate.rna.nd260by280 = null; |
3468 |
26 Aug 15 |
nicklas |
lysate.rna.nd260by230 = null; |
2688 |
23 Sep 14 |
nicklas |
920 |
} |
2688 |
23 Sep 14 |
nicklas |
921 |
|
2688 |
23 Sep 14 |
nicklas |
var lines = data.split(/[\n\r]+/); |
2688 |
23 Sep 14 |
nicklas |
var columns = lines[0].split(/ *\t */); |
2688 |
23 Sep 14 |
nicklas |
924 |
|
2688 |
23 Sep 14 |
nicklas |
var sampleIndex = exreg.findColumn(columns, 'Sample ID'); |
2688 |
23 Sep 14 |
nicklas |
if (sampleIndex == -1) return; |
2688 |
23 Sep 14 |
nicklas |
927 |
|
2688 |
23 Sep 14 |
nicklas |
var wellIndex = exreg.findColumn(columns, 'Well'); |
2688 |
23 Sep 14 |
nicklas |
if (wellIndex == -1) return; |
2688 |
23 Sep 14 |
nicklas |
930 |
|
2688 |
23 Sep 14 |
nicklas |
var ndConcIndex = exreg.findColumn(columns, 'Conc.'); |
2688 |
23 Sep 14 |
nicklas |
if (ndConcIndex == -1) return; |
2688 |
23 Sep 14 |
nicklas |
933 |
|
2688 |
23 Sep 14 |
nicklas |
var nd260by280Index = exreg.findColumn(columns, '260/280'); |
2688 |
23 Sep 14 |
nicklas |
if (nd260by280Index == -1) return; |
2688 |
23 Sep 14 |
nicklas |
936 |
|
2688 |
23 Sep 14 |
nicklas |
var nd260by230Index = exreg.findColumn(columns, '260/230'); |
2688 |
23 Sep 14 |
nicklas |
if (nd260by230Index == -1) return; |
2688 |
23 Sep 14 |
nicklas |
939 |
|
2688 |
23 Sep 14 |
nicklas |
var numImported = 0; |
2688 |
23 Sep 14 |
nicklas |
for (var i = 1; i < lines.length; i++) |
2688 |
23 Sep 14 |
nicklas |
942 |
{ |
2688 |
23 Sep 14 |
nicklas |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
2688 |
23 Sep 14 |
nicklas |
944 |
|
2688 |
23 Sep 14 |
nicklas |
var row = lines[i].split(/ *\t */); |
2688 |
23 Sep 14 |
nicklas |
if (row.length != columns.length) |
2688 |
23 Sep 14 |
nicklas |
947 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
950 |
} |
2688 |
23 Sep 14 |
nicklas |
951 |
|
2688 |
23 Sep 14 |
nicklas |
var sampleId = row[sampleIndex]; |
2688 |
23 Sep 14 |
nicklas |
if (!sampleId || sampleId == 'blank') continue; // with the next line |
2688 |
23 Sep 14 |
nicklas |
954 |
|
2688 |
23 Sep 14 |
nicklas |
var rnaOrDna = exreg.findRnaOrDna(sampleId, i+1); |
2688 |
23 Sep 14 |
nicklas |
if (!rnaOrDna) return; // This is an error condition |
2688 |
23 Sep 14 |
nicklas |
957 |
|
2688 |
23 Sep 14 |
nicklas |
if (rnaOrDna.well != row[wellIndex]) |
2688 |
23 Sep 14 |
nicklas |
959 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; Expected to find "' + sampleId + '" in well [' + rnaOrDna.well + '] not [' + row[wellIndex] + ']'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
962 |
} |
2688 |
23 Sep 14 |
nicklas |
963 |
|
2688 |
23 Sep 14 |
nicklas |
var ndConc = exreg.getNumber(row[ndConcIndex]); |
2688 |
23 Sep 14 |
nicklas |
if (isNaN(ndConc)) |
2688 |
23 Sep 14 |
nicklas |
966 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid NDConc value for "' + sampleId + '": ' + row[ndConcIndex]); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
969 |
} |
2688 |
23 Sep 14 |
nicklas |
970 |
|
2688 |
23 Sep 14 |
nicklas |
// If there are multiple entries for the same item, keep the largest NDConc |
2688 |
23 Sep 14 |
nicklas |
var isFirstValue = rnaOrDna.ndConc == null; |
2688 |
23 Sep 14 |
nicklas |
if (isFirstValue || ndConc > rnaOrDna.ndConc) |
2688 |
23 Sep 14 |
nicklas |
974 |
{ |
2688 |
23 Sep 14 |
nicklas |
var nd260by280 = exreg.getNumber(row[nd260by280Index]); |
2688 |
23 Sep 14 |
nicklas |
if (isNaN(nd260by280)) |
2688 |
23 Sep 14 |
nicklas |
977 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid 260/280 value for "' + sampleId + '": ' + row[nd260by280Index]); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
980 |
} |
2688 |
23 Sep 14 |
nicklas |
981 |
|
2688 |
23 Sep 14 |
nicklas |
var nd260by230 = exreg.getNumber(row[nd260by230Index]); |
2688 |
23 Sep 14 |
nicklas |
if (isNaN(nd260by230)) |
2688 |
23 Sep 14 |
nicklas |
984 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid 260/230 value for "' + sampleId + '": '+row[nd260by230Index]); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
987 |
} |
2688 |
23 Sep 14 |
nicklas |
988 |
|
2688 |
23 Sep 14 |
nicklas |
// Store values |
2688 |
23 Sep 14 |
nicklas |
rnaOrDna.ndConc = ndConc; |
2688 |
23 Sep 14 |
nicklas |
rnaOrDna.nd260by280 = nd260by280; |
2688 |
23 Sep 14 |
nicklas |
rnaOrDna.nd260by230 = nd260by230; |
2688 |
23 Sep 14 |
nicklas |
993 |
|
2688 |
23 Sep 14 |
nicklas |
// Only update counter for the first value (not when replacing a lower value) |
2688 |
23 Sep 14 |
nicklas |
if (isFirstValue) |
2688 |
23 Sep 14 |
nicklas |
996 |
{ |
2688 |
23 Sep 14 |
nicklas |
numImported++; |
2688 |
23 Sep 14 |
nicklas |
998 |
} |
2688 |
23 Sep 14 |
nicklas |
999 |
} |
2688 |
23 Sep 14 |
nicklas |
1000 |
|
2688 |
23 Sep 14 |
nicklas |
1001 |
} |
2688 |
23 Sep 14 |
nicklas |
1002 |
|
3468 |
26 Aug 15 |
nicklas |
if (numImported != selectedLysates.length*2) |
2688 |
23 Sep 14 |
nicklas |
1004 |
{ |
3468 |
26 Aug 15 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'Could not find values for all '+(selectedLysates.length*2)+' DNA/RNA samples: ' + numImported); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
1007 |
} |
2688 |
23 Sep 14 |
nicklas |
1008 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'valid'); |
2688 |
23 Sep 14 |
nicklas |
nanoDropFileIsValid = true; |
2688 |
23 Sep 14 |
nicklas |
1011 |
} |
2688 |
23 Sep 14 |
nicklas |
finally |
2688 |
23 Sep 14 |
nicklas |
1013 |
{ |
2688 |
23 Sep 14 |
nicklas |
exreg.updateDetailsTable(); |
2688 |
23 Sep 14 |
nicklas |
1015 |
} |
2688 |
23 Sep 14 |
nicklas |
1016 |
|
2688 |
23 Sep 14 |
nicklas |
1017 |
} |
2688 |
23 Sep 14 |
nicklas |
1018 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.findColumn = function(columns, col) |
2688 |
23 Sep 14 |
nicklas |
1020 |
{ |
2688 |
23 Sep 14 |
nicklas |
var colIndex = columns.indexOf(col); |
2688 |
23 Sep 14 |
nicklas |
if (colIndex == -1) |
2688 |
23 Sep 14 |
nicklas |
1023 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line 1; Can\'t find "' + col + '" column'); |
2688 |
23 Sep 14 |
nicklas |
1025 |
} |
2688 |
23 Sep 14 |
nicklas |
return colIndex; |
2688 |
23 Sep 14 |
nicklas |
1027 |
} |
2688 |
23 Sep 14 |
nicklas |
1028 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.getNumber = function(sValue) |
2688 |
23 Sep 14 |
nicklas |
1030 |
{ |
2688 |
23 Sep 14 |
nicklas |
return parseFloat(sValue.replace(/,/, '.')); |
2688 |
23 Sep 14 |
nicklas |
1032 |
} |
2688 |
23 Sep 14 |
nicklas |
1033 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.findRnaOrDna = function(sampleId, lineNo) |
2688 |
23 Sep 14 |
nicklas |
1035 |
{ |
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
1037 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3468 |
26 Aug 15 |
nicklas |
if (lysate.rna.name == sampleId) |
2688 |
23 Sep 14 |
nicklas |
1040 |
{ |
3468 |
26 Aug 15 |
nicklas |
return lysate.rna; |
2688 |
23 Sep 14 |
nicklas |
1042 |
} |
3468 |
26 Aug 15 |
nicklas |
else if (lysate.dna.name == sampleId) |
3468 |
26 Aug 15 |
nicklas |
1044 |
{ |
3468 |
26 Aug 15 |
nicklas |
return lysate.dna; |
3468 |
26 Aug 15 |
nicklas |
1046 |
} |
2688 |
23 Sep 14 |
nicklas |
1047 |
} |
2688 |
23 Sep 14 |
nicklas |
1048 |
|
2688 |
23 Sep 14 |
nicklas |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + lineNo + '; Can\'t find RNA/DNA with name "' + sampleId + '"'); |
2688 |
23 Sep 14 |
nicklas |
return null; |
2688 |
23 Sep 14 |
nicklas |
1051 |
} |
2688 |
23 Sep 14 |
nicklas |
1052 |
|
2688 |
23 Sep 14 |
nicklas |
1053 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.generateFakeNanoDropFile = function() |
2688 |
23 Sep 14 |
nicklas |
1055 |
{ |
2688 |
23 Sep 14 |
nicklas |
if (location.protocol == 'https:') |
2688 |
23 Sep 14 |
nicklas |
1057 |
{ |
2688 |
23 Sep 14 |
nicklas |
Forms.showNotification('btnFakeNanoFropFile', 'For security reasons, this function can\'t be used on HTTPS servers.'); |
2688 |
23 Sep 14 |
nicklas |
return; |
2688 |
23 Sep 14 |
nicklas |
1060 |
} |
2688 |
23 Sep 14 |
nicklas |
1061 |
|
2688 |
23 Sep 14 |
nicklas |
var FILE_HEADER = ['Well', 'Sample ID', 'Conc.', '260/280', '260/230']; |
2688 |
23 Sep 14 |
nicklas |
var data = FILE_HEADER.join('\t')+'\n'; |
2688 |
23 Sep 14 |
nicklas |
1064 |
|
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
1066 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3468 |
26 Aug 15 |
nicklas |
var line = []; |
3468 |
26 Aug 15 |
nicklas |
// DNA |
3468 |
26 Aug 15 |
nicklas |
line[0] = lysate.dna.well; |
3468 |
26 Aug 15 |
nicklas |
line[1] = lysate.dna.name; |
3470 |
27 Aug 15 |
nicklas |
line[2] = Numbers.formatNumber(Math.random() > 0.9 ? -Math.random() : Math.random()*200+5, 2); |
3468 |
26 Aug 15 |
nicklas |
line[3] = Numbers.formatNumber(Math.random()*.5+2, 2); |
3468 |
26 Aug 15 |
nicklas |
line[4] = Numbers.formatNumber(Math.random()+1, 2); |
3468 |
26 Aug 15 |
nicklas |
data += line.join('\t') + '\n'; |
3468 |
26 Aug 15 |
nicklas |
// RNA |
3468 |
26 Aug 15 |
nicklas |
line[0] = lysate.rna.well; |
3468 |
26 Aug 15 |
nicklas |
line[1] = lysate.rna.name; |
3470 |
27 Aug 15 |
nicklas |
line[2] = Numbers.formatNumber(Math.random() > 0.9 ? -Math.random() : Math.random()*200+5, 2); |
3468 |
26 Aug 15 |
nicklas |
line[3] = Numbers.formatNumber(Math.random()*.5+2, 2); |
3468 |
26 Aug 15 |
nicklas |
line[4] = Numbers.formatNumber(Math.random()+1, 2); |
3468 |
26 Aug 15 |
nicklas |
data += line.join('\t') + '\n'; |
2688 |
23 Sep 14 |
nicklas |
1083 |
} |
2688 |
23 Sep 14 |
nicklas |
exreg.parseNanoDropFile(data); |
2688 |
23 Sep 14 |
nicklas |
1085 |
} |
2688 |
23 Sep 14 |
nicklas |
1086 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.validateStep3 = function(event) |
2688 |
23 Sep 14 |
nicklas |
1088 |
{ |
2688 |
23 Sep 14 |
nicklas |
var valid = true; |
2688 |
23 Sep 14 |
nicklas |
valid &= nanoDropFileIsValid; |
2688 |
23 Sep 14 |
nicklas |
valid &= qiacubePositionsAreValid; |
2688 |
23 Sep 14 |
nicklas |
1092 |
|
2688 |
23 Sep 14 |
nicklas |
if (!valid) event.preventDefault(); |
2688 |
23 Sep 14 |
nicklas |
1094 |
} |
2688 |
23 Sep 14 |
nicklas |
1095 |
|
2688 |
23 Sep 14 |
nicklas |
1096 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.submit = function() |
2688 |
23 Sep 14 |
nicklas |
1098 |
{ |
2688 |
23 Sep 14 |
nicklas |
var frm = document.forms['reggie']; |
2688 |
23 Sep 14 |
nicklas |
1100 |
|
2688 |
23 Sep 14 |
nicklas |
var submitInfo = {}; |
2688 |
23 Sep 14 |
nicklas |
submitInfo.lysates = []; |
2688 |
23 Sep 14 |
nicklas |
1103 |
|
3468 |
26 Aug 15 |
nicklas |
for (var i = 0; i < selectedLysates.length; i++) |
2688 |
23 Sep 14 |
nicklas |
1105 |
{ |
3468 |
26 Aug 15 |
nicklas |
var lysate = selectedLysates[i]; |
3470 |
27 Aug 15 |
nicklas |
lysate.rna.preNormalize = frm['rnaPreNormalize'+lysate.id].checked; |
5356 |
12 Apr 19 |
nicklas |
lysate.dna.preNormalize = frm['dnaPreNormalize'+lysate.id].checked; |
3470 |
27 Aug 15 |
nicklas |
submitInfo.lysates[submitInfo.lysates.length] = lysate; |
2688 |
23 Sep 14 |
nicklas |
1110 |
} |
2688 |
23 Sep 14 |
nicklas |
1111 |
|
2690 |
24 Sep 14 |
nicklas |
// Lysis |
2688 |
23 Sep 14 |
nicklas |
submitInfo.lysisDate = frm.lysisDate.value; |
2688 |
23 Sep 14 |
nicklas |
submitInfo.lysisProtocol = parseInt(frm.lysisProtocol.value, 10); |
2690 |
24 Sep 14 |
nicklas |
1115 |
|
2690 |
24 Sep 14 |
nicklas |
// Qiacube |
2688 |
23 Sep 14 |
nicklas |
submitInfo.qiacubeDate = frm.qiacubeDate.value; |
2688 |
23 Sep 14 |
nicklas |
submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value, 10); |
2688 |
23 Sep 14 |
nicklas |
submitInfo.qiacubeOperator = frm.qiacubeOperator.value; |
2688 |
23 Sep 14 |
nicklas |
submitInfo.dnaProtocol = parseInt(frm.dnaProtocol.value, 10); |
2688 |
23 Sep 14 |
nicklas |
submitInfo.rnaProtocol = parseInt(frm.rnaProtocol.value, 10); |
2688 |
23 Sep 14 |
nicklas |
submitInfo.ftProtocol = parseInt(frm.ftProtocol.value, 10); |
2688 |
23 Sep 14 |
nicklas |
1123 |
|
2690 |
24 Sep 14 |
nicklas |
// Reagents |
2690 |
24 Sep 14 |
nicklas |
for (var i = 0; i < exreg.REAGENTS.length; i++) |
2690 |
24 Sep 14 |
nicklas |
1126 |
{ |
2690 |
24 Sep 14 |
nicklas |
var rg = exreg.REAGENTS[i]; |
2690 |
24 Sep 14 |
nicklas |
submitInfo[rg] = frm[rg].value; |
2690 |
24 Sep 14 |
nicklas |
1129 |
} |
2688 |
23 Sep 14 |
nicklas |
1130 |
|
2688 |
23 Sep 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2688 |
23 Sep 14 |
nicklas |
url += '&cmd=RegisterDnaRnaFt'; |
2688 |
23 Sep 14 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
2688 |
23 Sep 14 |
nicklas |
Wizard.asyncJsonRequest(url, exreg.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2688 |
23 Sep 14 |
nicklas |
1135 |
} |
2688 |
23 Sep 14 |
nicklas |
1136 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.submissionResults = function(response) |
2688 |
23 Sep 14 |
nicklas |
1138 |
{ |
2688 |
23 Sep 14 |
nicklas |
Wizard.showFinalMessage(response.messages); |
2688 |
23 Sep 14 |
nicklas |
Doc.show('gorestart'); |
2688 |
23 Sep 14 |
nicklas |
if (response.createdRna && response.createdRna.length > 0) |
2688 |
23 Sep 14 |
nicklas |
1142 |
{ |
2688 |
23 Sep 14 |
nicklas |
createdRna = response.createdRna; |
2688 |
23 Sep 14 |
nicklas |
Doc.show('rnaQcWizard'); |
2688 |
23 Sep 14 |
nicklas |
1145 |
} |
2688 |
23 Sep 14 |
nicklas |
1146 |
} |
2688 |
23 Sep 14 |
nicklas |
1147 |
|
2688 |
23 Sep 14 |
nicklas |
exreg.goRnaQc = function() |
2688 |
23 Sep 14 |
nicklas |
1149 |
{ |
2688 |
23 Sep 14 |
nicklas |
var url = 'rnaqc_aliquot.jsp?ID='+App.getSessionId(); |
2688 |
23 Sep 14 |
nicklas |
for (var i = 0; i < createdRna.length; i++) |
2688 |
23 Sep 14 |
nicklas |
1152 |
{ |
2688 |
23 Sep 14 |
nicklas |
url += '&rna='+createdRna[i]; |
2688 |
23 Sep 14 |
nicklas |
1154 |
} |
2688 |
23 Sep 14 |
nicklas |
location.href = url; |
2688 |
23 Sep 14 |
nicklas |
1156 |
} |
2688 |
23 Sep 14 |
nicklas |
1157 |
|
2688 |
23 Sep 14 |
nicklas |
1158 |
|
2688 |
23 Sep 14 |
nicklas |
return exreg; |
2688 |
23 Sep 14 |
nicklas |
1160 |
}(); |
2688 |
23 Sep 14 |
nicklas |
1161 |
|
2688 |
23 Sep 14 |
nicklas |
Doc.onLoad(ExtractionReg.initPage); |
2688 |
23 Sep 14 |
nicklas |
1163 |
|