2903 |
06 Nov 14 |
nicklas |
var RnaNormalize = function() |
2903 |
06 Nov 14 |
nicklas |
2 |
{ |
2903 |
06 Nov 14 |
nicklas |
var normalize = {}; |
3269 |
23 Apr 15 |
nicklas |
4 |
|
3269 |
23 Apr 15 |
nicklas |
// The minial volume of RNA we want to take when normalizing |
3269 |
23 Apr 15 |
nicklas |
// For RNA with high concentration we must make a larger mix to reach the target concentation |
3269 |
23 Apr 15 |
nicklas |
var MINIMAL_RNA_VOLUME = 1; // µl |
3269 |
23 Apr 15 |
nicklas |
var hasInitProtocols = false; |
2903 |
06 Nov 14 |
nicklas |
9 |
|
2903 |
06 Nov 14 |
nicklas |
var selectedRna; |
2903 |
06 Nov 14 |
nicklas |
var subtypeRna = null; |
2903 |
06 Nov 14 |
nicklas |
12 |
|
2903 |
06 Nov 14 |
nicklas |
var autoGoNext = 0; |
2903 |
06 Nov 14 |
nicklas |
var newRna = []; |
2903 |
06 Nov 14 |
nicklas |
15 |
|
2903 |
06 Nov 14 |
nicklas |
// Page initialization |
2903 |
06 Nov 14 |
nicklas |
normalize.initPage = function() |
2903 |
06 Nov 14 |
nicklas |
18 |
{ |
2903 |
06 Nov 14 |
nicklas |
// Step 1 |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('step-1', 'wizard-validate', normalize.validateStep1); |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('btnSelectRna', normalize.selectRna); |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('rna', 'base-selected', normalize.onRnaSelected); |
2903 |
06 Nov 14 |
nicklas |
23 |
|
2903 |
06 Nov 14 |
nicklas |
// Step 2 |
3269 |
23 Apr 15 |
nicklas |
Events.addEventHandler('normalizationProtocol', 'change', normalize.protocolOnChange); |
3269 |
23 Apr 15 |
nicklas |
Events.addEventHandler('normalizationProtocol', 'keyup', normalize.protocolOnChange); |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', normalize.initializeStep2); |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('step-2', 'wizard-validate', normalize.validateStep2); |
2903 |
06 Nov 14 |
nicklas |
29 |
|
2903 |
06 Nov 14 |
nicklas |
// Step 3 |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('step-3', 'wizard-initialize', normalize.initializeStep3); |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('normalizationDate', 'blur', Wizard.validateDate); |
2903 |
06 Nov 14 |
nicklas |
33 |
|
2903 |
06 Nov 14 |
nicklas |
// Navigation |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('goprint', normalize.printVersion); |
2903 |
06 Nov 14 |
nicklas |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
2903 |
06 Nov 14 |
nicklas |
40 |
|
2903 |
06 Nov 14 |
nicklas |
// Final registration |
2903 |
06 Nov 14 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', normalize.submit); |
2903 |
06 Nov 14 |
nicklas |
43 |
|
2903 |
06 Nov 14 |
nicklas |
var rna = Data.json('page-data', 'rna-id'); |
2903 |
06 Nov 14 |
nicklas |
if (rna.length > 0) |
2903 |
06 Nov 14 |
nicklas |
46 |
{ |
2903 |
06 Nov 14 |
nicklas |
Doc.show('step-1'); |
2903 |
06 Nov 14 |
nicklas |
autoGoNext = rna.length; |
2903 |
06 Nov 14 |
nicklas |
// Get more information about the selected rna |
2903 |
06 Nov 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2903 |
06 Nov 14 |
nicklas |
url += '&cmd=GetRNAInfoForNormalize&rnaIds=' + rna.join(','); |
2903 |
06 Nov 14 |
nicklas |
Wizard.asyncJsonRequest(url, normalize.onRnaInfoLoaded); |
2903 |
06 Nov 14 |
nicklas |
53 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
55 |
{ |
2903 |
06 Nov 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2903 |
06 Nov 14 |
nicklas |
url += '&cmd=GetRNAToNormalize'; |
2903 |
06 Nov 14 |
nicklas |
Wizard.showLoadingAnimation('Loading RNA extracts...'); |
2903 |
06 Nov 14 |
nicklas |
Wizard.asyncJsonRequest(url, normalize.onRnaLoaded); |
2903 |
06 Nov 14 |
nicklas |
60 |
} |
2903 |
06 Nov 14 |
nicklas |
61 |
} |
2903 |
06 Nov 14 |
nicklas |
62 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.onRnaLoaded = function(response) |
2903 |
06 Nov 14 |
nicklas |
64 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
var rnaExtracts = response.rnaExtracts; |
2903 |
06 Nov 14 |
nicklas |
67 |
|
2903 |
06 Nov 14 |
nicklas |
rnaExtracts.sort(normalize.sortByQiacubePosition); |
2903 |
06 Nov 14 |
nicklas |
69 |
|
2903 |
06 Nov 14 |
nicklas |
if (rnaExtracts.length > 0) |
2903 |
06 Nov 14 |
nicklas |
71 |
{ |
2903 |
06 Nov 14 |
nicklas |
var qiacubeRun = rnaExtracts[0].QiacubeDate + '#' + rnaExtracts[0].QiacubeRunNo; |
2903 |
06 Nov 14 |
nicklas |
for (var i=0; i < rnaExtracts.length; i++) |
2903 |
06 Nov 14 |
nicklas |
74 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = rnaExtracts[i]; |
2903 |
06 Nov 14 |
nicklas |
var selected = (rna.QiacubeDate + '#' + rna.QiacubeRunNo) == qiacubeRun; |
2903 |
06 Nov 14 |
nicklas |
normalize.addRnaOption(frm.rna, rna, selected); |
2903 |
06 Nov 14 |
nicklas |
78 |
} |
2903 |
06 Nov 14 |
nicklas |
79 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
81 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.setInputStatus('rna', 'invalid', 'No RNA available for normalization.'); |
2903 |
06 Nov 14 |
nicklas |
83 |
} |
2903 |
06 Nov 14 |
nicklas |
84 |
|
2903 |
06 Nov 14 |
nicklas |
Doc.show('step-1'); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('gonext'); |
2903 |
06 Nov 14 |
nicklas |
87 |
} |
2903 |
06 Nov 14 |
nicklas |
88 |
|
2903 |
06 Nov 14 |
nicklas |
89 |
/** |
2903 |
06 Nov 14 |
nicklas |
Sort by qiacube date, run number and position |
2903 |
06 Nov 14 |
nicklas |
91 |
*/ |
2903 |
06 Nov 14 |
nicklas |
normalize.sortByQiacubePosition = function(a, b) |
2903 |
06 Nov 14 |
nicklas |
93 |
{ |
2903 |
06 Nov 14 |
nicklas |
if (a.QiacubeDate == b.QiacubeDate) |
2903 |
06 Nov 14 |
nicklas |
95 |
{ |
2903 |
06 Nov 14 |
nicklas |
if (a.QiacubeRunNo == b.QiacubeRunNo) |
2903 |
06 Nov 14 |
nicklas |
97 |
{ |
2903 |
06 Nov 14 |
nicklas |
return a.QiacubePosition-b.QiacubePosition; |
2903 |
06 Nov 14 |
nicklas |
99 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
101 |
{ |
2903 |
06 Nov 14 |
nicklas |
return a.QiacubeRunNo - b.QiacubeRunNo; |
2903 |
06 Nov 14 |
nicklas |
103 |
} |
2903 |
06 Nov 14 |
nicklas |
104 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
106 |
{ |
2903 |
06 Nov 14 |
nicklas |
return a.QiacubeDate < b.QiacubeDate ? -1 : 1; |
2903 |
06 Nov 14 |
nicklas |
108 |
} |
2903 |
06 Nov 14 |
nicklas |
109 |
|
2903 |
06 Nov 14 |
nicklas |
return a.id - b.id; |
2903 |
06 Nov 14 |
nicklas |
111 |
} |
2903 |
06 Nov 14 |
nicklas |
112 |
|
2903 |
06 Nov 14 |
nicklas |
113 |
|
2903 |
06 Nov 14 |
nicklas |
114 |
/** |
2903 |
06 Nov 14 |
nicklas |
Sort by qiacube date, run number and position |
2903 |
06 Nov 14 |
nicklas |
116 |
*/ |
2903 |
06 Nov 14 |
nicklas |
normalize.sortByStorageLocation = function(a, b) |
2903 |
06 Nov 14 |
nicklas |
118 |
{ |
6219 |
20 Apr 21 |
nicklas |
if (a.bioWell && b.bioWell) |
2903 |
06 Nov 14 |
nicklas |
120 |
{ |
6219 |
20 Apr 21 |
nicklas |
if (a.bioWell.bioPlate.name == b.bioWell.bioPlate.name) |
6219 |
20 Apr 21 |
nicklas |
122 |
{ |
6219 |
20 Apr 21 |
nicklas |
return a.bioWell.location < b.bioWell.location ? -1 : 1; |
6219 |
20 Apr 21 |
nicklas |
124 |
} |
6219 |
20 Apr 21 |
nicklas |
else |
6219 |
20 Apr 21 |
nicklas |
126 |
{ |
6219 |
20 Apr 21 |
nicklas |
return a.bioWell.bioPlate.name < b.bioWell.bioPlate.name ? -1 : 1; |
6219 |
20 Apr 21 |
nicklas |
128 |
} |
2903 |
06 Nov 14 |
nicklas |
129 |
} |
2903 |
06 Nov 14 |
nicklas |
130 |
|
2903 |
06 Nov 14 |
nicklas |
return a.id - b.id; |
2903 |
06 Nov 14 |
nicklas |
132 |
} |
2903 |
06 Nov 14 |
nicklas |
133 |
|
2903 |
06 Nov 14 |
nicklas |
134 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.selectRna = function() |
2903 |
06 Nov 14 |
nicklas |
136 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
if (frm.rna.disabled) return; |
2903 |
06 Nov 14 |
nicklas |
139 |
|
2903 |
06 Nov 14 |
nicklas |
if (subtypeRna == null) |
2903 |
06 Nov 14 |
nicklas |
141 |
{ |
2903 |
06 Nov 14 |
nicklas |
subtypeRna = Reggie.getSubtypeInfo('RNA'); |
2903 |
06 Nov 14 |
nicklas |
143 |
} |
2903 |
06 Nov 14 |
nicklas |
144 |
|
2903 |
06 Nov 14 |
nicklas |
newRna = []; |
2903 |
06 Nov 14 |
nicklas |
var url = '&resetTemporary=1'; |
2903 |
06 Nov 14 |
nicklas |
url += '&tmpfilter:INT:itemSubtype='+subtypeRna.id; |
2903 |
06 Nov 14 |
nicklas |
Dialogs.selectItem('EXTRACT', 'rna', 1, url); |
2903 |
06 Nov 14 |
nicklas |
149 |
} |
2903 |
06 Nov 14 |
nicklas |
150 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.onRnaSelected = function(event) |
2903 |
06 Nov 14 |
nicklas |
152 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = event.detail; |
2903 |
06 Nov 14 |
nicklas |
154 |
|
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
var rnaList = frm.rna; |
2903 |
06 Nov 14 |
nicklas |
var isNew = true; |
2903 |
06 Nov 14 |
nicklas |
for (var i = 0; i < rnaList.length; i++) |
2903 |
06 Nov 14 |
nicklas |
159 |
{ |
2903 |
06 Nov 14 |
nicklas |
if (rnaList[i].value == rna.id) |
2903 |
06 Nov 14 |
nicklas |
161 |
{ |
2903 |
06 Nov 14 |
nicklas |
rnaList[i].selected = true; |
2903 |
06 Nov 14 |
nicklas |
isNew = false; |
2903 |
06 Nov 14 |
nicklas |
164 |
} |
2903 |
06 Nov 14 |
nicklas |
165 |
} |
2903 |
06 Nov 14 |
nicklas |
166 |
|
2903 |
06 Nov 14 |
nicklas |
if (isNew) newRna[newRna.length] = rna.id; |
2903 |
06 Nov 14 |
nicklas |
168 |
|
2903 |
06 Nov 14 |
nicklas |
if (event.detail.remaining == 0 && newRna.length > 0) |
2903 |
06 Nov 14 |
nicklas |
170 |
{ |
2903 |
06 Nov 14 |
nicklas |
// Get more information about the selected rna |
2903 |
06 Nov 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2903 |
06 Nov 14 |
nicklas |
url += '&cmd=GetRNAInfoForNormalize&rnaIds=' + newRna.join(','); |
2903 |
06 Nov 14 |
nicklas |
Wizard.asyncJsonRequest(url, normalize.onRnaInfoLoaded); |
2903 |
06 Nov 14 |
nicklas |
175 |
} |
2903 |
06 Nov 14 |
nicklas |
176 |
} |
2903 |
06 Nov 14 |
nicklas |
177 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.onRnaInfoLoaded = function(response) |
2903 |
06 Nov 14 |
nicklas |
179 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
var rnaExtracts = response.rnaExtracts; |
2903 |
06 Nov 14 |
nicklas |
rnaExtracts.sort(normalize.sortByQiacubePosition); |
2903 |
06 Nov 14 |
nicklas |
183 |
|
2903 |
06 Nov 14 |
nicklas |
for (var rnaNo = 0; rnaNo < rnaExtracts.length; rnaNo++) |
2903 |
06 Nov 14 |
nicklas |
185 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = rnaExtracts[rnaNo]; |
2903 |
06 Nov 14 |
nicklas |
normalize.addRnaOption(frm.rna, rna, true); |
2903 |
06 Nov 14 |
nicklas |
188 |
} |
2903 |
06 Nov 14 |
nicklas |
189 |
|
2903 |
06 Nov 14 |
nicklas |
if (frm.rna.length == autoGoNext) |
2903 |
06 Nov 14 |
nicklas |
191 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.goNext(true); |
2903 |
06 Nov 14 |
nicklas |
193 |
} |
2903 |
06 Nov 14 |
nicklas |
194 |
} |
2903 |
06 Nov 14 |
nicklas |
195 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.addRnaOption = function(list, rna, selected) |
2903 |
06 Nov 14 |
nicklas |
197 |
{ |
2903 |
06 Nov 14 |
nicklas |
var name = rna.name; |
6726 |
04 May 22 |
nicklas |
if (rna.QiacubeDate) |
2903 |
06 Nov 14 |
nicklas |
200 |
{ |
6726 |
04 May 22 |
nicklas |
name += ' -- ' + Reggie.reformatDate(rna.QiacubeDate); |
6726 |
04 May 22 |
nicklas |
if (rna.QiacubeRunNo) name += '; Run ' + rna.QiacubeRunNo; |
6726 |
04 May 22 |
nicklas |
if (rna.QiacubePosition) name += '; Pos ' + rna.QiacubePosition; |
2903 |
06 Nov 14 |
nicklas |
204 |
} |
2903 |
06 Nov 14 |
nicklas |
205 |
|
2903 |
06 Nov 14 |
nicklas |
var option = new Option(name, rna.id, selected, selected); |
3741 |
12 Feb 16 |
nicklas |
if (rna.specimen && rna.specimen.YellowLabel != null) option.className = 'yellow'; |
2903 |
06 Nov 14 |
nicklas |
option.rna = rna; |
2903 |
06 Nov 14 |
nicklas |
list[list.length] = option; |
2903 |
06 Nov 14 |
nicklas |
210 |
} |
2903 |
06 Nov 14 |
nicklas |
211 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.validateStep1 = function(event) |
2903 |
06 Nov 14 |
nicklas |
213 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
var rnaList = frm.rna; |
2903 |
06 Nov 14 |
nicklas |
216 |
|
2903 |
06 Nov 14 |
nicklas |
selectedRna = []; |
2903 |
06 Nov 14 |
nicklas |
for (var i=0; i < rnaList.length; i++) |
2903 |
06 Nov 14 |
nicklas |
219 |
{ |
2903 |
06 Nov 14 |
nicklas |
if (rnaList[i].selected) |
2903 |
06 Nov 14 |
nicklas |
221 |
{ |
2903 |
06 Nov 14 |
nicklas |
selectedRna[selectedRna.length] = rnaList[i].rna; |
2903 |
06 Nov 14 |
nicklas |
223 |
} |
2903 |
06 Nov 14 |
nicklas |
224 |
} |
2903 |
06 Nov 14 |
nicklas |
225 |
|
2903 |
06 Nov 14 |
nicklas |
if (selectedRna.length == 0) |
2903 |
06 Nov 14 |
nicklas |
227 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.setInputStatus('rna', 'invalid', 'Not selected', 'invalid'); |
2903 |
06 Nov 14 |
nicklas |
event.preventDefault(); |
2903 |
06 Nov 14 |
nicklas |
230 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
232 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.setInputStatus('rna', 'valid'); |
2903 |
06 Nov 14 |
nicklas |
234 |
} |
2903 |
06 Nov 14 |
nicklas |
235 |
} |
2903 |
06 Nov 14 |
nicklas |
236 |
|
2903 |
06 Nov 14 |
nicklas |
237 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.initializeStep2 = function() |
2903 |
06 Nov 14 |
nicklas |
239 |
{ |
3269 |
23 Apr 15 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
// Check if all RNA from same Qiacube run |
2903 |
06 Nov 14 |
nicklas |
var qiacubeRun = selectedRna[0].QiacubeDate + '#' + selectedRna[0].QiacubeRunNo; |
2903 |
06 Nov 14 |
nicklas |
var sameQiacubeRun = true; |
6726 |
04 May 22 |
nicklas |
var showLabelColumn = false; |
6726 |
04 May 22 |
nicklas |
for (var i=0; i < selectedRna.length; i++) |
2903 |
06 Nov 14 |
nicklas |
246 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = selectedRna[i]; |
2903 |
06 Nov 14 |
nicklas |
if (qiacubeRun != rna.QiacubeDate+'#'+rna.QiacubeRunNo) |
2903 |
06 Nov 14 |
nicklas |
249 |
{ |
2903 |
06 Nov 14 |
nicklas |
sameQiacubeRun = false; |
2903 |
06 Nov 14 |
nicklas |
251 |
} |
6726 |
04 May 22 |
nicklas |
if (rna.label) showLabelColumn = true; |
2903 |
06 Nov 14 |
nicklas |
253 |
} |
2903 |
06 Nov 14 |
nicklas |
254 |
|
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
256 |
{ |
2903 |
06 Nov 14 |
nicklas |
selectedRna.sort(normalize.sortByQiacubePosition); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('qiacube-info'); |
2903 |
06 Nov 14 |
nicklas |
Doc.element('qiacube-date').innerHTML = Reggie.reformatDate(selectedRna[0].QiacubeDate); |
2903 |
06 Nov 14 |
nicklas |
Doc.element('qiacube-run').innerHTML = selectedRna[0].QiacubeRunNo; |
2903 |
06 Nov 14 |
nicklas |
261 |
} |
2903 |
06 Nov 14 |
nicklas |
else |
2903 |
06 Nov 14 |
nicklas |
263 |
{ |
2903 |
06 Nov 14 |
nicklas |
selectedRna.sort(normalize.sortByStorageLocation); |
2903 |
06 Nov 14 |
nicklas |
265 |
} |
2903 |
06 Nov 14 |
nicklas |
266 |
|
5360 |
12 Apr 19 |
nicklas |
var html = '<table id="extractTable">'; |
3026 |
11 Dec 14 |
nicklas |
html += '<thead class="bg-filled-100">'; |
2903 |
06 Nov 14 |
nicklas |
// First header row |
2903 |
06 Nov 14 |
nicklas |
html += '<tr>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>RNA</th>'; |
6726 |
04 May 22 |
nicklas |
if (showLabelColumn) |
6726 |
04 May 22 |
nicklas |
273 |
{ |
6726 |
04 May 22 |
nicklas |
html += '<th>Label¹</th>'; |
6726 |
04 May 22 |
nicklas |
275 |
} |
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
277 |
{ |
2903 |
06 Nov 14 |
nicklas |
html += '<th>Qiacube</th>'; |
2903 |
06 Nov 14 |
nicklas |
279 |
} |
3524 |
02 Oct 15 |
nicklas |
html += '<th>Storage</th>'; |
6219 |
20 Apr 21 |
nicklas |
html += '<th>Conc.</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>Remain</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th colspan="2">Volumes</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th></th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</tr>'; |
2903 |
06 Nov 14 |
nicklas |
// Second header row |
2903 |
06 Nov 14 |
nicklas |
html += '<tr>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th></th>'; |
6726 |
04 May 22 |
nicklas |
if (showLabelColumn) |
6726 |
04 May 22 |
nicklas |
290 |
{ |
6726 |
04 May 22 |
nicklas |
html += '<th></th>'; |
6726 |
04 May 22 |
nicklas |
292 |
} |
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
294 |
{ |
2903 |
06 Nov 14 |
nicklas |
html += '<th>position</th>'; |
2903 |
06 Nov 14 |
nicklas |
296 |
} |
3524 |
02 Oct 15 |
nicklas |
html += '<th>box</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>(ng/µl)</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>(µg)</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>(µl)</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>H<sub>2</sub>O</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<th>Remarks</th>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</tr>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</thead>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<tbody>'; |
2903 |
06 Nov 14 |
nicklas |
306 |
|
2903 |
06 Nov 14 |
nicklas |
var expectedQiacubePosition = 0; |
3741 |
12 Feb 16 |
nicklas |
var homeUrl = Data.get('page-data', 'home-url'); |
3741 |
12 Feb 16 |
nicklas |
var yellowImg = '<img src="'+homeUrl+'/images/yellow-label.png">'; |
2903 |
06 Nov 14 |
nicklas |
for (var i=0; i < selectedRna.length; i++) |
2903 |
06 Nov 14 |
nicklas |
311 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = selectedRna[i]; |
3741 |
12 Feb 16 |
nicklas |
var isYellow = rna.specimen && rna.specimen.YellowLabel != null; |
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
315 |
{ |
2903 |
06 Nov 14 |
nicklas |
expectedQiacubePosition++; |
2903 |
06 Nov 14 |
nicklas |
while (expectedQiacubePosition != rna.QiacubePosition && expectedQiacubePosition <= 12) |
2903 |
06 Nov 14 |
nicklas |
318 |
{ |
6726 |
04 May 22 |
nicklas |
html += normalize.insertEmpty(expectedQiacubePosition, showLabelColumn); |
2903 |
06 Nov 14 |
nicklas |
expectedQiacubePosition++; |
2903 |
06 Nov 14 |
nicklas |
321 |
} |
2903 |
06 Nov 14 |
nicklas |
322 |
} |
3741 |
12 Feb 16 |
nicklas |
323 |
|
3741 |
12 Feb 16 |
nicklas |
var img = isYellow ? yellowImg : ''; |
3741 |
12 Feb 16 |
nicklas |
html += '<tr class="highlight'+(isYellow ? ' yellow-specimen' : '')+'">'; |
5360 |
12 Apr 19 |
nicklas |
html += '<td class="extract if-yellow">'+img+Strings.encodeTags(rna.nextAliquotName)+'</td>'; |
6726 |
04 May 22 |
nicklas |
if (showLabelColumn) |
6726 |
04 May 22 |
nicklas |
328 |
{ |
6726 |
04 May 22 |
nicklas |
html += '<td class="label if-yellow">'+Strings.encodeTags(rna.label)+'</td>'; |
6726 |
04 May 22 |
nicklas |
330 |
} |
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
332 |
{ |
2903 |
06 Nov 14 |
nicklas |
html += '<td class="qiacubepos">'+rna.QiacubePosition+'</td>'; |
2903 |
06 Nov 14 |
nicklas |
334 |
} |
6219 |
20 Apr 21 |
nicklas |
html += '<td class="box">'+(rna.bioWell ? Strings.encodeTags(rna.bioWell.bioPlate.name + ' ' + rna.bioWell.location):'unknown')+'</td>'; |
6219 |
20 Apr 21 |
nicklas |
html += '<td class="conc">'+ Numbers.formatNumber(rna.conc, 1) + '</td>'; |
4569 |
05 Sep 17 |
nicklas |
html += '<td class="remain">'+ Numbers.formatNumber(rna.remainingQuantity, 2) + '</td>'; |
3269 |
23 Apr 15 |
nicklas |
html += '<td class="volume" id="rnaVolume.'+rna.id+'"></td>'; |
3269 |
23 Apr 15 |
nicklas |
html += '<td class="water" id="rnaWater.'+rna.id+'"></td>'; |
3269 |
23 Apr 15 |
nicklas |
html += '<td class="remarks" id="remarks.'+rna.id+'"></td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</tr>' |
2903 |
06 Nov 14 |
nicklas |
342 |
} |
2903 |
06 Nov 14 |
nicklas |
if (sameQiacubeRun) |
2903 |
06 Nov 14 |
nicklas |
344 |
{ |
2903 |
06 Nov 14 |
nicklas |
expectedQiacubePosition++; |
2903 |
06 Nov 14 |
nicklas |
while (expectedQiacubePosition <= 12) |
2903 |
06 Nov 14 |
nicklas |
347 |
{ |
6726 |
04 May 22 |
nicklas |
html += normalize.insertEmpty(expectedQiacubePosition, showLabelColumn); |
2903 |
06 Nov 14 |
nicklas |
expectedQiacubePosition++; |
2903 |
06 Nov 14 |
nicklas |
350 |
} |
2903 |
06 Nov 14 |
nicklas |
351 |
} |
2903 |
06 Nov 14 |
nicklas |
html += '</tbody>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</table>'; |
6726 |
04 May 22 |
nicklas |
if (showLabelColumn) |
6726 |
04 May 22 |
nicklas |
355 |
{ |
6726 |
04 May 22 |
nicklas |
html += '<div id="protocol-footer">'; |
6726 |
04 May 22 |
nicklas |
html += '¹ Some SCAN-B tubes have a non-standard label.'; |
6726 |
04 May 22 |
nicklas |
html += '</div>'; |
6726 |
04 May 22 |
nicklas |
359 |
} |
6726 |
04 May 22 |
nicklas |
360 |
|
2903 |
06 Nov 14 |
nicklas |
Doc.element('rnaNormalize').innerHTML = html; |
3269 |
23 Apr 15 |
nicklas |
362 |
|
2903 |
06 Nov 14 |
nicklas |
Wizard.setCurrentStep(2); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('gonext'); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('goprint'); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('gocancel'); |
2903 |
06 Nov 14 |
nicklas |
Wizard.keepSessionAlive(); |
3831 |
06 Apr 16 |
nicklas |
Reggie.loadProtocols('RNA_NORMALIZATION_PROTOCOL', 'normalizationProtocol', 'RNA_TARGET_AMOUNT,RNA_MINIMAL_AMOUNT,RNA_TARGET_VOLUME'); |
3269 |
23 Apr 15 |
nicklas |
frm.normalizationProtocol.focus(); |
2903 |
06 Nov 14 |
nicklas |
370 |
} |
2903 |
06 Nov 14 |
nicklas |
371 |
|
3269 |
23 Apr 15 |
nicklas |
normalize.protocolOnChange = function() |
3269 |
23 Apr 15 |
nicklas |
373 |
{ |
3269 |
23 Apr 15 |
nicklas |
var frm = document.forms['reggie']; |
3269 |
23 Apr 15 |
nicklas |
375 |
|
3269 |
23 Apr 15 |
nicklas |
if (!hasInitProtocols) |
3269 |
23 Apr 15 |
nicklas |
377 |
{ |
3269 |
23 Apr 15 |
nicklas |
hasInitProtocols = true; |
3269 |
23 Apr 15 |
nicklas |
if (frm.normalizationProtocol.length == 0) |
3269 |
23 Apr 15 |
nicklas |
380 |
{ |
3269 |
23 Apr 15 |
nicklas |
Wizard.setFatalError('No RNA normalization protocols found. Please ask the server administrator to create at least one protocol.'); |
3269 |
23 Apr 15 |
nicklas |
return; |
3269 |
23 Apr 15 |
nicklas |
383 |
} |
3269 |
23 Apr 15 |
nicklas |
for (var i=0; i < frm.normalizationProtocol.length; i++) |
3269 |
23 Apr 15 |
nicklas |
385 |
{ |
3269 |
23 Apr 15 |
nicklas |
var p = frm.normalizationProtocol[i].item; |
3831 |
06 Apr 16 |
nicklas |
387 |
|
3831 |
06 Apr 16 |
nicklas |
var unit = 'µg'; |
3831 |
06 Apr 16 |
nicklas |
var factor = 1; |
5360 |
12 Apr 19 |
nicklas |
if (p.RNATargetAmount <= 0.5) |
3831 |
06 Apr 16 |
nicklas |
391 |
{ |
3831 |
06 Apr 16 |
nicklas |
unit = 'ng'; |
3831 |
06 Apr 16 |
nicklas |
factor = 1000; |
3831 |
06 Apr 16 |
nicklas |
394 |
} |
3831 |
06 Apr 16 |
nicklas |
395 |
|
3831 |
06 Apr 16 |
nicklas |
var text = p.name + ' ('; |
3831 |
06 Apr 16 |
nicklas |
if (p.RNAMinimalAmount) text += Reggie.formatNumber(p.RNAMinimalAmount * factor, '', 1) + '-'; |
3831 |
06 Apr 16 |
nicklas |
text += p.RNATargetAmount ? Reggie.formatNumber(p.RNATargetAmount * factor, '', 1) : '? '; |
3831 |
06 Apr 16 |
nicklas |
text += unit; |
3831 |
06 Apr 16 |
nicklas |
text += ' in '+(p.RNATargetVolume || '? ')+'µl)'; |
3831 |
06 Apr 16 |
nicklas |
frm.normalizationProtocol[i].text = text; |
3269 |
23 Apr 15 |
nicklas |
402 |
} |
3269 |
23 Apr 15 |
nicklas |
403 |
} |
3269 |
23 Apr 15 |
nicklas |
404 |
|
5360 |
12 Apr 19 |
nicklas |
Wizard.showGoNextConfirmation(true, 'Print the lab protocol before continuing with the registration!'); |
3269 |
23 Apr 15 |
nicklas |
var protocol = frm.normalizationProtocol[frm.normalizationProtocol.selectedIndex].item; |
3269 |
23 Apr 15 |
nicklas |
if (!protocol || !protocol.RNATargetAmount || !protocol.RNATargetVolume) |
3269 |
23 Apr 15 |
nicklas |
408 |
{ |
3269 |
23 Apr 15 |
nicklas |
protocol = {}; |
3269 |
23 Apr 15 |
nicklas |
if (!protocol.RNATargetAmount) protocol.RNATargetAmount = 1.1; |
3269 |
23 Apr 15 |
nicklas |
if (!protocol.RNATargetVolume) protocol.RNATargetVolume = 50; |
3269 |
23 Apr 15 |
nicklas |
412 |
|
3269 |
23 Apr 15 |
nicklas |
var msg = 'Missing normalization data; assuming '; |
3269 |
23 Apr 15 |
nicklas |
msg += protocol.RNATargetAmount+ 'µg in '+protocol.RNATargetVolume+'µl.'; |
3269 |
23 Apr 15 |
nicklas |
Wizard.setInputStatus('normalizationProtocol', 'warning', msg); |
3269 |
23 Apr 15 |
nicklas |
416 |
} |
3269 |
23 Apr 15 |
nicklas |
else |
3269 |
23 Apr 15 |
nicklas |
418 |
{ |
3269 |
23 Apr 15 |
nicklas |
Wizard.setInputStatus('normalizationProtocol', 'valid'); |
3269 |
23 Apr 15 |
nicklas |
420 |
} |
3831 |
06 Apr 16 |
nicklas |
if (!protocol.RNAMinimalAmount) protocol.RNAMinimalAmount = protocol.RNATargetAmount; |
3269 |
23 Apr 15 |
nicklas |
Doc.element('normalization-protocol').innerHTML = Strings.encodeTags(frm.normalizationProtocol[frm.normalizationProtocol.selectedIndex].text); |
3269 |
23 Apr 15 |
nicklas |
423 |
|
3269 |
23 Apr 15 |
nicklas |
// The concentration of the normalized RNA |
3269 |
23 Apr 15 |
nicklas |
var normalizedConc = protocol.RNATargetAmount / protocol.RNATargetVolume; // µg/µl |
3269 |
23 Apr 15 |
nicklas |
426 |
|
3269 |
23 Apr 15 |
nicklas |
for (var i=0; i < selectedRna.length; i++) |
3269 |
23 Apr 15 |
nicklas |
428 |
{ |
3269 |
23 Apr 15 |
nicklas |
var rna = selectedRna[i]; |
3269 |
23 Apr 15 |
nicklas |
430 |
|
4569 |
05 Sep 17 |
nicklas |
// Aim for RNATargetAmount but not more than remiaingQuantity or less than RNAMinimalAmount |
4569 |
05 Sep 17 |
nicklas |
rna.usedQuantity = Math.max(Math.min(rna.remainingQuantity, protocol.RNATargetAmount), protocol.RNAMinimalAmount); // µg |
6219 |
20 Apr 21 |
nicklas |
rna.volume = Math.ceil(10000*rna.usedQuantity/rna.conc) / 10; |
3269 |
23 Apr 15 |
nicklas |
rna.water = protocol.RNATargetVolume-rna.volume; // µl |
3269 |
23 Apr 15 |
nicklas |
435 |
|
3269 |
23 Apr 15 |
nicklas |
var remarks = []; |
3269 |
23 Apr 15 |
nicklas |
if (rna.volume < MINIMAL_RNA_VOLUME) |
3269 |
23 Apr 15 |
nicklas |
438 |
{ |
3269 |
23 Apr 15 |
nicklas |
// Large mix since we do not want to take less than 1µl |
3269 |
23 Apr 15 |
nicklas |
rna.volume = MINIMAL_RNA_VOLUME; |
6219 |
20 Apr 21 |
nicklas |
rna.usedQuantity = rna.volume * rna.conc / 1000; // µg |
3269 |
23 Apr 15 |
nicklas |
var totalVolume = rna.usedQuantity / normalizedConc; // µl |
3269 |
23 Apr 15 |
nicklas |
rna.water = totalVolume - rna.volume; |
3269 |
23 Apr 15 |
nicklas |
remarks[remarks.length] = 'Large mix'; |
3269 |
23 Apr 15 |
nicklas |
445 |
} |
3831 |
06 Apr 16 |
nicklas |
else if (rna.volume > protocol.RNATargetVolume) |
3831 |
06 Apr 16 |
nicklas |
447 |
{ |
3831 |
06 Apr 16 |
nicklas |
// The RNA has too low concentration so we can't reach the target amount |
3831 |
06 Apr 16 |
nicklas |
// with the target volume. The protocol may allow us to use a lesser amount |
3831 |
06 Apr 16 |
nicklas |
// so we try this |
3831 |
06 Apr 16 |
nicklas |
rna.volume = protocol.RNATargetVolume; |
3831 |
06 Apr 16 |
nicklas |
rna.water = 0; |
6219 |
20 Apr 21 |
nicklas |
rna.usedQuantity = rna.volume * rna.conc / 1000; |
3831 |
06 Apr 16 |
nicklas |
454 |
} |
3269 |
23 Apr 15 |
nicklas |
455 |
|
3831 |
06 Apr 16 |
nicklas |
rna.notEnoughQuantity = rna.remainingQuantity < rna.usedQuantity || rna.usedQuantity < protocol.RNAMinimalAmount; |
3831 |
06 Apr 16 |
nicklas |
if (rna.notEnoughQuantity) |
3831 |
06 Apr 16 |
nicklas |
458 |
{ |
3831 |
06 Apr 16 |
nicklas |
remarks[remarks.length] = '<span class="flag">Not enough quantity</span>'; |
3831 |
06 Apr 16 |
nicklas |
460 |
} |
3831 |
06 Apr 16 |
nicklas |
else if (rna.usedQuantity < protocol.RNATargetAmount) |
3831 |
06 Apr 16 |
nicklas |
462 |
{ |
3831 |
06 Apr 16 |
nicklas |
remarks[remarks.length] = Numbers.formatNumber(rna.usedQuantity * 1000, 0) + 'ng'; |
3831 |
06 Apr 16 |
nicklas |
464 |
} |
3269 |
23 Apr 15 |
nicklas |
465 |
|
3831 |
06 Apr 16 |
nicklas |
Doc.element('rnaVolume.'+rna.id).innerHTML = rna.notEnoughQuantity ? '' : Numbers.formatNumber(rna.volume, 1); |
3831 |
06 Apr 16 |
nicklas |
Doc.element('rnaWater.'+rna.id).innerHTML = rna.notEnoughQuantity ? '' : (rna.water > 0 ? Numbers.formatNumber(rna.water, 1) : '—'); |
3269 |
23 Apr 15 |
nicklas |
Doc.element('remarks.'+rna.id).innerHTML = remarks.join(', '); |
3269 |
23 Apr 15 |
nicklas |
469 |
} |
3269 |
23 Apr 15 |
nicklas |
470 |
} |
3269 |
23 Apr 15 |
nicklas |
471 |
|
6726 |
04 May 22 |
nicklas |
normalize.insertEmpty = function(qiacubePosition, showLabelColumn) |
2903 |
06 Nov 14 |
nicklas |
473 |
{ |
2903 |
06 Nov 14 |
nicklas |
var html = '<tr class="highlight empty">'; |
5360 |
12 Apr 19 |
nicklas |
html += '<td class="extract"></td>'; |
6726 |
04 May 22 |
nicklas |
if (showLabelColumn) html += '<td class="label"></td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<td class="qiacubepos">'+qiacubePosition+'</td>'; |
3559 |
22 Oct 15 |
nicklas |
html += '<td class="box"></td>'; |
6219 |
20 Apr 21 |
nicklas |
html += '<td class="conc"></td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<td class="remain"></td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<td class="volume"></td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '<td class="water"></td>'; |
3269 |
23 Apr 15 |
nicklas |
html += '<td class="remarks">Not selected for pre-normalization</td>'; |
2903 |
06 Nov 14 |
nicklas |
html += '</tr>' |
2903 |
06 Nov 14 |
nicklas |
return html; |
2903 |
06 Nov 14 |
nicklas |
486 |
} |
2903 |
06 Nov 14 |
nicklas |
487 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.printVersion = function() |
2903 |
06 Nov 14 |
nicklas |
489 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.hideGoNextConfirmation(); |
2903 |
06 Nov 14 |
nicklas |
Doc.removeClass('gonext', 'disabled'); |
2903 |
06 Nov 14 |
nicklas |
var reportName = 'RNA Normalization Protocol'; |
2903 |
06 Nov 14 |
nicklas |
var printNote = '<b>Note!</b> For better printing set page orientation to <i>portrait</i>.'; |
5360 |
12 Apr 19 |
nicklas |
Reggie.openPrintWindow('full-protocol', reportName, 'portrait', printNote, '../', 'normalize_extract.css'); |
2903 |
06 Nov 14 |
nicklas |
495 |
} |
2903 |
06 Nov 14 |
nicklas |
496 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.validateStep2 = function(event) |
2903 |
06 Nov 14 |
nicklas |
498 |
{} |
2903 |
06 Nov 14 |
nicklas |
499 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.initializeStep3 = function() |
2903 |
06 Nov 14 |
nicklas |
501 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
Wizard.setCurrentStep(3); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('goregister'); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('gocancel'); |
2903 |
06 Nov 14 |
nicklas |
Events.sendChangeEvent('normalizationDate'); |
2903 |
06 Nov 14 |
nicklas |
frm.normalizationDate.focus(); |
2903 |
06 Nov 14 |
nicklas |
508 |
} |
2903 |
06 Nov 14 |
nicklas |
509 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.submit = function() |
2903 |
06 Nov 14 |
nicklas |
511 |
{ |
2903 |
06 Nov 14 |
nicklas |
var frm = document.forms['reggie']; |
2903 |
06 Nov 14 |
nicklas |
513 |
|
2903 |
06 Nov 14 |
nicklas |
var submitInfo = {}; |
3269 |
23 Apr 15 |
nicklas |
submitInfo.normalizationProtocol = parseInt(frm.normalizationProtocol.value, 10); |
2903 |
06 Nov 14 |
nicklas |
submitInfo.normalizationDate = frm.normalizationDate.value; |
2903 |
06 Nov 14 |
nicklas |
submitInfo.normalizationOperator = frm.normalizationOperator.value; |
2903 |
06 Nov 14 |
nicklas |
518 |
|
2903 |
06 Nov 14 |
nicklas |
var rnaAliquots = []; |
2903 |
06 Nov 14 |
nicklas |
for (var i=0; i < selectedRna.length; i++) |
2903 |
06 Nov 14 |
nicklas |
521 |
{ |
2903 |
06 Nov 14 |
nicklas |
var rna = selectedRna[i]; |
3831 |
06 Apr 16 |
nicklas |
if (!rna.notEnoughQuantity) |
2903 |
06 Nov 14 |
nicklas |
524 |
{ |
2903 |
06 Nov 14 |
nicklas |
var normalizedRna = {}; |
2903 |
06 Nov 14 |
nicklas |
normalizedRna.parentId = rna.id; |
2903 |
06 Nov 14 |
nicklas |
normalizedRna.name = rna.nextAliquotName; |
2903 |
06 Nov 14 |
nicklas |
528 |
|
2903 |
06 Nov 14 |
nicklas |
normalizedRna.usedQuantity = rna.usedQuantity; // µg |
6219 |
20 Apr 21 |
nicklas |
normalizedRna.conc = 1000 * rna.usedQuantity / (rna.volume+rna.water); // ng/µl |
6219 |
20 Apr 21 |
nicklas |
normalizedRna.ConcType = rna.NDConc ? 'ND_CONC' : 'QUBIT_CONC'; |
2903 |
06 Nov 14 |
nicklas |
532 |
|
2903 |
06 Nov 14 |
nicklas |
rnaAliquots[rnaAliquots.length] = normalizedRna; |
2903 |
06 Nov 14 |
nicklas |
534 |
} |
3269 |
23 Apr 15 |
nicklas |
else |
3269 |
23 Apr 15 |
nicklas |
536 |
{ |
3269 |
23 Apr 15 |
nicklas |
var flaggedRna = {}; |
3269 |
23 Apr 15 |
nicklas |
flaggedRna.id = rna.id; |
3269 |
23 Apr 15 |
nicklas |
flaggedRna.flag = 'NotEnoughRemainingQuantity'; |
3269 |
23 Apr 15 |
nicklas |
rnaAliquots[rnaAliquots.length] = flaggedRna; |
3269 |
23 Apr 15 |
nicklas |
541 |
} |
2903 |
06 Nov 14 |
nicklas |
542 |
} |
3269 |
23 Apr 15 |
nicklas |
543 |
|
2903 |
06 Nov 14 |
nicklas |
submitInfo.rnaAliquots = rnaAliquots; |
2903 |
06 Nov 14 |
nicklas |
545 |
|
2903 |
06 Nov 14 |
nicklas |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
2903 |
06 Nov 14 |
nicklas |
url += '&cmd=RegisterNormalizedRNA'; |
2903 |
06 Nov 14 |
nicklas |
Wizard.showLoadingAnimation('Performing registration...'); |
2903 |
06 Nov 14 |
nicklas |
Wizard.asyncJsonRequest(url, normalize.submissionResults, 'POST', JSON.stringify(submitInfo)); |
2903 |
06 Nov 14 |
nicklas |
550 |
} |
2903 |
06 Nov 14 |
nicklas |
551 |
|
2903 |
06 Nov 14 |
nicklas |
normalize.submissionResults = function(response) |
2903 |
06 Nov 14 |
nicklas |
553 |
{ |
2903 |
06 Nov 14 |
nicklas |
Wizard.showFinalMessage(response.messages); |
2903 |
06 Nov 14 |
nicklas |
Doc.show('gorestart'); |
2903 |
06 Nov 14 |
nicklas |
556 |
} |
2903 |
06 Nov 14 |
nicklas |
557 |
|
2903 |
06 Nov 14 |
nicklas |
return normalize; |
2903 |
06 Nov 14 |
nicklas |
559 |
}(); |
2903 |
06 Nov 14 |
nicklas |
560 |
|
2903 |
06 Nov 14 |
nicklas |
Doc.onLoad(RnaNormalize.initPage); |
2903 |
06 Nov 14 |
nicklas |
562 |
|