3176 |
06 Mar 15 |
olle |
var ExtractionReg = function() |
3176 |
06 Mar 15 |
olle |
2 |
{ |
3176 |
06 Mar 15 |
olle |
var exreg = {}; |
3240 |
10 Apr 15 |
olle |
var debug = 0; |
3176 |
06 Mar 15 |
olle |
5 |
|
3176 |
06 Mar 15 |
olle |
exreg.REAGENTS = [ |
3176 |
06 Mar 15 |
olle |
'xyleneSpecimen', 'etoh995Specimen', 'bufferPkdSpecimen', 'bufferAtlSpecimen', |
3176 |
06 Mar 15 |
olle |
'proteinaseKSpecimen', 'rnaseASpecimen', 'allPrepFfpeKit', 'etoh995', |
3176 |
06 Mar 15 |
olle |
'bufferRlt', 'bufferFrn', 'bufferRpe', 'bufferAl', |
3176 |
06 Mar 15 |
olle |
'bufferAw1', 'bufferAw2', 'bufferAte', 'bufferRdd', |
3324 |
11 May 15 |
olle |
'rnaseFreeWater', 'dnaseMix', 'rneasyMinEluteSpinColumn', 'qiaampMinEluteSpinColumn', |
3438 |
03 Jul 15 |
olle |
'kapaSybrFast', 'qualityControlPrimersQcpRgt', 'qualityControlTemplateQct', 'qubitDnaHighSens', 'qubitDnaBroadRange' |
3176 |
06 Mar 15 |
olle |
13 |
]; |
3176 |
06 Mar 15 |
olle |
14 |
|
3176 |
06 Mar 15 |
olle |
var MINIMAL_PRE_NORMALIZE_QUANTITY = 1.1; // µg |
3283 |
29 Apr 15 |
olle |
var QUBIT_DILUTION_FACTOR_DEFAULT = 200.0; |
3176 |
06 Mar 15 |
olle |
var protocolMap = {}; |
3176 |
06 Mar 15 |
olle |
18 |
|
3180 |
17 Mar 15 |
olle |
var extraItemsList = []; |
3352 |
26 May 15 |
olle |
var qiacubeSortedPrefixes = 'BCADEFGHIJKLMNOPQRSTUVWXYZ'; |
3180 |
17 Mar 15 |
olle |
var qiacubeDateIsAfterIsolationDate = true; |
3176 |
06 Mar 15 |
olle |
var qiacubeRunNoIsValid = false; |
3176 |
06 Mar 15 |
olle |
var qiacubePositionsAreValid = false; |
3176 |
06 Mar 15 |
olle |
var reagentFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
var nanoDropFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
var qubitFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
var qPcrFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
var counterBalanceInfoRow = false; |
3336 |
13 May 15 |
olle |
var trackingProtocolPreview = true; |
3176 |
06 Mar 15 |
olle |
var createdRna = []; |
4249 |
23 Nov 16 |
olle |
var rnaVolumeMicroLitersDefault = null; |
4249 |
23 Nov 16 |
olle |
var dnaVolumeMicroLitersDefault = null; |
3176 |
06 Mar 15 |
olle |
33 |
|
3176 |
06 Mar 15 |
olle |
// Page initialization |
3176 |
06 Mar 15 |
olle |
exreg.initPage = function() |
3176 |
06 Mar 15 |
olle |
36 |
{ |
3176 |
06 Mar 15 |
olle |
// Step 1 |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('step-1', 'wizard-validate', exreg.validateStep1); |
3180 |
17 Mar 15 |
olle |
//Events.addEventHandler('extractSourceItems', 'change', exreg.sourceItemsOnChange); |
3176 |
06 Mar 15 |
olle |
40 |
|
3176 |
06 Mar 15 |
olle |
// Step 2 |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('step-2', 'wizard-initialize', exreg.initializeStep2); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('step-2', 'wizard-validate', exreg.validateStep2); |
3176 |
06 Mar 15 |
olle |
44 |
|
3180 |
17 Mar 15 |
olle |
Events.addEventHandler('isolationDate', 'change', Wizard.validateDate); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('qiacubeDate', 'change', Wizard.validateDate); |
3180 |
17 Mar 15 |
olle |
Events.addEventHandler('isolationDate', 'change', exreg.qiacubeDateOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('qiacubeDate', 'change', exreg.qiacubeDateOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('qiacubeRunNo', 'change', exreg.qiacubeRunNoOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('reagentFile', 'change', exreg.reagentFileOnChange); |
3176 |
06 Mar 15 |
olle |
51 |
|
3332 |
12 May 15 |
olle |
Buttons.addClickHandler('downloadReagentLotNoFile', exreg.downloadReagentLotNoFile); |
3332 |
12 May 15 |
olle |
53 |
|
3176 |
06 Mar 15 |
olle |
// Step 3 |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('step-3', 'wizard-initialize', exreg.initializeStep3); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('step-3', 'wizard-validate', exreg.validateStep3); |
3176 |
06 Mar 15 |
olle |
57 |
|
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('nanoDropFile', 'change', exreg.nanoDropFileOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('qubitFile', 'change', exreg.qubitFileOnChange); |
3283 |
29 Apr 15 |
olle |
Events.addEventHandler('qubitFileDilutionFactor', 'change', exreg.qubitFileDilutionFactorOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('qPcrFile', 'change', exreg.qPcrFileOnChange); |
3176 |
06 Mar 15 |
olle |
62 |
|
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('btnFakeNanoDropFile', exreg.generateFakeNanoDropFile); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('btnFakeDnaInput', exreg.generateFakeDnaInput); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('btnFakeQPcrFile', exreg.generateFakeQPcrFile); |
3176 |
06 Mar 15 |
olle |
66 |
|
3176 |
06 Mar 15 |
olle |
// Navigation |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('gonext', Wizard.goNextOnClick); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('goregister', Wizard.goRegister); |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler('gocreate', exreg.createProtocol); |
3176 |
06 Mar 15 |
olle |
73 |
|
3176 |
06 Mar 15 |
olle |
// Final registration |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('wizard', 'wizard-submit', exreg.submit); |
3176 |
06 Mar 15 |
olle |
76 |
|
4249 |
23 Nov 16 |
olle |
// Load configuration |
4249 |
23 Nov 16 |
olle |
exreg.loadConfiguration(); |
4249 |
23 Nov 16 |
olle |
79 |
} |
4249 |
23 Nov 16 |
olle |
80 |
|
4249 |
23 Nov 16 |
olle |
exreg.loadConfiguration = function() |
4249 |
23 Nov 16 |
olle |
82 |
{ |
4249 |
23 Nov 16 |
olle |
var url = '../Session.servlet?ID='+App.getSessionId(); |
4249 |
23 Nov 16 |
olle |
url += '&cmd=GetConfiguration' |
4249 |
23 Nov 16 |
olle |
var request = Ajax.getXmlHttpRequest(); |
4249 |
23 Nov 16 |
olle |
request.open("GET", url, true); |
4249 |
23 Nov 16 |
olle |
Ajax.setReadyStateHandler(request, exreg.onConfiguration, exreg.onConfiguration); |
4249 |
23 Nov 16 |
olle |
request.send(null); |
4249 |
23 Nov 16 |
olle |
89 |
} |
4249 |
23 Nov 16 |
olle |
90 |
|
4249 |
23 Nov 16 |
olle |
exreg.onConfiguration = function(request) |
4249 |
23 Nov 16 |
olle |
92 |
{ |
4249 |
23 Nov 16 |
olle |
var frm = document.forms['meludi']; |
4249 |
23 Nov 16 |
olle |
94 |
|
4249 |
23 Nov 16 |
olle |
if (debug) |
4249 |
23 Nov 16 |
olle |
96 |
{ |
4249 |
23 Nov 16 |
olle |
App.debug(Strings.encodeTags(request.responseText)); |
4249 |
23 Nov 16 |
olle |
98 |
} |
4249 |
23 Nov 16 |
olle |
99 |
|
4249 |
23 Nov 16 |
olle |
var response; |
4249 |
23 Nov 16 |
olle |
var error = false; |
4249 |
23 Nov 16 |
olle |
try |
4249 |
23 Nov 16 |
olle |
103 |
{ |
4249 |
23 Nov 16 |
olle |
response = JSON.parse(request.responseText); |
4249 |
23 Nov 16 |
olle |
if (response.status != 'ok') |
4249 |
23 Nov 16 |
olle |
106 |
{ |
4249 |
23 Nov 16 |
olle |
error = response.message || response.stacktrace || 'Unexpected error'; |
4249 |
23 Nov 16 |
olle |
108 |
} |
4249 |
23 Nov 16 |
olle |
109 |
} |
4249 |
23 Nov 16 |
olle |
catch (ex) |
4249 |
23 Nov 16 |
olle |
111 |
{ |
4249 |
23 Nov 16 |
olle |
error = ex; |
4249 |
23 Nov 16 |
olle |
113 |
} |
4249 |
23 Nov 16 |
olle |
if (error) App.debug(error); |
4249 |
23 Nov 16 |
olle |
115 |
|
4249 |
23 Nov 16 |
olle |
// Get configuration result |
4249 |
23 Nov 16 |
olle |
var conf = response.configuration; |
4249 |
23 Nov 16 |
olle |
118 |
|
4249 |
23 Nov 16 |
olle |
// Check for RNA volume (µl) default |
4249 |
23 Nov 16 |
olle |
rnaVolumeMicroLitersDefault = conf.deparaffinizationRnaVolumeMicroLitersDefault; |
4249 |
23 Nov 16 |
olle |
121 |
|
4249 |
23 Nov 16 |
olle |
// Check for DNA volume (µl) default |
4249 |
23 Nov 16 |
olle |
dnaVolumeMicroLitersDefault = conf.deparaffinizationDnaVolumeMicroLitersDefault; |
4249 |
23 Nov 16 |
olle |
124 |
|
4249 |
23 Nov 16 |
olle |
// Continue with initializing info for extraction registration |
3176 |
06 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3432 |
29 Jun 15 |
olle |
url += '&cmd=GetUnprocessedStartItemLists'; |
3176 |
06 Mar 15 |
olle |
Wizard.showLoadingAnimation('Loading unprocessed items...'); |
3176 |
06 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.initializeStep1); |
3176 |
06 Mar 15 |
olle |
130 |
} |
3176 |
06 Mar 15 |
olle |
131 |
|
3176 |
06 Mar 15 |
olle |
exreg.initializeStep1 = function(response) |
3176 |
06 Mar 15 |
olle |
133 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3432 |
29 Jun 15 |
olle |
var itemLists = response.itemLists; |
3180 |
17 Mar 15 |
olle |
136 |
|
3432 |
29 Jun 15 |
olle |
var startList = frm.startList; |
3432 |
29 Jun 15 |
olle |
if (itemLists.length > 0) |
3180 |
17 Mar 15 |
olle |
139 |
{ |
3432 |
29 Jun 15 |
olle |
for (var i=0; i < itemLists.length; i++) |
3180 |
17 Mar 15 |
olle |
141 |
{ |
3432 |
29 Jun 15 |
olle |
var itemList = itemLists[i]; |
3432 |
29 Jun 15 |
olle |
var name = (i+1) + ': ' + Strings.encodeTags(itemList.name); |
3432 |
29 Jun 15 |
olle |
if (itemList.sourceItemNames) |
3180 |
17 Mar 15 |
olle |
145 |
{ |
3204 |
20 Mar 15 |
olle |
name += ' -- ('; |
3432 |
29 Jun 15 |
olle |
name += itemList.numMeludiItems; |
3432 |
29 Jun 15 |
olle |
name += ' + ' + itemList.numExtraItems; |
3204 |
20 Mar 15 |
olle |
name += ')'; |
3180 |
17 Mar 15 |
olle |
150 |
} |
3432 |
29 Jun 15 |
olle |
var selected = i == (itemLists.length - 1); |
3432 |
29 Jun 15 |
olle |
var option = new Option(name, itemList.id, selected, selected); |
3432 |
29 Jun 15 |
olle |
option.itemList = itemList; |
3432 |
29 Jun 15 |
olle |
startList.options[startList.length] = option; |
3180 |
17 Mar 15 |
olle |
155 |
} |
3180 |
17 Mar 15 |
olle |
//exreg.sourceItemsOnChange(); |
3180 |
17 Mar 15 |
olle |
157 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
159 |
{ |
3432 |
29 Jun 15 |
olle |
Wizard.setFatalError('No start lists available for processing.'); |
3180 |
17 Mar 15 |
olle |
return; |
3180 |
17 Mar 15 |
olle |
162 |
} |
3176 |
06 Mar 15 |
olle |
163 |
|
3176 |
06 Mar 15 |
olle |
Doc.show('step-1'); |
3176 |
06 Mar 15 |
olle |
Doc.show('gonext'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeNanoDropFile'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeDnaInput'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeQPcrFile'); |
3180 |
17 Mar 15 |
olle |
Doc.hide('extractSourceItems'); |
3176 |
06 Mar 15 |
olle |
170 |
} |
3176 |
06 Mar 15 |
olle |
171 |
|
3176 |
06 Mar 15 |
olle |
exreg.validateStep1 = function(event) |
3176 |
06 Mar 15 |
olle |
173 |
{ |
3180 |
17 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3432 |
29 Jun 15 |
olle |
var startItemList = null; |
3432 |
29 Jun 15 |
olle |
for (var i = 0; i < frm.startList.length; i++) |
3180 |
17 Mar 15 |
olle |
177 |
{ |
3432 |
29 Jun 15 |
olle |
if (frm.startList[i].selected) |
3180 |
17 Mar 15 |
olle |
179 |
{ |
3432 |
29 Jun 15 |
olle |
startItemList = frm.startList[i]; |
3180 |
17 Mar 15 |
olle |
181 |
} |
3180 |
17 Mar 15 |
olle |
182 |
} |
3432 |
29 Jun 15 |
olle |
if (startItemList == null) |
3180 |
17 Mar 15 |
olle |
184 |
{ |
3432 |
29 Jun 15 |
olle |
//alert("exreg.validateStep1(): startItemList == null"); |
3180 |
17 Mar 15 |
olle |
event.preventDefault(); |
3180 |
17 Mar 15 |
olle |
187 |
} |
3432 |
29 Jun 15 |
olle |
//alert("exreg.validateStep1(): startItemList.text = " + startItemList.text + " startItemList.value = " + startItemList.value); |
3180 |
17 Mar 15 |
olle |
189 |
|
3180 |
17 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3432 |
29 Jun 15 |
olle |
url += '&cmd=GetSourceItemListFromStartItemList'; |
3432 |
29 Jun 15 |
olle |
url += '&startItemListId='+startItemList.value; |
3276 |
29 Apr 15 |
olle |
url += '&includeSpecimenExtracts=true'; |
3180 |
17 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.sourceItemListLoaded); |
3176 |
06 Mar 15 |
olle |
195 |
} |
3176 |
06 Mar 15 |
olle |
196 |
|
3180 |
17 Mar 15 |
olle |
exreg.sourceItemListLoaded = function(response) |
3180 |
17 Mar 15 |
olle |
198 |
{ |
3180 |
17 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3180 |
17 Mar 15 |
olle |
200 |
|
3432 |
29 Jun 15 |
olle |
var startItemList = response.startitemlist; |
3180 |
17 Mar 15 |
olle |
var specimens = response.specimens; |
3180 |
17 Mar 15 |
olle |
var rnas = response.rnas; |
3180 |
17 Mar 15 |
olle |
var dnas = response.dnas; |
3212 |
27 Mar 15 |
olle |
var items = response.items; |
3245 |
14 Apr 15 |
olle |
extraItemsList = response.extraitems; |
3180 |
17 Mar 15 |
olle |
//alert("exreg.sourceItemListLoaded(): specimens.length = " + specimens.length + " rnas.length = " + rnas.length + " dnas.length = " + dnas.length); |
3180 |
17 Mar 15 |
olle |
208 |
|
3432 |
29 Jun 15 |
olle |
if (startItemList) |
3180 |
17 Mar 15 |
olle |
210 |
{ |
3432 |
29 Jun 15 |
olle |
frm.startListName.value = startItemList.name; |
3432 |
29 Jun 15 |
olle |
frm.startListId.value = startItemList.id; |
3432 |
29 Jun 15 |
olle |
213 |
|
3180 |
17 Mar 15 |
olle |
// Extraction parameters |
3432 |
29 Jun 15 |
olle |
frm.isolationDate.value = startItemList.isolationDate; |
3501 |
21 Sep 15 |
olle |
frm.extractionOperator.value = startItemList.extractionOperator; |
3432 |
29 Jun 15 |
olle |
frm.extractionProtocolId.value = startItemList.extractionProtocolId; |
3432 |
29 Jun 15 |
olle |
frm.extractionProtocolName.value = startItemList.extractionProtocolName; |
3432 |
29 Jun 15 |
olle |
//frm.rnaDefaultVolume.value = startItemList.rnaDefaultVolume; |
3432 |
29 Jun 15 |
olle |
//frm.dnaDefaultVolume.value = startItemList.dnaDefaultVolume; |
3180 |
17 Mar 15 |
olle |
// QIAcube parameters |
3432 |
29 Jun 15 |
olle |
frm.qiacubeDate.value = startItemList.qiacubeDate; |
3501 |
21 Sep 15 |
olle |
frm.qiacubeOperator.value = startItemList.qiacubeOperator; |
3432 |
29 Jun 15 |
olle |
frm.qiacubePrimaryPrefix.value = startItemList.qiacubePrimaryPrefix; |
3432 |
29 Jun 15 |
olle |
frm.qiacubeSecondaryPrefix.value = startItemList.qiacubeSecondaryPrefix; |
3432 |
29 Jun 15 |
olle |
frm.qiacubeRunNo.value = startItemList.qiacubeRunNo; |
3501 |
21 Sep 15 |
olle |
227 |
|
3501 |
21 Sep 15 |
olle |
// Specimen reagents |
3501 |
21 Sep 15 |
olle |
frm.xyleneSpecimen.value = startItemList.xyleneSpecimen; |
3501 |
21 Sep 15 |
olle |
frm.etoh995Specimen.value = startItemList.etoh995Specimen; |
3432 |
29 Jun 15 |
olle |
frm.allPrepFfpeKit.value = startItemList.allPrepFfpeKit; |
3501 |
21 Sep 15 |
olle |
frm.bufferPkdSpecimen.value = startItemList.bufferPkdSpecimen; |
3501 |
21 Sep 15 |
olle |
frm.bufferAtlSpecimen.value = startItemList.bufferAtlSpecimen; |
3501 |
21 Sep 15 |
olle |
frm.proteinaseKSpecimen.value = startItemList.proteinaseKSpecimen; |
3501 |
21 Sep 15 |
olle |
frm.rnaseASpecimen.value = startItemList.rnaseASpecimen; |
3180 |
17 Mar 15 |
olle |
236 |
|
3501 |
21 Sep 15 |
olle |
// QIAcube reagents |
3501 |
21 Sep 15 |
olle |
frm.etoh995.value = startItemList.etoh995; |
3501 |
21 Sep 15 |
olle |
frm.bufferRlt.value = startItemList.bufferRlt; |
3501 |
21 Sep 15 |
olle |
frm.bufferFrn.value = startItemList.bufferFrn; |
3501 |
21 Sep 15 |
olle |
frm.bufferRpe.value = startItemList.bufferRpe; |
3501 |
21 Sep 15 |
olle |
frm.bufferAl.value = startItemList.bufferAl; |
3501 |
21 Sep 15 |
olle |
frm.bufferAw1.value = startItemList.bufferAw1; |
3501 |
21 Sep 15 |
olle |
frm.bufferAw2.value = startItemList.bufferAw2; |
3501 |
21 Sep 15 |
olle |
frm.bufferAte.value = startItemList.bufferAte; |
3501 |
21 Sep 15 |
olle |
frm.bufferRdd.value = startItemList.bufferRdd; |
3501 |
21 Sep 15 |
olle |
frm.rnaseFreeWater.value = startItemList.rnaseFreeWater; |
3501 |
21 Sep 15 |
olle |
frm.dnaseMix.value = startItemList.dnaseMix; |
3501 |
21 Sep 15 |
olle |
frm.rneasyMinEluteSpinColumn.value = startItemList.rneasyMinEluteSpinColumn; |
3501 |
21 Sep 15 |
olle |
frm.qiaampMinEluteSpinColumn.value = startItemList.qiaampMinEluteSpinColumn; |
3501 |
21 Sep 15 |
olle |
251 |
|
3501 |
21 Sep 15 |
olle |
// Quality control reagents |
3501 |
21 Sep 15 |
olle |
frm.kapaSybrFast.value = startItemList.kapaSybrFast; |
3501 |
21 Sep 15 |
olle |
frm.qualityControlPrimersQcpRgt.value = startItemList.qualityControlPrimersQcpRgt; |
3501 |
21 Sep 15 |
olle |
frm.qualityControlTemplateQct.value = startItemList.qualityControlTemplateQct; |
3501 |
21 Sep 15 |
olle |
frm.qubitDnaHighSens.value = startItemList.qubitDnaHighSens; |
3501 |
21 Sep 15 |
olle |
frm.qubitDnaBroadRange.value = startItemList.qubitDnaBroadRange; |
3501 |
21 Sep 15 |
olle |
258 |
|
3432 |
29 Jun 15 |
olle |
frm.startListName.disabled = true; |
3180 |
17 Mar 15 |
olle |
frm.isolationDate.disabled = true; |
3501 |
21 Sep 15 |
olle |
frm.extractionOperator.disabled = true; |
3432 |
29 Jun 15 |
olle |
//frm.rnaDefaultVolume.disabled = true; |
3432 |
29 Jun 15 |
olle |
//frm.dnaDefaultVolume.disabled = true; |
3432 |
29 Jun 15 |
olle |
264 |
|
3180 |
17 Mar 15 |
olle |
// QIAcube parameters |
3501 |
21 Sep 15 |
olle |
//frm.qiacubeDate.disabled = true; |
3501 |
21 Sep 15 |
olle |
//frm.qiacubeOperator.disabled = true; |
3180 |
17 Mar 15 |
olle |
frm.qiacubePrimaryPrefix.disabled = true; |
3180 |
17 Mar 15 |
olle |
frm.qiacubeSecondaryPrefix.disabled = true; |
3501 |
21 Sep 15 |
olle |
//frm.qiacubeRunNo.disabled = true; |
3437 |
03 Jul 15 |
olle |
//frm.allPrepFfpeKit.disabled = true; |
3180 |
17 Mar 15 |
olle |
272 |
|
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.isolationDate = " + startList.isolationDate); |
3501 |
21 Sep 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.extractionOperator = " + startList.extractionOperator); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.ExtractionProtocolName = " + startList.ExtractionProtocolName); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.rnaDefaultVolume = " + startList.rnaDefaultVolume); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.dnaDefaultVolume = " + startList.dnaDefaultVolume); |
3432 |
29 Jun 15 |
olle |
278 |
|
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.qiacubeDate = " + startList.qiacubeDate); |
3501 |
21 Sep 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.qiacubeOperator = " + startList.qiacubeOperator); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.qiacubePrimaryPrefix = " + startList.qiacubePrimaryPrefix); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.qiacubeSecondaryPrefix = " + startList.qiacubeSecondaryPrefix); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.qiacubeRunNo = " + startList.qiacubeRunNo); |
3432 |
29 Jun 15 |
olle |
//alert("exreg.sourceItemListLoaded(): startList.allPrepFfpeKit = " + startList.allPrepFfpeKit); |
3180 |
17 Mar 15 |
olle |
285 |
} |
3180 |
17 Mar 15 |
olle |
//alert("exreg.sourceItemListLoaded(): Startplate parameters loaded"); |
3180 |
17 Mar 15 |
olle |
287 |
|
3180 |
17 Mar 15 |
olle |
var sourceItemList = frm.extractSourceItems; |
3212 |
27 Mar 15 |
olle |
if (items.length) |
3180 |
17 Mar 15 |
olle |
290 |
{ |
3212 |
27 Mar 15 |
olle |
var numItems = items.length; |
3212 |
27 Mar 15 |
olle |
for (var i=0; i < items.length; i++) |
3180 |
17 Mar 15 |
olle |
293 |
{ |
3212 |
27 Mar 15 |
olle |
var item = items[i]; |
3212 |
27 Mar 15 |
olle |
var name = (i+1) + ': ' + Strings.encodeTags(item.name); |
3212 |
27 Mar 15 |
olle |
if (item.bioWell) |
3180 |
17 Mar 15 |
olle |
297 |
{ |
3212 |
27 Mar 15 |
olle |
name += ' -- ' + Strings.encodeTags(item.bioWell.bioPlate.name + ' (' + item.bioWell.location + ')'); |
3180 |
17 Mar 15 |
olle |
299 |
} |
3212 |
27 Mar 15 |
olle |
var selected = i < 24; |
3212 |
27 Mar 15 |
olle |
// Identification of item via id works here as specimens and extracts |
3212 |
27 Mar 15 |
olle |
// are stored in the same database table using discriminators, and are |
3212 |
27 Mar 15 |
olle |
// therefore guaranteed to not have the same id value as another item in the table. |
3212 |
27 Mar 15 |
olle |
var option = new Option(name, item.id, selected, selected); |
3212 |
27 Mar 15 |
olle |
option.item = item; |
3212 |
27 Mar 15 |
olle |
sourceItemList.options[sourceItemList.length] = option; |
3180 |
17 Mar 15 |
olle |
307 |
} |
3180 |
17 Mar 15 |
olle |
308 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
310 |
{ |
3180 |
17 Mar 15 |
olle |
Wizard.setFatalError('No items available for processing.'); |
3180 |
17 Mar 15 |
olle |
return; |
3180 |
17 Mar 15 |
olle |
313 |
} |
3180 |
17 Mar 15 |
olle |
//alert("exreg.sourceItemListLoaded(): End"); |
3180 |
17 Mar 15 |
olle |
315 |
} |
3180 |
17 Mar 15 |
olle |
316 |
|
3176 |
06 Mar 15 |
olle |
exreg.initializeStep2 = function() |
3176 |
06 Mar 15 |
olle |
318 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3432 |
29 Jun 15 |
olle |
var startList = null; |
3432 |
29 Jun 15 |
olle |
for (var i = 0; i < frm.startList.length; i++) |
3180 |
17 Mar 15 |
olle |
322 |
{ |
3432 |
29 Jun 15 |
olle |
if (frm.startList[i].selected) |
3180 |
17 Mar 15 |
olle |
324 |
{ |
3432 |
29 Jun 15 |
olle |
startList = frm.startList[i]; |
3180 |
17 Mar 15 |
olle |
326 |
} |
3180 |
17 Mar 15 |
olle |
327 |
} |
3432 |
29 Jun 15 |
olle |
if (startList == null) |
3180 |
17 Mar 15 |
olle |
329 |
{ |
3432 |
29 Jun 15 |
olle |
//alert("exreg.validateStep1(): startList == null"); |
3180 |
17 Mar 15 |
olle |
event.preventDefault(); |
3180 |
17 Mar 15 |
olle |
332 |
} |
3180 |
17 Mar 15 |
olle |
333 |
|
3432 |
29 Jun 15 |
olle |
frm.startList.disabled = true; |
4249 |
23 Nov 16 |
olle |
frm.rnaDefaultVolume.value = rnaVolumeMicroLitersDefault; |
4249 |
23 Nov 16 |
olle |
frm.dnaDefaultVolume.value = dnaVolumeMicroLitersDefault; |
3183 |
18 Mar 15 |
olle |
337 |
|
3183 |
18 Mar 15 |
olle |
var clearButtons = Doc.element('commonInfoSection').getElementsByClassName('clear-reagents'); |
3183 |
18 Mar 15 |
olle |
if (clearButtons.length > 0) |
3183 |
18 Mar 15 |
olle |
340 |
{ |
3183 |
18 Mar 15 |
olle |
Buttons.addClickHandler(clearButtons[0], exreg.clearReagents); |
3183 |
18 Mar 15 |
olle |
342 |
} |
3183 |
18 Mar 15 |
olle |
var copyButtons = Doc.element('commonInfoSection').getElementsByClassName('copy-reagents-from-latest-extract'); |
3183 |
18 Mar 15 |
olle |
if (copyButtons.length > 0) |
3183 |
18 Mar 15 |
olle |
345 |
{ |
3183 |
18 Mar 15 |
olle |
Buttons.addClickHandler(copyButtons[0], exreg.copyReagentsFromLatestExtract); |
3183 |
18 Mar 15 |
olle |
347 |
} |
3183 |
18 Mar 15 |
olle |
348 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setCurrentStep(2); |
3176 |
06 Mar 15 |
olle |
Doc.show('gocancel'); |
3176 |
06 Mar 15 |
olle |
Doc.show('gonext'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeNanoDropFile'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeDnaInput'); |
3176 |
06 Mar 15 |
olle |
Doc.hide('btnFakeQPcrFile'); |
3432 |
29 Jun 15 |
olle |
Doc.hide('startListId'); |
3180 |
17 Mar 15 |
olle |
Doc.hide('extractionProtocolId'); |
3176 |
06 Mar 15 |
olle |
357 |
|
3180 |
17 Mar 15 |
olle |
358 |
/* |
3176 |
06 Mar 15 |
olle |
Meludi.loadProtocols('SAMPLE_HANDLING_PROTOCOL', 'extractionProtocol'); |
3176 |
06 Mar 15 |
olle |
Doc.addClass('extractionProtocol', 'list-loading'); |
3176 |
06 Mar 15 |
olle |
frm.extractionProtocol[0] = new Option('loading...', ''); |
3176 |
06 Mar 15 |
olle |
var url = '../Protocol.servlet?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
url += '&cmd=GetProtocols&subtype=EXTRACTION_PROTOCOL'; |
3176 |
06 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.protocolsLoaded); |
3180 |
17 Mar 15 |
olle |
365 |
*/ |
3176 |
06 Mar 15 |
olle |
366 |
|
3180 |
17 Mar 15 |
olle |
frm.isolationDate.focus(); |
3180 |
17 Mar 15 |
olle |
Events.sendChangeEvent('isolationDate'); |
3176 |
06 Mar 15 |
olle |
Events.sendChangeEvent('qiacubeDate'); |
3176 |
06 Mar 15 |
olle |
370 |
} |
3180 |
17 Mar 15 |
olle |
371 |
|
3180 |
17 Mar 15 |
olle |
372 |
/* |
3176 |
06 Mar 15 |
olle |
exreg.protocolsLoaded = function(response) |
3176 |
06 Mar 15 |
olle |
374 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var protocols = response.protocols; |
3176 |
06 Mar 15 |
olle |
377 |
|
3176 |
06 Mar 15 |
olle |
Doc.removeClass('extractionProtocol', 'list-loading'); |
3176 |
06 Mar 15 |
olle |
frm.extractionProtocol.length = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < protocols.length; i++) |
3176 |
06 Mar 15 |
olle |
381 |
{ |
3176 |
06 Mar 15 |
olle |
var name = protocols[i].name; |
3176 |
06 Mar 15 |
olle |
var id = protocols[i].id; |
3176 |
06 Mar 15 |
olle |
protocolMap[id] = name; |
3202 |
19 Mar 15 |
olle |
frm.extractionProtocol[frm.extractionProtocol.length] = new Option(name, id, false, true); |
3176 |
06 Mar 15 |
olle |
386 |
} |
3176 |
06 Mar 15 |
olle |
frm.extractionProtocol[frm.extractionProtocol.length] = new Option('- none -', ''); |
3176 |
06 Mar 15 |
olle |
388 |
|
3176 |
06 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
url += '&cmd=GetLastProcessedDna'; |
3176 |
06 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.lastProcessedDnaLoaded); |
3176 |
06 Mar 15 |
olle |
392 |
} |
3180 |
17 Mar 15 |
olle |
393 |
*/ |
3180 |
17 Mar 15 |
olle |
394 |
|
3183 |
18 Mar 15 |
olle |
exreg.clearReagents = function() |
3183 |
18 Mar 15 |
olle |
396 |
{ |
3183 |
18 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3183 |
18 Mar 15 |
olle |
398 |
|
3183 |
18 Mar 15 |
olle |
// Clear reagent values |
3183 |
18 Mar 15 |
olle |
400 |
|
3183 |
18 Mar 15 |
olle |
// Specimen reagents |
3183 |
18 Mar 15 |
olle |
frm.xyleneSpecimen.value = null; |
3183 |
18 Mar 15 |
olle |
frm.etoh995Specimen.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferPkdSpecimen.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferAtlSpecimen.value = null; |
3183 |
18 Mar 15 |
olle |
frm.proteinaseKSpecimen.value = null; |
3183 |
18 Mar 15 |
olle |
frm.rnaseASpecimen.value = null; |
3183 |
18 Mar 15 |
olle |
408 |
|
3183 |
18 Mar 15 |
olle |
// QIAcube reagents |
3183 |
18 Mar 15 |
olle |
frm.etoh995.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferRlt.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferFrn.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferRpe.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferAl.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferAw1.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferAw2.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferAte.value = null; |
3183 |
18 Mar 15 |
olle |
frm.bufferRdd.value = null; |
3183 |
18 Mar 15 |
olle |
frm.rnaseFreeWater.value = null; |
3183 |
18 Mar 15 |
olle |
frm.dnaseMix.value = null; |
3183 |
18 Mar 15 |
olle |
frm.rneasyMinEluteSpinColumn.value = null; |
3183 |
18 Mar 15 |
olle |
frm.qiaampMinEluteSpinColumn.value = null; |
3324 |
11 May 15 |
olle |
423 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
frm.kapaSybrFast.value = null; |
3324 |
11 May 15 |
olle |
frm.qualityControlPrimersQcpRgt.value = null; |
3438 |
03 Jul 15 |
olle |
frm.qualityControlTemplateQct.value = null; |
3324 |
11 May 15 |
olle |
frm.qubitDnaHighSens.value = null; |
3324 |
11 May 15 |
olle |
frm.qubitDnaBroadRange.value = null; |
3183 |
18 Mar 15 |
olle |
430 |
} |
3183 |
18 Mar 15 |
olle |
431 |
|
3183 |
18 Mar 15 |
olle |
exreg.copyReagentsFromLatestExtract = function() |
3183 |
18 Mar 15 |
olle |
433 |
{ |
3183 |
18 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3183 |
18 Mar 15 |
olle |
url += '&cmd=GetLastProcessedDna'; |
3183 |
18 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.lastProcessedDnaLoaded); |
3183 |
18 Mar 15 |
olle |
437 |
} |
3183 |
18 Mar 15 |
olle |
438 |
|
3176 |
06 Mar 15 |
olle |
exreg.lastProcessedDnaLoaded = function(response) |
3176 |
06 Mar 15 |
olle |
440 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var dnas = response.dnas; |
3176 |
06 Mar 15 |
olle |
443 |
|
3176 |
06 Mar 15 |
olle |
if (dnas.length > 0) |
3176 |
06 Mar 15 |
olle |
445 |
{ |
3183 |
18 Mar 15 |
olle |
var dna = dnas[0]; |
3176 |
06 Mar 15 |
olle |
447 |
|
3183 |
18 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
449 |
|
3183 |
18 Mar 15 |
olle |
// AllPrep FFPE Kit |
3183 |
18 Mar 15 |
olle |
var allPrepFfpeKit = ''; |
3183 |
18 Mar 15 |
olle |
452 |
|
3183 |
18 Mar 15 |
olle |
// Specimen reagents |
3183 |
18 Mar 15 |
olle |
var specXylene = ''; |
3183 |
18 Mar 15 |
olle |
var specEtoh995 = ''; |
3183 |
18 Mar 15 |
olle |
var specBufferPkd = ''; |
3183 |
18 Mar 15 |
olle |
var specBufferAtl = ''; |
3183 |
18 Mar 15 |
olle |
var specProteinaseK = ''; |
3183 |
18 Mar 15 |
olle |
var specRNAseA = ''; |
3183 |
18 Mar 15 |
olle |
460 |
|
3183 |
18 Mar 15 |
olle |
// QIAcube reagents |
3183 |
18 Mar 15 |
olle |
var bufferRlt = ''; |
3183 |
18 Mar 15 |
olle |
var etoh995 = ''; |
3183 |
18 Mar 15 |
olle |
var bufferFrn = ''; |
3183 |
18 Mar 15 |
olle |
var bufferRpe = ''; |
3183 |
18 Mar 15 |
olle |
var rnaseFreeWater = ''; |
3183 |
18 Mar 15 |
olle |
var dnaseMix = ''; |
3183 |
18 Mar 15 |
olle |
var bufferRdd = ''; |
3183 |
18 Mar 15 |
olle |
var rneasyMinEluteSpinColumn = ''; |
3183 |
18 Mar 15 |
olle |
var bufferAl = ''; |
3183 |
18 Mar 15 |
olle |
var bufferAW1 = ''; |
3183 |
18 Mar 15 |
olle |
var bufferAW2 = ''; |
3183 |
18 Mar 15 |
olle |
var bufferAte = ''; |
3183 |
18 Mar 15 |
olle |
var qiaampMinEluteSpinColumn = ''; |
3183 |
18 Mar 15 |
olle |
475 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
var kapaSybrFast = ''; |
3324 |
11 May 15 |
olle |
var qualityControlPrimersQcpRgt = ''; |
3438 |
03 Jul 15 |
olle |
var qualityControlTemplateQct = ''; |
3324 |
11 May 15 |
olle |
var qubitDnaHighSens = ''; |
3324 |
11 May 15 |
olle |
var qubitDnaBroadRange = ''; |
3324 |
11 May 15 |
olle |
482 |
|
3183 |
18 Mar 15 |
olle |
if (dna) |
3183 |
18 Mar 15 |
olle |
484 |
{ |
3176 |
06 Mar 15 |
olle |
// AllPrep FFPE Kit |
3183 |
18 Mar 15 |
olle |
allPrepFfpeKit = dna.allPrepFfpeKit; |
3176 |
06 Mar 15 |
olle |
487 |
|
3176 |
06 Mar 15 |
olle |
// Specimen reagents |
3183 |
18 Mar 15 |
olle |
specXylene = dna.xyleneSpecimen; |
3183 |
18 Mar 15 |
olle |
specEtoh995 = dna.etoh995Specimen; |
3183 |
18 Mar 15 |
olle |
specBufferPkd = dna.bufferPkdSpecimen; |
3183 |
18 Mar 15 |
olle |
specBufferAtl = dna.bufferAtlSpecimen; |
3183 |
18 Mar 15 |
olle |
specProteinaseK = dna.proteinaseKSpecimen; |
3183 |
18 Mar 15 |
olle |
specRNAseA = dna.rnaseASpecimen; |
3176 |
06 Mar 15 |
olle |
495 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube reagents |
3183 |
18 Mar 15 |
olle |
bufferRlt = dna.bufferRlt; |
3183 |
18 Mar 15 |
olle |
etoh995 = dna.etoh995; |
3183 |
18 Mar 15 |
olle |
bufferFrn = dna.bufferFrn; |
3183 |
18 Mar 15 |
olle |
bufferRpe = dna.bufferRpe; |
3183 |
18 Mar 15 |
olle |
rnaseFreeWater = dna.rnaseFreeWater; |
3183 |
18 Mar 15 |
olle |
dnaseMix = dna.dnaseMix; |
3183 |
18 Mar 15 |
olle |
bufferRdd = dna.bufferRdd; |
3183 |
18 Mar 15 |
olle |
rneasyMinEluteSpinColumn = dna.rneasyMinEluteSpinColumn; |
3183 |
18 Mar 15 |
olle |
bufferAl = dna.bufferAl; |
3183 |
18 Mar 15 |
olle |
bufferAW1 = dna.bufferAw1; |
3183 |
18 Mar 15 |
olle |
bufferAW2 = dna.bufferAw2; |
3183 |
18 Mar 15 |
olle |
bufferAte = dna.bufferAte; |
3324 |
11 May 15 |
olle |
qiaampMinEluteSpinColumn = dna.qiaampMinEluteSpinColumn; |
3324 |
11 May 15 |
olle |
510 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
kapaSybrFast = dna.kapaSybrFast; |
3324 |
11 May 15 |
olle |
qualityControlPrimersQcpRgt = dna.qualityControlPrimersQcpRgt; |
3438 |
03 Jul 15 |
olle |
qualityControlTemplateQct = dna.qualityControlTemplateQct; |
3324 |
11 May 15 |
olle |
qubitDnaHighSens = dna.qubitDnaHighSens; |
3324 |
11 May 15 |
olle |
qubitDnaBroadRange = dna.qubitDnaBroadRange; |
3183 |
18 Mar 15 |
olle |
517 |
} |
3176 |
06 Mar 15 |
olle |
518 |
|
3183 |
18 Mar 15 |
olle |
// Update reagent values |
3176 |
06 Mar 15 |
olle |
520 |
|
3183 |
18 Mar 15 |
olle |
// Specimen reagents |
3183 |
18 Mar 15 |
olle |
frm.xyleneSpecimen.value = specXylene; |
3183 |
18 Mar 15 |
olle |
frm.etoh995Specimen.value = specEtoh995; |
3501 |
21 Sep 15 |
olle |
frm.allPrepFfpeKit.value = allPrepFfpeKit; |
3183 |
18 Mar 15 |
olle |
frm.bufferPkdSpecimen.value = specBufferPkd; |
3183 |
18 Mar 15 |
olle |
frm.bufferAtlSpecimen.value = specBufferAtl; |
3183 |
18 Mar 15 |
olle |
frm.proteinaseKSpecimen.value = specProteinaseK; |
3183 |
18 Mar 15 |
olle |
frm.rnaseASpecimen.value = specRNAseA; |
3176 |
06 Mar 15 |
olle |
529 |
|
3183 |
18 Mar 15 |
olle |
// QIAcube reagents |
3183 |
18 Mar 15 |
olle |
frm.etoh995.value = etoh995; |
3183 |
18 Mar 15 |
olle |
frm.bufferRlt.value = bufferRlt; |
3183 |
18 Mar 15 |
olle |
frm.bufferFrn.value = bufferFrn; |
3183 |
18 Mar 15 |
olle |
frm.bufferRpe.value = bufferRpe; |
3183 |
18 Mar 15 |
olle |
frm.bufferAl.value = bufferAl; |
3183 |
18 Mar 15 |
olle |
frm.bufferAw1.value = bufferAW1; |
3183 |
18 Mar 15 |
olle |
frm.bufferAw2.value = bufferAW2; |
3183 |
18 Mar 15 |
olle |
frm.bufferAte.value = bufferAte; |
3183 |
18 Mar 15 |
olle |
frm.bufferRdd.value = bufferRdd; |
3183 |
18 Mar 15 |
olle |
frm.rnaseFreeWater.value = rnaseFreeWater; |
3183 |
18 Mar 15 |
olle |
frm.dnaseMix.value = dnaseMix; |
3183 |
18 Mar 15 |
olle |
frm.rneasyMinEluteSpinColumn.value = rneasyMinEluteSpinColumn; |
3183 |
18 Mar 15 |
olle |
frm.qiaampMinEluteSpinColumn.value = qiaampMinEluteSpinColumn; |
3324 |
11 May 15 |
olle |
544 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
frm.kapaSybrFast.value = kapaSybrFast; |
3324 |
11 May 15 |
olle |
frm.qualityControlPrimersQcpRgt.value = qualityControlPrimersQcpRgt; |
3438 |
03 Jul 15 |
olle |
frm.qualityControlTemplateQct.value = qualityControlTemplateQct; |
3324 |
11 May 15 |
olle |
frm.qubitDnaHighSens.value = qubitDnaHighSens; |
3324 |
11 May 15 |
olle |
frm.qubitDnaBroadRange.value = qubitDnaBroadRange; |
3176 |
06 Mar 15 |
olle |
551 |
} |
3176 |
06 Mar 15 |
olle |
552 |
} |
3176 |
06 Mar 15 |
olle |
553 |
|
3176 |
06 Mar 15 |
olle |
exreg.qiacubeDateOnChange = function() |
3176 |
06 Mar 15 |
olle |
555 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
557 |
|
3180 |
17 Mar 15 |
olle |
var isolationDateIsValid = Wizard.isValid('isolationDate'); |
3176 |
06 Mar 15 |
olle |
var qiacubeDateIsValid = Wizard.isValid('qiacubeDate'); |
3176 |
06 Mar 15 |
olle |
560 |
|
3180 |
17 Mar 15 |
olle |
if (!isolationDateIsValid || !qiacubeDateIsValid) return; |
3176 |
06 Mar 15 |
olle |
562 |
|
3180 |
17 Mar 15 |
olle |
var isolationDate = Dates.parseString(frm.isolationDate.value, 'yyyyMMdd'); |
3176 |
06 Mar 15 |
olle |
var qiacubeDate = Dates.parseString(frm.qiacubeDate.value, 'yyyyMMdd'); |
3180 |
17 Mar 15 |
olle |
if (isolationDate > qiacubeDate) |
3176 |
06 Mar 15 |
olle |
566 |
{ |
3180 |
17 Mar 15 |
olle |
Wizard.setInputStatus('qiacubeDate', 'invalid', 'QIAcube date is before isolation date'); |
3180 |
17 Mar 15 |
olle |
qiacubeDateIsAfterIsolationDate = false; |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
570 |
} |
3176 |
06 Mar 15 |
olle |
571 |
|
3180 |
17 Mar 15 |
olle |
qiacubeDateIsAfterIsolationDate = true; |
3176 |
06 Mar 15 |
olle |
573 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qiacubeDate', 'valid'); |
3176 |
06 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
url += '&cmd=GetNextQiacubeRunNo&qiacubeDate='+encodeURIComponent(frm.qiacubeDate.value); |
3176 |
06 Mar 15 |
olle |
Wizard.showLoadingAnimation('Loading Qiacube run number...'); |
3176 |
06 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.gotNextRunNumber); |
3176 |
06 Mar 15 |
olle |
579 |
} |
3176 |
06 Mar 15 |
olle |
580 |
|
3176 |
06 Mar 15 |
olle |
exreg.gotNextRunNumber = function(response) |
3176 |
06 Mar 15 |
olle |
582 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
frm.qiacubeRunNo.value = response.nextQiacubeRunNo; |
3176 |
06 Mar 15 |
olle |
Events.sendChangeEvent('qiacubeRunNo'); |
3176 |
06 Mar 15 |
olle |
586 |
} |
3176 |
06 Mar 15 |
olle |
587 |
|
3176 |
06 Mar 15 |
olle |
exreg.qiacubeRunNoOnChange = function() |
3176 |
06 Mar 15 |
olle |
589 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var runNumber = frm.qiacubeRunNo.value; |
3176 |
06 Mar 15 |
olle |
qiacubeRunNoIsValid = false; |
3176 |
06 Mar 15 |
olle |
593 |
|
3176 |
06 Mar 15 |
olle |
if (runNumber == '') |
3176 |
06 Mar 15 |
olle |
595 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qiacubeRunNo', 'invalid', 'Missing'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
598 |
} |
3176 |
06 Mar 15 |
olle |
if (!(parseInt(runNumber, 10) >= 1)) |
3176 |
06 Mar 15 |
olle |
600 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qiacubeRunNo', 'invalid', 'Must be at least 1'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
603 |
} |
3176 |
06 Mar 15 |
olle |
604 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qiacubeRunNo', 'valid'); |
3176 |
06 Mar 15 |
olle |
qiacubeRunNoIsValid = true; |
3176 |
06 Mar 15 |
olle |
607 |
} |
3176 |
06 Mar 15 |
olle |
608 |
|
3176 |
06 Mar 15 |
olle |
609 |
|
3176 |
06 Mar 15 |
olle |
exreg.reagentFileOnChange = function() |
3176 |
06 Mar 15 |
olle |
611 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var file = frm.reagentFile.files[0]; |
3176 |
06 Mar 15 |
olle |
614 |
|
3176 |
06 Mar 15 |
olle |
var reader = new FileReader(); |
3176 |
06 Mar 15 |
olle |
reader.onload = exreg.reagentFileLoaded; |
3176 |
06 Mar 15 |
olle |
reader.readAsText(file); |
3176 |
06 Mar 15 |
olle |
618 |
} |
3176 |
06 Mar 15 |
olle |
619 |
|
3176 |
06 Mar 15 |
olle |
exreg.reagentFileLoaded = function(event) |
3176 |
06 Mar 15 |
olle |
621 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.parseReagentFile(event.target.result); |
3176 |
06 Mar 15 |
olle |
623 |
} |
3176 |
06 Mar 15 |
olle |
624 |
|
3176 |
06 Mar 15 |
olle |
exreg.parseReagentFile = function(data) |
3176 |
06 Mar 15 |
olle |
626 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
reagentFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
629 |
|
3176 |
06 Mar 15 |
olle |
var numReagentItems = 0; |
3176 |
06 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
632 |
|
3176 |
06 Mar 15 |
olle |
// AllPrep FFPE Kit |
3176 |
06 Mar 15 |
olle |
var allPrepFfpeKit = ''; |
3176 |
06 Mar 15 |
olle |
635 |
|
3176 |
06 Mar 15 |
olle |
// Specimen reagents |
3176 |
06 Mar 15 |
olle |
var specXylene = ''; |
3176 |
06 Mar 15 |
olle |
var specEtoh995 = ''; |
3176 |
06 Mar 15 |
olle |
var specBufferPkd = ''; |
3176 |
06 Mar 15 |
olle |
var specBufferAtl = ''; |
3176 |
06 Mar 15 |
olle |
var specProteinaseK = ''; |
3176 |
06 Mar 15 |
olle |
var specRNAseA = ''; |
3176 |
06 Mar 15 |
olle |
643 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube reagents |
3176 |
06 Mar 15 |
olle |
var bufferRlt = ''; |
3176 |
06 Mar 15 |
olle |
var etoh995 = ''; |
3176 |
06 Mar 15 |
olle |
var bufferFrn = ''; |
3176 |
06 Mar 15 |
olle |
var bufferRpe = ''; |
3176 |
06 Mar 15 |
olle |
var rnaseFreeWater = ''; |
3176 |
06 Mar 15 |
olle |
var dnaseMix = ''; |
3176 |
06 Mar 15 |
olle |
var bufferRdd = ''; |
3176 |
06 Mar 15 |
olle |
var rneasyMinEluteSpinColumn = ''; |
3176 |
06 Mar 15 |
olle |
var bufferAl = ''; |
3176 |
06 Mar 15 |
olle |
var bufferAW1 = ''; |
3176 |
06 Mar 15 |
olle |
var bufferAW2 = ''; |
3176 |
06 Mar 15 |
olle |
var bufferAte = ''; |
3176 |
06 Mar 15 |
olle |
var qiaampMinEluteSpinColumn = ''; |
3176 |
06 Mar 15 |
olle |
658 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
var kapaSybrFast = ''; |
3324 |
11 May 15 |
olle |
var qualityControlPrimersQcpRgt = ''; |
3438 |
03 Jul 15 |
olle |
var qualityControlTemplateQct = ''; |
3324 |
11 May 15 |
olle |
var qubitDnaHighSens = ''; |
3324 |
11 May 15 |
olle |
var qubitDnaBroadRange = ''; |
3324 |
11 May 15 |
olle |
665 |
|
3176 |
06 Mar 15 |
olle |
// Find column separator as first character after first occurrence of search string |
3352 |
26 May 15 |
olle |
var separator = ExtractUtils.findSeparator(data, "Specimen Reagents"); |
3176 |
06 Mar 15 |
olle |
if (separator == null) |
3176 |
06 Mar 15 |
olle |
669 |
{ |
3176 |
06 Mar 15 |
olle |
// Comma is default separator |
3176 |
06 Mar 15 |
olle |
separator = ','; |
3176 |
06 Mar 15 |
olle |
672 |
} |
3176 |
06 Mar 15 |
olle |
var columnSplitRegexp = new RegExp(" *" + separator + " *",''); |
3176 |
06 Mar 15 |
olle |
var lines = data.split(/[\n\r]+/); |
3176 |
06 Mar 15 |
olle |
var columns = lines[0].split(columnSplitRegexp); |
3176 |
06 Mar 15 |
olle |
676 |
|
3176 |
06 Mar 15 |
olle |
var numImported = 0; |
3176 |
06 Mar 15 |
olle |
var inQiaCubeSection = false; |
3176 |
06 Mar 15 |
olle |
for (var i = 1; i < lines.length; i++) |
3176 |
06 Mar 15 |
olle |
680 |
{ |
3176 |
06 Mar 15 |
olle |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
3176 |
06 Mar 15 |
olle |
var row = lines[i].split(columnSplitRegexp); |
3176 |
06 Mar 15 |
olle |
if (row[0] == 'Qiacube Reagents') |
3176 |
06 Mar 15 |
olle |
684 |
{ |
3176 |
06 Mar 15 |
olle |
inQiaCubeSection = true; |
3176 |
06 Mar 15 |
olle |
686 |
} |
3176 |
06 Mar 15 |
olle |
if (row.length > 1) |
3176 |
06 Mar 15 |
olle |
688 |
{ |
3176 |
06 Mar 15 |
olle |
var key = row[0]; |
3176 |
06 Mar 15 |
olle |
if (!key || key == '') continue; // with the next line |
3176 |
06 Mar 15 |
olle |
691 |
|
3176 |
06 Mar 15 |
olle |
// AllPrep FFPE Kit |
3501 |
21 Sep 15 |
olle |
if (key == 'AllPrep DNA/RNA FFPE kit') |
3176 |
06 Mar 15 |
olle |
694 |
{ |
3176 |
06 Mar 15 |
olle |
allPrepFfpeKit = row[1]; |
3176 |
06 Mar 15 |
olle |
696 |
} |
3176 |
06 Mar 15 |
olle |
697 |
|
3176 |
06 Mar 15 |
olle |
// Specimen reagents |
3176 |
06 Mar 15 |
olle |
if (key == 'Xylen') |
3176 |
06 Mar 15 |
olle |
700 |
{ |
3176 |
06 Mar 15 |
olle |
specXylene = row[1]; |
3176 |
06 Mar 15 |
olle |
702 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'ETOH 99,5%') |
3176 |
06 Mar 15 |
olle |
704 |
{ |
3176 |
06 Mar 15 |
olle |
if (!inQiaCubeSection) |
3176 |
06 Mar 15 |
olle |
706 |
{ |
3176 |
06 Mar 15 |
olle |
specEtoh995 = row[1]; |
3176 |
06 Mar 15 |
olle |
708 |
} |
3176 |
06 Mar 15 |
olle |
709 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer PKD') |
3176 |
06 Mar 15 |
olle |
711 |
{ |
3176 |
06 Mar 15 |
olle |
specBufferPkd = row[1]; |
3176 |
06 Mar 15 |
olle |
713 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer ATL') |
3176 |
06 Mar 15 |
olle |
715 |
{ |
3176 |
06 Mar 15 |
olle |
specBufferAtl = row[1]; |
3176 |
06 Mar 15 |
olle |
717 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Proteinase K') |
3176 |
06 Mar 15 |
olle |
719 |
{ |
3176 |
06 Mar 15 |
olle |
specProteinaseK = row[1]; |
3176 |
06 Mar 15 |
olle |
721 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Rnase A') |
3176 |
06 Mar 15 |
olle |
723 |
{ |
3176 |
06 Mar 15 |
olle |
specRNAseA = row[1]; |
3176 |
06 Mar 15 |
olle |
725 |
} |
3176 |
06 Mar 15 |
olle |
726 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube reagents |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer RLT') |
3176 |
06 Mar 15 |
olle |
729 |
{ |
3176 |
06 Mar 15 |
olle |
bufferRlt = row[1]; |
3176 |
06 Mar 15 |
olle |
731 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'ETOH 99,5%') |
3176 |
06 Mar 15 |
olle |
733 |
{ |
3176 |
06 Mar 15 |
olle |
if (inQiaCubeSection) |
3176 |
06 Mar 15 |
olle |
735 |
{ |
3176 |
06 Mar 15 |
olle |
etoh995 = row[1]; |
3176 |
06 Mar 15 |
olle |
737 |
} |
3176 |
06 Mar 15 |
olle |
738 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer FRN') |
3176 |
06 Mar 15 |
olle |
740 |
{ |
3176 |
06 Mar 15 |
olle |
bufferFrn = row[1]; |
3176 |
06 Mar 15 |
olle |
742 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer RPE') |
3176 |
06 Mar 15 |
olle |
744 |
{ |
3176 |
06 Mar 15 |
olle |
bufferRpe = row[1]; |
3176 |
06 Mar 15 |
olle |
746 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Rnase-free Water') |
3176 |
06 Mar 15 |
olle |
748 |
{ |
3176 |
06 Mar 15 |
olle |
rnaseFreeWater = row[1]; |
3176 |
06 Mar 15 |
olle |
750 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'DNAse mix') |
3176 |
06 Mar 15 |
olle |
752 |
{ |
3176 |
06 Mar 15 |
olle |
dnaseMix = row[1]; |
3176 |
06 Mar 15 |
olle |
754 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'RDD') |
3176 |
06 Mar 15 |
olle |
756 |
{ |
3176 |
06 Mar 15 |
olle |
bufferRdd = row[1]; |
3176 |
06 Mar 15 |
olle |
758 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Rneasy MinElute Spin Column') |
3176 |
06 Mar 15 |
olle |
760 |
{ |
3176 |
06 Mar 15 |
olle |
rneasyMinEluteSpinColumn = row[1]; |
3176 |
06 Mar 15 |
olle |
762 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer AL') |
3176 |
06 Mar 15 |
olle |
764 |
{ |
3176 |
06 Mar 15 |
olle |
bufferAl = row[1]; |
3176 |
06 Mar 15 |
olle |
766 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer AW1') |
3176 |
06 Mar 15 |
olle |
768 |
{ |
3176 |
06 Mar 15 |
olle |
bufferAW1 = row[1]; |
3176 |
06 Mar 15 |
olle |
770 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer AW2') |
3176 |
06 Mar 15 |
olle |
772 |
{ |
3176 |
06 Mar 15 |
olle |
bufferAW2 = row[1]; |
3176 |
06 Mar 15 |
olle |
774 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'Buffer ATE') |
3176 |
06 Mar 15 |
olle |
776 |
{ |
3176 |
06 Mar 15 |
olle |
bufferAte = row[1]; |
3176 |
06 Mar 15 |
olle |
778 |
} |
3176 |
06 Mar 15 |
olle |
if (key == 'QIAamp MinElute Spin Column') |
3176 |
06 Mar 15 |
olle |
780 |
{ |
3176 |
06 Mar 15 |
olle |
qiaampMinEluteSpinColumn = row[1]; |
3176 |
06 Mar 15 |
olle |
782 |
} |
3324 |
11 May 15 |
olle |
783 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
if (key == 'Kapa SYBR Fast') |
3324 |
11 May 15 |
olle |
786 |
{ |
3324 |
11 May 15 |
olle |
kapaSybrFast = row[1]; |
3324 |
11 May 15 |
olle |
788 |
} |
3324 |
11 May 15 |
olle |
if (key == 'Quality Control Primers (QCP) RGT') |
3324 |
11 May 15 |
olle |
790 |
{ |
3324 |
11 May 15 |
olle |
qualityControlPrimersQcpRgt = row[1]; |
3324 |
11 May 15 |
olle |
792 |
} |
3438 |
03 Jul 15 |
olle |
if (key == 'Quality Control Template (QCT)') |
3438 |
03 Jul 15 |
olle |
794 |
{ |
3438 |
03 Jul 15 |
olle |
qualityControlTemplateQct = row[1]; |
3438 |
03 Jul 15 |
olle |
796 |
} |
3324 |
11 May 15 |
olle |
if (key == 'QUBIT DNA High Sens') |
3324 |
11 May 15 |
olle |
798 |
{ |
3324 |
11 May 15 |
olle |
qubitDnaHighSens = row[1]; |
3324 |
11 May 15 |
olle |
800 |
} |
3324 |
11 May 15 |
olle |
if (key == 'QUBIT DNA Broad Range') |
3324 |
11 May 15 |
olle |
802 |
{ |
3324 |
11 May 15 |
olle |
qubitDnaBroadRange = row[1]; |
3324 |
11 May 15 |
olle |
804 |
} |
3176 |
06 Mar 15 |
olle |
805 |
} |
3176 |
06 Mar 15 |
olle |
806 |
} |
3176 |
06 Mar 15 |
olle |
807 |
|
3176 |
06 Mar 15 |
olle |
// Update reagent values |
3176 |
06 Mar 15 |
olle |
809 |
|
3176 |
06 Mar 15 |
olle |
// Specimen reagents |
3176 |
06 Mar 15 |
olle |
frm.xyleneSpecimen.value = specXylene; |
3176 |
06 Mar 15 |
olle |
frm.etoh995Specimen.value = specEtoh995; |
3501 |
21 Sep 15 |
olle |
frm.allPrepFfpeKit.value = allPrepFfpeKit; |
3176 |
06 Mar 15 |
olle |
frm.bufferPkdSpecimen.value = specBufferPkd; |
3176 |
06 Mar 15 |
olle |
frm.bufferAtlSpecimen.value = specBufferAtl; |
3176 |
06 Mar 15 |
olle |
frm.proteinaseKSpecimen.value = specProteinaseK; |
3176 |
06 Mar 15 |
olle |
frm.rnaseASpecimen.value = specRNAseA; |
3176 |
06 Mar 15 |
olle |
818 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube reagents |
3176 |
06 Mar 15 |
olle |
frm.etoh995.value = etoh995; |
3176 |
06 Mar 15 |
olle |
frm.bufferRlt.value = bufferRlt; |
3176 |
06 Mar 15 |
olle |
frm.bufferFrn.value = bufferFrn; |
3176 |
06 Mar 15 |
olle |
frm.bufferRpe.value = bufferRpe; |
3501 |
21 Sep 15 |
olle |
frm.rnaseFreeWater.value = rnaseFreeWater; |
3501 |
21 Sep 15 |
olle |
frm.dnaseMix.value = dnaseMix; |
3501 |
21 Sep 15 |
olle |
frm.bufferRdd.value = bufferRdd; |
3501 |
21 Sep 15 |
olle |
frm.rneasyMinEluteSpinColumn.value = rneasyMinEluteSpinColumn; |
3501 |
21 Sep 15 |
olle |
frm.qiaampMinEluteSpinColumn.value = qiaampMinEluteSpinColumn; |
3176 |
06 Mar 15 |
olle |
frm.bufferAl.value = bufferAl; |
3176 |
06 Mar 15 |
olle |
frm.bufferAw1.value = bufferAW1; |
3176 |
06 Mar 15 |
olle |
frm.bufferAw2.value = bufferAW2; |
3176 |
06 Mar 15 |
olle |
frm.bufferAte.value = bufferAte; |
3176 |
06 Mar 15 |
olle |
833 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
frm.kapaSybrFast.value = kapaSybrFast; |
3501 |
21 Sep 15 |
olle |
frm.qualityControlTemplateQct.value = qualityControlTemplateQct; |
3324 |
11 May 15 |
olle |
frm.qualityControlPrimersQcpRgt.value = qualityControlPrimersQcpRgt; |
3324 |
11 May 15 |
olle |
frm.qubitDnaHighSens.value = qubitDnaHighSens; |
3324 |
11 May 15 |
olle |
frm.qubitDnaBroadRange.value = qubitDnaBroadRange; |
3324 |
11 May 15 |
olle |
840 |
|
3176 |
06 Mar 15 |
olle |
if (numImported != numReagentItems) |
3176 |
06 Mar 15 |
olle |
842 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('reagentFile', 'invalid', 'Could not find values for all ' + numReagentItems + ' samples: ' + numImported); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
845 |
} |
3176 |
06 Mar 15 |
olle |
846 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('reagentFile', 'valid'); |
3176 |
06 Mar 15 |
olle |
reagentFileIsValid = true; |
3176 |
06 Mar 15 |
olle |
849 |
} |
3176 |
06 Mar 15 |
olle |
850 |
|
3176 |
06 Mar 15 |
olle |
exreg.findReagentColumn = function(columns, col) |
3176 |
06 Mar 15 |
olle |
852 |
{ |
3176 |
06 Mar 15 |
olle |
var colIndex = columns.indexOf(col); |
3176 |
06 Mar 15 |
olle |
if (colIndex == -1) |
3176 |
06 Mar 15 |
olle |
855 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('reagentFile', 'invalid', 'On line 1; Can\'t find "' + col + '" column'); |
3176 |
06 Mar 15 |
olle |
857 |
} |
3176 |
06 Mar 15 |
olle |
return colIndex; |
3176 |
06 Mar 15 |
olle |
859 |
} |
3176 |
06 Mar 15 |
olle |
860 |
|
3176 |
06 Mar 15 |
olle |
exreg.validateStep2 = function(event) |
3176 |
06 Mar 15 |
olle |
862 |
{ |
3176 |
06 Mar 15 |
olle |
var valid = true; |
3180 |
17 Mar 15 |
olle |
valid &= Wizard.isValid('isolationDate'); |
3176 |
06 Mar 15 |
olle |
valid &= Wizard.isValid('qiacubeDate'); |
3176 |
06 Mar 15 |
olle |
valid &= qiacubeRunNoIsValid; |
3176 |
06 Mar 15 |
olle |
867 |
|
3176 |
06 Mar 15 |
olle |
if (!valid) event.preventDefault(); |
3176 |
06 Mar 15 |
olle |
869 |
} |
3176 |
06 Mar 15 |
olle |
870 |
|
3176 |
06 Mar 15 |
olle |
871 |
|
3176 |
06 Mar 15 |
olle |
exreg.initializeStep3 = function() |
3176 |
06 Mar 15 |
olle |
873 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3432 |
29 Jun 15 |
olle |
var startListName = frm.startListName.value; |
3432 |
29 Jun 15 |
olle |
Doc.element('detailsStartListName').innerHTML = '<b>Start list: ' + startListName + '</b>'; |
3283 |
29 Apr 15 |
olle |
Doc.element('qubitFileDilutionFactor').value = QUBIT_DILUTION_FACTOR_DEFAULT; |
3352 |
26 May 15 |
olle |
var rnaDefaultVolume = ExtractUtils.getNumber(frm.rnaDefaultVolume.value); |
3352 |
26 May 15 |
olle |
var dnaDefaultVolume = ExtractUtils.getNumber(frm.dnaDefaultVolume.value); |
3176 |
06 Mar 15 |
olle |
qiacubeSortedPrefixes = exreg.getQiacubeSortedPrefixes(); |
3176 |
06 Mar 15 |
olle |
881 |
|
3176 |
06 Mar 15 |
olle |
var html = '<table id="detailsTable" class="step-form">'; |
3176 |
06 Mar 15 |
olle |
// First header row |
3176 |
06 Mar 15 |
olle |
html += '<thead>'; |
3176 |
06 Mar 15 |
olle |
html += '<tr>'; |
3220 |
01 Apr 15 |
olle |
html += '<th>Extract</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th class="dottedleft">QIAcube</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th colspan="1" class="dottedleft"></th>'; |
3276 |
29 Apr 15 |
olle |
889 |
/* |
3177 |
09 Mar 15 |
olle |
html += '<th colspan="1" class="dottedleft"></th>'; |
3276 |
29 Apr 15 |
olle |
891 |
*/ |
3177 |
09 Mar 15 |
olle |
892 |
/* |
3176 |
06 Mar 15 |
olle |
html += '<th colspan="5" class="dottedleft">RNA</th>'; |
3177 |
09 Mar 15 |
olle |
894 |
*/ |
3276 |
29 Apr 15 |
olle |
895 |
/* |
3177 |
09 Mar 15 |
olle |
html += '<th colspan="3" class="dottedleft">RNA</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th colspan="4" class="dottedleft">DNA</th>'; |
3276 |
29 Apr 15 |
olle |
898 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<th colspan="5" class="dottedleft">RNA</th>'; |
3276 |
29 Apr 15 |
olle |
html += '<th colspan="5" class="dottedleft">DNA</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th></th>'; |
3176 |
06 Mar 15 |
olle |
html += '</tr>'; |
3176 |
06 Mar 15 |
olle |
// Second header row |
3176 |
06 Mar 15 |
olle |
html += '<tr>'; |
3220 |
01 Apr 15 |
olle |
html += '<th>source item</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th class="dottedleft">position</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft">Storage</td>'; |
3177 |
09 Mar 15 |
olle |
908 |
/* |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft">Pos</td><td>Vol.</td><td>Conc.</td><td>Quantity</td><td><span id="toggle-normalize-1" class="link" title="Toggle all">Pre-</span></td>'; |
3177 |
09 Mar 15 |
olle |
910 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<td class="dottedleft">NanoDrop</td><td>RNA</td><td>Vol.</td><td>Conc.</td><td>Quantity</td>'; |
3276 |
29 Apr 15 |
olle |
html += '<td class="dottedleft">DNA</td><td>Vol.</td><td>Conc.</td><td>Quantity</td><td>ΔCt</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft comment"></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td></td>'; |
3176 |
06 Mar 15 |
olle |
html += '</tr>'; |
3176 |
06 Mar 15 |
olle |
// Third header row |
3176 |
06 Mar 15 |
olle |
html += '<tr>'; |
3176 |
06 Mar 15 |
olle |
html += '<th></th>'; |
3176 |
06 Mar 15 |
olle |
html += '<th class="dottedleft"></th>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft">box</td>'; |
3177 |
09 Mar 15 |
olle |
921 |
/* |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft"></td><td>(µl)</td><td>(ng/µl)</td><td>(µg)</td><td><span id="toggle-normalize-2" class="link" title="Toggle all">normalize</span></td>'; |
3177 |
09 Mar 15 |
olle |
923 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<td class="dottedleft">Pos</td><td>Plate Pos.</td><td>(µl)</td><td>(ng/µl)</td><td>(µg)</td>'; |
3276 |
29 Apr 15 |
olle |
html += '<td class="dottedleft">Plate Pos.</td><td>(µl)</td><td>(ng/µl)</td><td>(µg)</td><td></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft comment"></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td></td>'; |
3176 |
06 Mar 15 |
olle |
html += '</tr>'; |
3176 |
06 Mar 15 |
olle |
html += '</thead>'; |
3176 |
06 Mar 15 |
olle |
html += '<tbody>'; |
3176 |
06 Mar 15 |
olle |
931 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var numSpecimenItems = exreg.getNumberOfSpecimenItems(); |
3176 |
06 Mar 15 |
olle |
var numRnaItems = exreg.getNumberOfRnaItems(); |
3176 |
06 Mar 15 |
olle |
var numDnaItems = exreg.getNumberOfDnaItems(); |
3176 |
06 Mar 15 |
olle |
var numNanoDropItems = numSpecimenItems + numRnaItems; |
3432 |
29 Jun 15 |
olle |
var numQiacubeItems = numSpecimenItems; |
3432 |
29 Jun 15 |
olle |
var totNumItems = numItems; |
3176 |
06 Mar 15 |
olle |
var itemNo = 0; |
3180 |
17 Mar 15 |
olle |
var qiacubeItemNo = 0; |
3176 |
06 Mar 15 |
olle |
// Set default values for DNA/RNA extraction |
3180 |
17 Mar 15 |
olle |
for (var i = 0; i < totNumItems; i++) |
3176 |
06 Mar 15 |
olle |
945 |
{ |
3176 |
06 Mar 15 |
olle |
itemNo++; |
3180 |
17 Mar 15 |
olle |
var item = null; |
3180 |
17 Mar 15 |
olle |
var storageBox = '-'; |
3276 |
29 Apr 15 |
olle |
var rnaStorageBox = '-'; |
3276 |
29 Apr 15 |
olle |
var dnaStorageBox = '-'; |
3432 |
29 Jun 15 |
olle |
// MeLuDI extract source item |
3432 |
29 Jun 15 |
olle |
item = selItemsList[i]; |
3432 |
29 Jun 15 |
olle |
var qiacubePos = null; |
3432 |
29 Jun 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3176 |
06 Mar 15 |
olle |
955 |
{ |
3432 |
29 Jun 15 |
olle |
qiacubeItemNo++; |
3432 |
29 Jun 15 |
olle |
qiacubePos = ExtractUtils.getDetailedQiaCubePosition(numQiacubeItems, qiacubeItemNo, qiacubeSortedPrefixes); |
3432 |
29 Jun 15 |
olle |
958 |
} |
3180 |
17 Mar 15 |
olle |
959 |
/* |
3432 |
29 Jun 15 |
olle |
item.originalQuantity = DEFAULT_SPECIMEN_VOLUME; |
3432 |
29 Jun 15 |
olle |
item.processedQuantity = DEFAULT_SPECIMEN_USED; |
3180 |
17 Mar 15 |
olle |
962 |
*/ |
3432 |
29 Jun 15 |
olle |
item.qiacubePosition = qiacubePos; |
3432 |
29 Jun 15 |
olle |
item.originalQiacubePosition = qiacubePos; |
3176 |
06 Mar 15 |
olle |
965 |
|
3432 |
29 Jun 15 |
olle |
var rna = {}; |
3432 |
29 Jun 15 |
olle |
var dna = {}; |
3432 |
29 Jun 15 |
olle |
// RNA |
3432 |
29 Jun 15 |
olle |
rna.name = item.name + '.r'; |
3432 |
29 Jun 15 |
olle |
rna.volume = rnaDefaultVolume; |
3432 |
29 Jun 15 |
olle |
// DNA |
3432 |
29 Jun 15 |
olle |
dna.name = item.name + '.d'; |
3432 |
29 Jun 15 |
olle |
dna.volume = dnaDefaultVolume; |
3276 |
29 Apr 15 |
olle |
974 |
/* |
3432 |
29 Jun 15 |
olle |
item.rna = rna; |
3432 |
29 Jun 15 |
olle |
item.dna = dna; |
3432 |
29 Jun 15 |
olle |
977 |
*/ |
3720 |
22 Jan 16 |
olle |
if (item.rna == null) |
3432 |
29 Jun 15 |
olle |
979 |
{ |
3180 |
17 Mar 15 |
olle |
item.rna = rna; |
3432 |
29 Jun 15 |
olle |
981 |
} |
3720 |
22 Jan 16 |
olle |
else if (item.rna.volume == null) |
3432 |
29 Jun 15 |
olle |
983 |
{ |
3432 |
29 Jun 15 |
olle |
item.rna.volume = rnaDefaultVolume; |
3432 |
29 Jun 15 |
olle |
985 |
} |
3720 |
22 Jan 16 |
olle |
if (item.dna == null) |
3432 |
29 Jun 15 |
olle |
987 |
{ |
3180 |
17 Mar 15 |
olle |
item.dna = dna; |
3432 |
29 Jun 15 |
olle |
989 |
} |
3720 |
22 Jan 16 |
olle |
else if (item.dna.volume == null) |
3432 |
29 Jun 15 |
olle |
991 |
{ |
3432 |
29 Jun 15 |
olle |
item.dna.volume = dnaDefaultVolume; |
3432 |
29 Jun 15 |
olle |
993 |
} |
3180 |
17 Mar 15 |
olle |
994 |
/* |
3432 |
29 Jun 15 |
olle |
var storageBox = '-'; |
3180 |
17 Mar 15 |
olle |
996 |
*/ |
3432 |
29 Jun 15 |
olle |
// Input extract source item specimen/RNA/DNA |
3432 |
29 Jun 15 |
olle |
if (item.bioWell != null) |
3432 |
29 Jun 15 |
olle |
999 |
{ |
3432 |
29 Jun 15 |
olle |
storageBox = Strings.encodeTags(item.bioWell.bioPlate.name + '[' + item.bioWell.location + ']'); |
3180 |
17 Mar 15 |
olle |
1001 |
} |
3432 |
29 Jun 15 |
olle |
// RNA extract from specimen |
3432 |
29 Jun 15 |
olle |
if (item.rna && item.rna.bioWell) |
3176 |
06 Mar 15 |
olle |
1004 |
{ |
3432 |
29 Jun 15 |
olle |
rnaStorageBox = Strings.encodeTags(item.rna.bioWell.bioPlate.name + '[' + item.rna.bioWell.location + ']'); |
3176 |
06 Mar 15 |
olle |
1006 |
} |
3432 |
29 Jun 15 |
olle |
// DNA extract from specimen |
3432 |
29 Jun 15 |
olle |
if (item.dna && item.dna.bioWell) |
3432 |
29 Jun 15 |
olle |
1009 |
{ |
3432 |
29 Jun 15 |
olle |
dnaStorageBox = Strings.encodeTags(item.dna.bioWell.bioPlate.name + '[' + item.dna.bioWell.location + ']'); |
3432 |
29 Jun 15 |
olle |
1011 |
} |
3432 |
29 Jun 15 |
olle |
// Input RNA item storage location should be displayed in the RNA extract storage location column |
3432 |
29 Jun 15 |
olle |
if (ExtractUtils.isRna(item) && item.bioWell != null) |
3432 |
29 Jun 15 |
olle |
1014 |
{ |
3432 |
29 Jun 15 |
olle |
rnaStorageBox = Strings.encodeTags(item.bioWell.bioPlate.name + '[' + item.bioWell.location + ']'); |
3432 |
29 Jun 15 |
olle |
1016 |
} |
3432 |
29 Jun 15 |
olle |
// Input DNA item storage location should be displayed in the DNA extract storage location column |
3432 |
29 Jun 15 |
olle |
if (ExtractUtils.isDna(item) && item.bioWell != null) |
3432 |
29 Jun 15 |
olle |
1019 |
{ |
3432 |
29 Jun 15 |
olle |
dnaStorageBox = Strings.encodeTags(item.bioWell.bioPlate.name + '[' + item.bioWell.location + ']'); |
3432 |
29 Jun 15 |
olle |
1021 |
} |
3176 |
06 Mar 15 |
olle |
html += '<tr class="highlight">'; |
3176 |
06 Mar 15 |
olle |
html += '<th>' + Strings.encodeTags(item.name) + '</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="qiacubePosition'+i+'" class="dottedleft"></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft">'+storageBox+'</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaPos'+i+'" class="dottedleft"></td>'; |
3276 |
29 Apr 15 |
olle |
html += '<td id="rnaPlatePos'+i+'" class="dottedleft">'+rnaStorageBox+'</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaVol'+i+'"></td>'; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3224 |
02 Apr 15 |
olle |
1030 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td class="bg-filled-50 italic"><input type="text" id="rnaConc'+i+'" style="width: 5em;"></intput></td>'; |
3224 |
02 Apr 15 |
olle |
1032 |
} |
3224 |
02 Apr 15 |
olle |
else |
3224 |
02 Apr 15 |
olle |
1034 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td id="rnaConc'+i+'" class="bg-filled-50 italic"></td>'; |
3224 |
02 Apr 15 |
olle |
1036 |
} |
3224 |
02 Apr 15 |
olle |
//html += '<td id="rnaConc'+i+'" class="bg-filled-50 italic"></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaQuantity'+i+'" class="bg-filled-50 italic"></td>'; |
3177 |
09 Mar 15 |
olle |
1039 |
/* |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
1041 |
{ |
3176 |
06 Mar 15 |
olle |
html += '<td><input type="checkbox" name="rnaPreNormalize'+i+'" id="rnaPreNormalize'+i+'" disabled>'; |
3176 |
06 Mar 15 |
olle |
1043 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1045 |
{ |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaPreNormalize'+i+'">-</td>'; |
3176 |
06 Mar 15 |
olle |
1047 |
} |
3177 |
09 Mar 15 |
olle |
1048 |
*/ |
3177 |
09 Mar 15 |
olle |
1049 |
/* |
3176 |
06 Mar 15 |
olle |
html += '<span id="rnaPreNormalize'+i+'.status" class="status"> </span></td>'; |
3177 |
09 Mar 15 |
olle |
1051 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<td id="dnaPlatePos'+i+'" class="dottedleft">'+dnaStorageBox+'</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="dnaVol'+i+'"></td>'; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
1055 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td class="bg-filled-50 italic"><input type="text" id="dnaConc'+i+'" style="width: 5em;"></intput></td>'; |
3176 |
06 Mar 15 |
olle |
1057 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1059 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td id="dnaConc'+i+'" class="bg-filled-50 italic">-</td>'; |
3176 |
06 Mar 15 |
olle |
1061 |
} |
3176 |
06 Mar 15 |
olle |
html += '<td id="dnaQuantity'+i+'" class="bg-filled-50 italic"></td>'; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3224 |
02 Apr 15 |
olle |
1064 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td class="bg-filled-50 italic"><input type="text" id="deltaCt'+i+'" style="width: 5em;"></intput></td>'; |
3224 |
02 Apr 15 |
olle |
1066 |
} |
3224 |
02 Apr 15 |
olle |
else |
3224 |
02 Apr 15 |
olle |
1068 |
{ |
3224 |
02 Apr 15 |
olle |
html += '<td id="deltaCt'+i+'" class="bg-filled-50 italic"></td>'; |
3224 |
02 Apr 15 |
olle |
1070 |
} |
3224 |
02 Apr 15 |
olle |
//html += '<td id="deltaCt'+i+'" class="bg-filled-50 italic"></td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="comments'+i+'" class="dottedleft comment"></td>'; |
3365 |
03 Jun 15 |
olle |
if (i < numItems) |
3365 |
03 Jun 15 |
olle |
1074 |
{ |
3365 |
03 Jun 15 |
olle |
// MeLuDI extract source item |
3365 |
03 Jun 15 |
olle |
html += '<td><div class="button basicbutton interactable edit-details" style="width: 5em;" data-index="'+i+'">Edit…</div></td>'; |
3365 |
03 Jun 15 |
olle |
1077 |
} |
3365 |
03 Jun 15 |
olle |
else |
3365 |
03 Jun 15 |
olle |
1079 |
{ |
3365 |
03 Jun 15 |
olle |
// Extra QIAcube item |
3365 |
03 Jun 15 |
olle |
html += '<td>-</td>'; |
3365 |
03 Jun 15 |
olle |
1082 |
} |
3176 |
06 Mar 15 |
olle |
html += '</tr>'; |
3176 |
06 Mar 15 |
olle |
1084 |
} |
3180 |
17 Mar 15 |
olle |
if (numQiacubeItems == 1 || numQiacubeItems == 11 || numQiacubeItems == 23) |
3176 |
06 Mar 15 |
olle |
1086 |
{ |
3176 |
06 Mar 15 |
olle |
// Add extra row for counterbalance in QIAcube |
3176 |
06 Mar 15 |
olle |
counterBalanceInfoRow = true; |
3176 |
06 Mar 15 |
olle |
var i = numItems; |
3354 |
27 May 15 |
olle |
var qiacubePos = ExtractUtils.getDetailedQiaCubePosition(numQiacubeItems + 1, numQiacubeItems + 1, qiacubeSortedPrefixes); |
3176 |
06 Mar 15 |
olle |
1091 |
|
3176 |
06 Mar 15 |
olle |
html += '<tr class="highlight">'; |
3276 |
29 Apr 15 |
olle |
html += '<th>' + Strings.encodeTags('COUNTER-BALANCE') + '</th>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="qiacubePosition'+i+'" class="dottedleft">'+qiacubePos+'</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td class="dottedleft">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaPos'+i+'" class="dottedleft">-</td>'; |
3276 |
29 Apr 15 |
olle |
html += '<td id="rnaPlatePos'+i+'" class="dottedleft">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaVol'+i+'">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaConc'+i+'" class="bg-filled-50 italic">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="rnaQuantity'+i+'" class="bg-filled-50 italic">-</td>'; |
3177 |
09 Mar 15 |
olle |
1101 |
/* |
3176 |
06 Mar 15 |
olle |
html += '<td>-</td>'; |
3177 |
09 Mar 15 |
olle |
1103 |
*/ |
3276 |
29 Apr 15 |
olle |
html += '<td id="dnaPlatePos'+i+'" class="dottedleft">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="dnaVol'+i+'">-</td>'; |
3224 |
02 Apr 15 |
olle |
html += '<td id="dnaConc'+i+'" class="bg-filled-50 italic">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="dnaQuantity'+i+'" class="bg-filled-50 italic">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="deltaCt'+i+'" class="bg-filled-50 italic">-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td id="comments'+i+'" class="dottedleft comment">Reminder to use counterbalance</td>'; |
3176 |
06 Mar 15 |
olle |
html += '<td>-</td>'; |
3176 |
06 Mar 15 |
olle |
html += '</tr>'; |
3176 |
06 Mar 15 |
olle |
1112 |
} |
3176 |
06 Mar 15 |
olle |
html += '</tbody>'; |
3176 |
06 Mar 15 |
olle |
html += '</table>'; |
3176 |
06 Mar 15 |
olle |
Doc.element('detailsSection').innerHTML = html; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1117 |
{ |
3224 |
02 Apr 15 |
olle |
Events.addEventHandler('rnaConc'+i, 'change', exreg.rnaConcOnChange); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('dnaConc'+i, 'change', exreg.dnaConcOnChange); |
3224 |
02 Apr 15 |
olle |
Events.addEventHandler('deltaCt'+i, 'change', exreg.deltaCtOnChange); |
3176 |
06 Mar 15 |
olle |
1121 |
} |
3176 |
06 Mar 15 |
olle |
var buttons = Doc.element('detailsSection').getElementsByClassName('edit-details'); |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < buttons.length; i++) |
3176 |
06 Mar 15 |
olle |
1124 |
{ |
3176 |
06 Mar 15 |
olle |
Buttons.addClickHandler(buttons[i], exreg.editDnaRnaDetails); |
3176 |
06 Mar 15 |
olle |
1126 |
} |
3177 |
09 Mar 15 |
olle |
1127 |
|
3177 |
09 Mar 15 |
olle |
1128 |
/* |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('toggle-normalize-1', 'click', exreg.toggleNormalize); |
3176 |
06 Mar 15 |
olle |
Events.addEventHandler('toggle-normalize-2', 'click', exreg.toggleNormalize); |
3177 |
09 Mar 15 |
olle |
1131 |
*/ |
3176 |
06 Mar 15 |
olle |
1132 |
|
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
1134 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setCurrentStep(3); |
3176 |
06 Mar 15 |
olle |
Doc.show('gocancel'); |
3176 |
06 Mar 15 |
olle |
Doc.show('gocreate'); |
3176 |
06 Mar 15 |
olle |
Doc.show('goregister'); |
3176 |
06 Mar 15 |
olle |
Doc.show('btnFakeNanoDropFile'); |
3176 |
06 Mar 15 |
olle |
Doc.show('btnFakeDnaInput'); |
3176 |
06 Mar 15 |
olle |
Doc.show('btnFakeQPcrFile'); |
3176 |
06 Mar 15 |
olle |
1142 |
|
3224 |
02 Apr 15 |
olle |
//Wizard.setInputStatus('nanoDropFile', 'invalid', 'No file selected'); |
3176 |
06 Mar 15 |
olle |
Wizard.keepSessionAlive(); |
3176 |
06 Mar 15 |
olle |
1145 |
|
3176 |
06 Mar 15 |
olle |
if (debug && location.protocol != 'https:') |
3176 |
06 Mar 15 |
olle |
1147 |
{ |
3200 |
19 Mar 15 |
olle |
Doc.show('debug-tools'); |
3176 |
06 Mar 15 |
olle |
1149 |
} |
3176 |
06 Mar 15 |
olle |
1150 |
} |
3176 |
06 Mar 15 |
olle |
1151 |
|
3176 |
06 Mar 15 |
olle |
exreg.getQiacubeSortedPrefixes = function() |
3176 |
06 Mar 15 |
olle |
1153 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var primaryQiacubePrefix = frm.qiacubePrimaryPrefix.value; |
3176 |
06 Mar 15 |
olle |
var secondaryQiacubePrefix = frm.qiacubeSecondaryPrefix.value; |
3176 |
06 Mar 15 |
olle |
1157 |
|
3176 |
06 Mar 15 |
olle |
// Get string of current QIAcube prefixes in order |
3354 |
27 May 15 |
olle |
var sortedPrefixes = ExtractUtils.getQiacubeSortedPrefixes(primaryQiacubePrefix, secondaryQiacubePrefix); |
3176 |
06 Mar 15 |
olle |
return sortedPrefixes; |
3176 |
06 Mar 15 |
olle |
1161 |
} |
3176 |
06 Mar 15 |
olle |
1162 |
|
3176 |
06 Mar 15 |
olle |
exreg.toggleNormalize = function() |
3176 |
06 Mar 15 |
olle |
1164 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
// Toggle normalize check box status |
3176 |
06 Mar 15 |
olle |
var check = null; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1172 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
1175 |
{ |
3176 |
06 Mar 15 |
olle |
if (!frm['rnaPreNormalize'+i].disabled) |
3176 |
06 Mar 15 |
olle |
1177 |
{ |
3176 |
06 Mar 15 |
olle |
if (check == null) check = !frm['rnaPreNormalize'+i].checked; |
3176 |
06 Mar 15 |
olle |
frm['rnaPreNormalize'+i].checked = check; |
3176 |
06 Mar 15 |
olle |
1180 |
} |
3176 |
06 Mar 15 |
olle |
1181 |
} |
3176 |
06 Mar 15 |
olle |
1182 |
} |
3176 |
06 Mar 15 |
olle |
1183 |
} |
3176 |
06 Mar 15 |
olle |
1184 |
|
3176 |
06 Mar 15 |
olle |
exreg.getSelectedItemsList = function() |
3176 |
06 Mar 15 |
olle |
1186 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3180 |
17 Mar 15 |
olle |
1188 |
|
3176 |
06 Mar 15 |
olle |
// Get number of selected extract source items |
3176 |
06 Mar 15 |
olle |
var numItems = 0; |
3176 |
06 Mar 15 |
olle |
var selItemsList = []; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < frm.extractSourceItems.length; i++) |
3176 |
06 Mar 15 |
olle |
1193 |
{ |
3176 |
06 Mar 15 |
olle |
if (frm.extractSourceItems[i].selected) |
3176 |
06 Mar 15 |
olle |
1195 |
{ |
3212 |
27 Mar 15 |
olle |
if (frm.extractSourceItems[i].item != null) |
3176 |
06 Mar 15 |
olle |
1197 |
{ |
3212 |
27 Mar 15 |
olle |
selItemsList[numItems] = frm.extractSourceItems[i].item; |
3176 |
06 Mar 15 |
olle |
numItems++; |
3176 |
06 Mar 15 |
olle |
1200 |
} |
3176 |
06 Mar 15 |
olle |
1201 |
} |
3176 |
06 Mar 15 |
olle |
1202 |
} |
3176 |
06 Mar 15 |
olle |
return selItemsList; |
3176 |
06 Mar 15 |
olle |
1204 |
} |
3176 |
06 Mar 15 |
olle |
1205 |
|
3176 |
06 Mar 15 |
olle |
exreg.getNumberOfSpecimenItems = function() |
3176 |
06 Mar 15 |
olle |
1207 |
{ |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var numSpecimen = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1213 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3176 |
06 Mar 15 |
olle |
1216 |
{ |
3176 |
06 Mar 15 |
olle |
numSpecimen++; |
3176 |
06 Mar 15 |
olle |
1218 |
} |
3176 |
06 Mar 15 |
olle |
1219 |
} |
3176 |
06 Mar 15 |
olle |
return numSpecimen; |
3176 |
06 Mar 15 |
olle |
1221 |
} |
3176 |
06 Mar 15 |
olle |
1222 |
|
3176 |
06 Mar 15 |
olle |
exreg.getNumberOfRnaItems = function() |
3176 |
06 Mar 15 |
olle |
1224 |
{ |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var numRna = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1230 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
1233 |
{ |
3176 |
06 Mar 15 |
olle |
numRna++; |
3176 |
06 Mar 15 |
olle |
1235 |
} |
3176 |
06 Mar 15 |
olle |
1236 |
} |
3176 |
06 Mar 15 |
olle |
return numRna; |
3176 |
06 Mar 15 |
olle |
1238 |
} |
3176 |
06 Mar 15 |
olle |
1239 |
|
3176 |
06 Mar 15 |
olle |
exreg.getNumberOfDnaItems = function() |
3176 |
06 Mar 15 |
olle |
1241 |
{ |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var numDna = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1247 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
1250 |
{ |
3176 |
06 Mar 15 |
olle |
numDna++; |
3176 |
06 Mar 15 |
olle |
1252 |
} |
3176 |
06 Mar 15 |
olle |
1253 |
} |
3176 |
06 Mar 15 |
olle |
return numDna; |
3176 |
06 Mar 15 |
olle |
1255 |
} |
3176 |
06 Mar 15 |
olle |
1256 |
|
3224 |
02 Apr 15 |
olle |
exreg.rnaConcOnChange = function(event) |
3224 |
02 Apr 15 |
olle |
1258 |
{ |
3224 |
02 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3224 |
02 Apr 15 |
olle |
// Get list of selected extract source items |
3224 |
02 Apr 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3224 |
02 Apr 15 |
olle |
var numItems = selItemsList.length; |
3224 |
02 Apr 15 |
olle |
// Update RNA concentration values |
3224 |
02 Apr 15 |
olle |
for (var i = 0; i < numItems; i++) |
3224 |
02 Apr 15 |
olle |
1265 |
{ |
3224 |
02 Apr 15 |
olle |
var item = selItemsList[i]; |
3224 |
02 Apr 15 |
olle |
var rnaConc = Doc.element('rnaConc'+i); |
3224 |
02 Apr 15 |
olle |
if (rnaConc != null) |
3224 |
02 Apr 15 |
olle |
1269 |
{ |
3224 |
02 Apr 15 |
olle |
if (rnaConc.value != null && rnaConc.value != '' && rnaConc.value != '-') |
3224 |
02 Apr 15 |
olle |
1271 |
{ |
3439 |
06 Jul 15 |
olle |
var conc = ExtractUtils.getNumber(rnaConc.value); |
3439 |
06 Jul 15 |
olle |
if (conc < 0) |
3439 |
06 Jul 15 |
olle |
1274 |
{ |
3439 |
06 Jul 15 |
olle |
conc = 0.0; |
3439 |
06 Jul 15 |
olle |
1276 |
} |
3439 |
06 Jul 15 |
olle |
item.rna.ndConc = conc; |
3224 |
02 Apr 15 |
olle |
1278 |
} |
3224 |
02 Apr 15 |
olle |
else |
3224 |
02 Apr 15 |
olle |
1280 |
{ |
3224 |
02 Apr 15 |
olle |
item.rna.ndConc = null; |
3224 |
02 Apr 15 |
olle |
1282 |
} |
3224 |
02 Apr 15 |
olle |
1283 |
} |
3224 |
02 Apr 15 |
olle |
1284 |
} |
3224 |
02 Apr 15 |
olle |
exreg.updateDetailsTable(); |
3224 |
02 Apr 15 |
olle |
1286 |
} |
3224 |
02 Apr 15 |
olle |
1287 |
|
3176 |
06 Mar 15 |
olle |
exreg.dnaConcOnChange = function(event) |
3176 |
06 Mar 15 |
olle |
1289 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
// Update DNA concentration values |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1296 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3176 |
06 Mar 15 |
olle |
var dnaConc = Doc.element('dnaConc'+i); |
3176 |
06 Mar 15 |
olle |
if (dnaConc != null) |
3176 |
06 Mar 15 |
olle |
1300 |
{ |
3176 |
06 Mar 15 |
olle |
if (dnaConc.value != null && dnaConc.value != '' && dnaConc.value != '-') |
3176 |
06 Mar 15 |
olle |
1302 |
{ |
3439 |
06 Jul 15 |
olle |
var conc = ExtractUtils.getNumber(dnaConc.value); |
3439 |
06 Jul 15 |
olle |
if (conc < 0) |
3439 |
06 Jul 15 |
olle |
1305 |
{ |
3439 |
06 Jul 15 |
olle |
conc = 0.0; |
3439 |
06 Jul 15 |
olle |
1307 |
} |
3439 |
06 Jul 15 |
olle |
item.dna.qubitConc = conc; |
3176 |
06 Mar 15 |
olle |
1309 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1311 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = null; |
3176 |
06 Mar 15 |
olle |
1313 |
} |
3176 |
06 Mar 15 |
olle |
1314 |
} |
3176 |
06 Mar 15 |
olle |
1315 |
} |
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
1317 |
} |
3176 |
06 Mar 15 |
olle |
1318 |
|
3224 |
02 Apr 15 |
olle |
exreg.deltaCtOnChange = function(event) |
3224 |
02 Apr 15 |
olle |
1320 |
{ |
3224 |
02 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3224 |
02 Apr 15 |
olle |
// Get list of selected extract source items |
3224 |
02 Apr 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3224 |
02 Apr 15 |
olle |
var numItems = selItemsList.length; |
3224 |
02 Apr 15 |
olle |
// Update DNA deltaCt values |
3224 |
02 Apr 15 |
olle |
for (var i = 0; i < numItems; i++) |
3224 |
02 Apr 15 |
olle |
1327 |
{ |
3224 |
02 Apr 15 |
olle |
var item = selItemsList[i]; |
3224 |
02 Apr 15 |
olle |
var deltaCt = Doc.element('deltaCt'+i); |
3224 |
02 Apr 15 |
olle |
if (deltaCt != null) |
3224 |
02 Apr 15 |
olle |
1331 |
{ |
3224 |
02 Apr 15 |
olle |
if (deltaCt.value != null && deltaCt.value != '' && deltaCt.value != '-') |
3224 |
02 Apr 15 |
olle |
1333 |
{ |
3352 |
26 May 15 |
olle |
item.dna.deltaCt = ExtractUtils.getNumber(deltaCt.value); |
3224 |
02 Apr 15 |
olle |
1335 |
} |
3224 |
02 Apr 15 |
olle |
else |
3224 |
02 Apr 15 |
olle |
1337 |
{ |
3224 |
02 Apr 15 |
olle |
item.dna.deltaCt = null; |
3224 |
02 Apr 15 |
olle |
1339 |
} |
3224 |
02 Apr 15 |
olle |
1340 |
} |
3224 |
02 Apr 15 |
olle |
1341 |
} |
3224 |
02 Apr 15 |
olle |
exreg.updateDetailsTable(); |
3224 |
02 Apr 15 |
olle |
1343 |
} |
3224 |
02 Apr 15 |
olle |
1344 |
|
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable = function() |
3176 |
06 Mar 15 |
olle |
1346 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3352 |
26 May 15 |
olle |
var rnaDefaultVolume = ExtractUtils.getNumber(frm.rnaDefaultVolume.value); |
3352 |
26 May 15 |
olle |
var dnaDefaultVolume = ExtractUtils.getNumber(frm.dnaDefaultVolume.value); |
3176 |
06 Mar 15 |
olle |
var hasQiacubePosition = []; |
3176 |
06 Mar 15 |
olle |
var duplicatePosition = 0; |
3176 |
06 Mar 15 |
olle |
1352 |
|
3354 |
27 May 15 |
olle |
qiacubeSortedPrefixes = exreg.getQiacubeSortedPrefixes(); |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3432 |
29 Jun 15 |
olle |
var totNumItems = numItems; |
3176 |
06 Mar 15 |
olle |
// Get sorted list of used integer QIAcube positions for specimens, generalized for more than one QIAcube |
3176 |
06 Mar 15 |
olle |
var specSortedIntQiacubePosition = []; |
3180 |
17 Mar 15 |
olle |
var qiacubeItemNo = 0; |
3180 |
17 Mar 15 |
olle |
for (var i = 0; i < totNumItems; i++) |
3176 |
06 Mar 15 |
olle |
1362 |
{ |
3432 |
29 Jun 15 |
olle |
var item = selItemsList[i]; |
3432 |
29 Jun 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3176 |
06 Mar 15 |
olle |
1365 |
{ |
3354 |
27 May 15 |
olle |
var intQiacubePosition = ExtractUtils.getIntQiacubePosition(item.qiacubePosition, qiacubeSortedPrefixes); |
3180 |
17 Mar 15 |
olle |
specSortedIntQiacubePosition[qiacubeItemNo] = intQiacubePosition; |
3180 |
17 Mar 15 |
olle |
qiacubeItemNo++; |
3176 |
06 Mar 15 |
olle |
1369 |
} |
3176 |
06 Mar 15 |
olle |
1370 |
} |
3176 |
06 Mar 15 |
olle |
// Sort for ascending integer values |
3176 |
06 Mar 15 |
olle |
specSortedIntQiacubePosition.sort(function(a,b){return a-b}); |
3176 |
06 Mar 15 |
olle |
var numSpecimenItems = exreg.getNumberOfSpecimenItems(); |
3176 |
06 Mar 15 |
olle |
var numRnaItems = exreg.getNumberOfRnaItems(); |
3176 |
06 Mar 15 |
olle |
var numDnaItems = exreg.getNumberOfDnaItems(); |
3176 |
06 Mar 15 |
olle |
var numNanoDropItems = numSpecimenItems + numRnaItems; |
3176 |
06 Mar 15 |
olle |
var rnaItemNo = 0; |
3176 |
06 Mar 15 |
olle |
// Set default values for DNA/RNA extraction |
3180 |
17 Mar 15 |
olle |
for (var i = 0; i < totNumItems; i++) |
3176 |
06 Mar 15 |
olle |
1380 |
{ |
3180 |
17 Mar 15 |
olle |
var item = null; |
3180 |
17 Mar 15 |
olle |
if (i < numItems) |
3180 |
17 Mar 15 |
olle |
1383 |
{ |
3180 |
17 Mar 15 |
olle |
item = selItemsList[i]; |
3180 |
17 Mar 15 |
olle |
1385 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
1387 |
{ |
3180 |
17 Mar 15 |
olle |
// Extra QIAcube item |
3180 |
17 Mar 15 |
olle |
item = extraItemsList[i - numItems]; |
3180 |
17 Mar 15 |
olle |
1390 |
} |
3176 |
06 Mar 15 |
olle |
Doc.element('qiacubePosition'+i).innerHTML = item.qiacubePosition; |
3176 |
06 Mar 15 |
olle |
Doc.addOrRemoveClass('qiacubePosition'+i, 'nondefault', item.qiacubePosition != item.originalQiacubePosition); |
3176 |
06 Mar 15 |
olle |
1393 |
|
3354 |
27 May 15 |
olle |
var intQiacubePosition = ExtractUtils.getIntQiacubePosition(item.qiacubePosition, qiacubeSortedPrefixes); |
3176 |
06 Mar 15 |
olle |
if (intQiacubePosition != null) |
3176 |
06 Mar 15 |
olle |
1396 |
{ |
3176 |
06 Mar 15 |
olle |
if (hasQiacubePosition[intQiacubePosition]) |
3176 |
06 Mar 15 |
olle |
1398 |
{ |
3176 |
06 Mar 15 |
olle |
duplicatePosition = intQiacubePosition; |
3176 |
06 Mar 15 |
olle |
1400 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1402 |
{ |
3176 |
06 Mar 15 |
olle |
hasQiacubePosition[intQiacubePosition] = true; |
3176 |
06 Mar 15 |
olle |
1404 |
} |
3176 |
06 Mar 15 |
olle |
1405 |
} |
3176 |
06 Mar 15 |
olle |
var intNanoDropPlatePosition = intQiacubePosition; |
3176 |
06 Mar 15 |
olle |
// Get integer NanoDrop position for specimens from index in sorted list of used integer QIAcube positions |
3176 |
06 Mar 15 |
olle |
if (intQiacubePosition) |
3176 |
06 Mar 15 |
olle |
1409 |
{ |
3176 |
06 Mar 15 |
olle |
var sortIndex = -1; |
3176 |
06 Mar 15 |
olle |
for (var j = 0; j < specSortedIntQiacubePosition.length; j++) |
3176 |
06 Mar 15 |
olle |
1412 |
{ |
3176 |
06 Mar 15 |
olle |
if (intQiacubePosition == specSortedIntQiacubePosition[j]) |
3176 |
06 Mar 15 |
olle |
1414 |
{ |
3176 |
06 Mar 15 |
olle |
sortIndex = j; |
3176 |
06 Mar 15 |
olle |
1416 |
} |
3176 |
06 Mar 15 |
olle |
1417 |
} |
3176 |
06 Mar 15 |
olle |
if (sortIndex > -1) |
3176 |
06 Mar 15 |
olle |
1419 |
{ |
3176 |
06 Mar 15 |
olle |
intNanoDropPlatePosition = sortIndex + 1; |
3176 |
06 Mar 15 |
olle |
1421 |
} |
3176 |
06 Mar 15 |
olle |
1422 |
} |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
1424 |
{ |
3176 |
06 Mar 15 |
olle |
rnaItemNo++; |
3176 |
06 Mar 15 |
olle |
intNanoDropPlatePosition = numSpecimenItems + rnaItemNo; |
3176 |
06 Mar 15 |
olle |
1427 |
} |
3176 |
06 Mar 15 |
olle |
1428 |
|
3176 |
06 Mar 15 |
olle |
// Calculate NanoDrop well from Qiacube position |
3176 |
06 Mar 15 |
olle |
var row; |
3176 |
06 Mar 15 |
olle |
var col; |
3176 |
06 Mar 15 |
olle |
// Specimens from up to two QIAcube instruments and input RNA items placed on one NanoDrop plate |
3176 |
06 Mar 15 |
olle |
if (intNanoDropPlatePosition > 16) |
3176 |
06 Mar 15 |
olle |
1434 |
{ |
3176 |
06 Mar 15 |
olle |
// (17 - 24) NanoDrop plate for QIAcube 'A', positions A3 - H3 |
3176 |
06 Mar 15 |
olle |
row = intNanoDropPlatePosition - 17; |
3176 |
06 Mar 15 |
olle |
col = 3; |
3176 |
06 Mar 15 |
olle |
1438 |
} |
3176 |
06 Mar 15 |
olle |
else if (intNanoDropPlatePosition > 8) |
3176 |
06 Mar 15 |
olle |
1440 |
{ |
3176 |
06 Mar 15 |
olle |
// ( 9 - 12) NanoDrop plate for QIAcube 'C', positions A2 - D2 |
3176 |
06 Mar 15 |
olle |
// (13 - 16) NanoDrop plate for QIAcube 'A', positions E2 - H2 |
3176 |
06 Mar 15 |
olle |
row = intNanoDropPlatePosition - 9; |
3176 |
06 Mar 15 |
olle |
col = 2; |
3176 |
06 Mar 15 |
olle |
1445 |
} |
3176 |
06 Mar 15 |
olle |
else if (intNanoDropPlatePosition > 0) |
3176 |
06 Mar 15 |
olle |
1447 |
{ |
3176 |
06 Mar 15 |
olle |
// ( 1 - 8) NanoDrop plate for QIAcube 'C', positions A1 - H1 |
3176 |
06 Mar 15 |
olle |
row = intNanoDropPlatePosition - 1; |
3176 |
06 Mar 15 |
olle |
col = 1; |
3176 |
06 Mar 15 |
olle |
1451 |
} |
3180 |
17 Mar 15 |
olle |
if (i < numItems) |
3176 |
06 Mar 15 |
olle |
1453 |
{ |
3268 |
23 Apr 15 |
olle |
1454 |
|
3352 |
26 May 15 |
olle |
if (!ExtractUtils.isDna(item)) |
3180 |
17 Mar 15 |
olle |
1456 |
{ |
3176 |
06 Mar 15 |
olle |
1457 |
/* |
3180 |
17 Mar 15 |
olle |
item.dna.well = Meludi.wellToAlpha(row) + (col+3); |
3176 |
06 Mar 15 |
olle |
1459 |
*/ |
3276 |
29 Apr 15 |
olle |
//item.rna.well = Meludi.wellToAlpha(row) + col; |
3276 |
29 Apr 15 |
olle |
item.rna.nanoDropWell = Meludi.wellToAlpha(row) + col; |
3180 |
17 Mar 15 |
olle |
1462 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
1464 |
{ |
3276 |
29 Apr 15 |
olle |
//item.dna.well = null; |
3276 |
29 Apr 15 |
olle |
item.rna.nanoDropWell = null; |
3180 |
17 Mar 15 |
olle |
1467 |
} |
3176 |
06 Mar 15 |
olle |
1468 |
|
3312 |
07 May 15 |
olle |
// Update concentration and deltaCt data for input DNA/RNA |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isRna(item)) |
3312 |
07 May 15 |
olle |
1471 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.rna.ndConc == null) |
3312 |
07 May 15 |
olle |
1473 |
{ |
3312 |
07 May 15 |
olle |
item.rna.ndConc = item.ndConc; |
3312 |
07 May 15 |
olle |
1475 |
} |
3312 |
07 May 15 |
olle |
1476 |
} |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isDna(item)) |
3312 |
07 May 15 |
olle |
1478 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.dna.qubitConc == null) |
3312 |
07 May 15 |
olle |
1480 |
{ |
3312 |
07 May 15 |
olle |
item.dna.qubitConc = item.qubitConc; |
3312 |
07 May 15 |
olle |
1482 |
} |
3720 |
22 Jan 16 |
olle |
if (item.dna.deltaCt == null) |
3312 |
07 May 15 |
olle |
1484 |
{ |
3312 |
07 May 15 |
olle |
item.dna.deltaCt = item.deltaCt; |
3312 |
07 May 15 |
olle |
1486 |
} |
3312 |
07 May 15 |
olle |
1487 |
} |
3312 |
07 May 15 |
olle |
1488 |
|
3180 |
17 Mar 15 |
olle |
Doc.element('dnaVol'+i).innerHTML = item.dna.volume; |
3180 |
17 Mar 15 |
olle |
Doc.addOrRemoveClass('dnaVol'+i, 'nondefault', item.dna.volume != dnaDefaultVolume); |
3180 |
17 Mar 15 |
olle |
var dnaConc = Doc.element('dnaConc'+i); |
3180 |
17 Mar 15 |
olle |
if (dnaConc != null) |
3176 |
06 Mar 15 |
olle |
1493 |
{ |
3224 |
02 Apr 15 |
olle |
dnaConc.value = Meludi.formatNumber(item.dna.qubitConc) || ''; |
3224 |
02 Apr 15 |
olle |
dnaConc.title = '260/280=' + item.dna.nd260by280 + '\n260/230=' + item.dna.nd260by230; |
3180 |
17 Mar 15 |
olle |
var dnaConcValue = dnaConc.value; |
3180 |
17 Mar 15 |
olle |
if (dnaConcValue != null && dnaConcValue != '-' && dnaConcValue != '') |
3180 |
17 Mar 15 |
olle |
1498 |
{ |
3352 |
26 May 15 |
olle |
item.dna.qubitConc = ExtractUtils.getNumber(dnaConcValue); |
3180 |
17 Mar 15 |
olle |
1500 |
} |
3176 |
06 Mar 15 |
olle |
1501 |
} |
3180 |
17 Mar 15 |
olle |
item.dna.quantity = item.dna.qubitConc * item.dna.volume / 1000; |
3180 |
17 Mar 15 |
olle |
Doc.element('dnaQuantity'+i).innerHTML = Meludi.formatNumber(item.dna.quantity || null, null, 2) || '-'; |
3176 |
06 Mar 15 |
olle |
1504 |
|
3180 |
17 Mar 15 |
olle |
var deltaCt = Doc.element('deltaCt'+i); |
3180 |
17 Mar 15 |
olle |
if (deltaCt != null) |
3176 |
06 Mar 15 |
olle |
1507 |
{ |
3224 |
02 Apr 15 |
olle |
deltaCt.value = Meludi.formatNumber(item.dna.deltaCt) || ''; |
3180 |
17 Mar 15 |
olle |
var deltaCtValue = deltaCt.value; |
3180 |
17 Mar 15 |
olle |
if (deltaCtValue != null && deltaCtValue != '-' && deltaCtValue != '') |
3180 |
17 Mar 15 |
olle |
1511 |
{ |
3352 |
26 May 15 |
olle |
item.dna.deltaCt = ExtractUtils.getNumber(deltaCtValue); |
3180 |
17 Mar 15 |
olle |
1513 |
} |
3180 |
17 Mar 15 |
olle |
deltaCt.innerHTML = Meludi.formatNumber(item.dna.deltaCt) || '-'; |
3176 |
06 Mar 15 |
olle |
1515 |
} |
3176 |
06 Mar 15 |
olle |
1516 |
|
3276 |
29 Apr 15 |
olle |
//Doc.element('rnaPos'+i).innerHTML = item.rna.well; |
3276 |
29 Apr 15 |
olle |
Doc.element('rnaPos'+i).innerHTML = item.rna.nanoDropWell; |
3180 |
17 Mar 15 |
olle |
Doc.addOrRemoveClass('rnaPos'+i, 'nondefault', item.qiacubePosition != item.originalQiacubePosition); |
3224 |
02 Apr 15 |
olle |
1520 |
|
3180 |
17 Mar 15 |
olle |
Doc.element('rnaVol'+i).innerHTML = item.rna.volume; |
3180 |
17 Mar 15 |
olle |
Doc.addOrRemoveClass('rnaVol'+i, 'nondefault', item.rna.volume != rnaDefaultVolume); |
3180 |
17 Mar 15 |
olle |
var rnaConc = Doc.element('rnaConc'+i); |
3224 |
02 Apr 15 |
olle |
if (rnaConc != null) |
3224 |
02 Apr 15 |
olle |
1525 |
{ |
3224 |
02 Apr 15 |
olle |
rnaConc.value = Meludi.formatNumber(item.rna.ndConc) || ''; |
3224 |
02 Apr 15 |
olle |
rnaConc.title = '260/280=' + item.rna.nd260by280 + '\n260/230=' + item.rna.nd260by230; |
3224 |
02 Apr 15 |
olle |
var rnaConcValue = rnaConc.value; |
3224 |
02 Apr 15 |
olle |
if (rnaConcValue != null && rnaConcValue != '-' && rnaConcValue != '') |
3224 |
02 Apr 15 |
olle |
1530 |
{ |
3352 |
26 May 15 |
olle |
item.rna.ndConc = ExtractUtils.getNumber(rnaConcValue); |
3224 |
02 Apr 15 |
olle |
1532 |
} |
3224 |
02 Apr 15 |
olle |
1533 |
} |
3180 |
17 Mar 15 |
olle |
item.rna.quantity = item.rna.ndConc * item.rna.volume / 1000; |
3224 |
02 Apr 15 |
olle |
Doc.element('rnaQuantity'+i).innerHTML = Meludi.formatNumber(item.rna.quantity || null, null, 2) || '-'; |
3224 |
02 Apr 15 |
olle |
1536 |
|
3180 |
17 Mar 15 |
olle |
var enoughQuantity = item.rna.quantity >= MINIMAL_PRE_NORMALIZE_QUANTITY; |
3180 |
17 Mar 15 |
olle |
item.rna.flag = enoughQuantity ? null : 'NotEnoughRemainingQuantity'; |
3176 |
06 Mar 15 |
olle |
1539 |
|
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3180 |
17 Mar 15 |
olle |
1541 |
{ |
3177 |
09 Mar 15 |
olle |
1542 |
/* |
3180 |
17 Mar 15 |
olle |
frm['rnaPreNormalize'+i].disabled = !enoughQuantity; |
3177 |
09 Mar 15 |
olle |
1544 |
*/ |
3180 |
17 Mar 15 |
olle |
Doc.element('rnaQuantity'+i).innerHTML = Meludi.formatNumber(item.rna.quantity || null, null, 2) || '-'; |
3177 |
09 Mar 15 |
olle |
1546 |
/* |
3180 |
17 Mar 15 |
olle |
frm['rnaPreNormalize'+i].checked = enoughQuantity; |
3180 |
17 Mar 15 |
olle |
var warning = item.rna.quantity && !enoughQuantity; |
3180 |
17 Mar 15 |
olle |
Wizard.setInputStatus('rnaPreNormalize'+i, warning ? 'flag' : '', warning ? 'Not enough quantity' : ''); |
3177 |
09 Mar 15 |
olle |
1550 |
*/ |
3180 |
17 Mar 15 |
olle |
1551 |
} |
3176 |
06 Mar 15 |
olle |
1552 |
|
3180 |
17 Mar 15 |
olle |
var cmnt = Doc.element('comments'+i); |
3180 |
17 Mar 15 |
olle |
var tooltip = []; |
3180 |
17 Mar 15 |
olle |
var comment = []; |
3311 |
07 May 15 |
olle |
// Update comment data with description data |
3311 |
07 May 15 |
olle |
if (item.description || item.dna.description || item.rna.description) |
3311 |
07 May 15 |
olle |
1558 |
{ |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3311 |
07 May 15 |
olle |
1560 |
{ |
3311 |
07 May 15 |
olle |
if (item.description) |
3311 |
07 May 15 |
olle |
1562 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.comment == null) |
3311 |
07 May 15 |
olle |
1564 |
{ |
3311 |
07 May 15 |
olle |
item.comment = item.description; |
3311 |
07 May 15 |
olle |
1566 |
} |
3311 |
07 May 15 |
olle |
1567 |
} |
3311 |
07 May 15 |
olle |
if (item.rna.description) |
3311 |
07 May 15 |
olle |
1569 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.rna.comment == null) |
3311 |
07 May 15 |
olle |
1571 |
{ |
3311 |
07 May 15 |
olle |
item.rna.comment = item.rna.description; |
3311 |
07 May 15 |
olle |
1573 |
} |
3311 |
07 May 15 |
olle |
1574 |
} |
3311 |
07 May 15 |
olle |
if (item.dna.description) |
3311 |
07 May 15 |
olle |
1576 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.dna.comment == null) |
3311 |
07 May 15 |
olle |
1578 |
{ |
3311 |
07 May 15 |
olle |
item.dna.comment = item.dna.description; |
3311 |
07 May 15 |
olle |
1580 |
} |
3311 |
07 May 15 |
olle |
1581 |
} |
3311 |
07 May 15 |
olle |
1582 |
} |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isRna(item)) |
3311 |
07 May 15 |
olle |
1584 |
{ |
3311 |
07 May 15 |
olle |
if (item.description) |
3311 |
07 May 15 |
olle |
1586 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.rna.comment == null) |
3311 |
07 May 15 |
olle |
1588 |
{ |
3311 |
07 May 15 |
olle |
item.rna.comment = item.description; |
3311 |
07 May 15 |
olle |
1590 |
} |
3311 |
07 May 15 |
olle |
1591 |
} |
3311 |
07 May 15 |
olle |
if (item.rna.description) |
3311 |
07 May 15 |
olle |
1593 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.rna.comment == null) |
3311 |
07 May 15 |
olle |
1595 |
{ |
3311 |
07 May 15 |
olle |
item.rna.comment = item.rna.description; |
3311 |
07 May 15 |
olle |
1597 |
} |
3311 |
07 May 15 |
olle |
1598 |
} |
3311 |
07 May 15 |
olle |
1599 |
} |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isDna(item)) |
3311 |
07 May 15 |
olle |
1601 |
{ |
3311 |
07 May 15 |
olle |
if (item.description) |
3311 |
07 May 15 |
olle |
1603 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.dna.comment == null) |
3311 |
07 May 15 |
olle |
1605 |
{ |
3311 |
07 May 15 |
olle |
item.dna.comment = item.description; |
3311 |
07 May 15 |
olle |
1607 |
} |
3311 |
07 May 15 |
olle |
1608 |
} |
3311 |
07 May 15 |
olle |
if (item.dna.description) |
3311 |
07 May 15 |
olle |
1610 |
{ |
3720 |
22 Jan 16 |
olle |
if (item.dna.comment == null) |
3311 |
07 May 15 |
olle |
1612 |
{ |
3311 |
07 May 15 |
olle |
item.dna.comment = item.dna.description; |
3311 |
07 May 15 |
olle |
1614 |
} |
3311 |
07 May 15 |
olle |
1615 |
} |
3311 |
07 May 15 |
olle |
1616 |
} |
3311 |
07 May 15 |
olle |
1617 |
} |
3246 |
14 Apr 15 |
olle |
if (item.operatorDeliveryComment || item.comment || item.dna.comment || item.rna.comment) |
3180 |
17 Mar 15 |
olle |
1619 |
{ |
3246 |
14 Apr 15 |
olle |
// Display operator delivery comments directly in the comment field |
3246 |
14 Apr 15 |
olle |
if (item.operatorDeliveryComment) |
3246 |
14 Apr 15 |
olle |
1622 |
{ |
3246 |
14 Apr 15 |
olle |
comment[0] = item.operatorDeliveryComment; |
3246 |
14 Apr 15 |
olle |
tooltip[tooltip.length] = 'Op.Del.Cmt: ' + item.operatorDeliveryComment; |
3246 |
14 Apr 15 |
olle |
1625 |
} |
3246 |
14 Apr 15 |
olle |
else |
3246 |
14 Apr 15 |
olle |
1627 |
{ |
3246 |
14 Apr 15 |
olle |
comment[0] = 'Yes'; |
3246 |
14 Apr 15 |
olle |
1629 |
} |
3180 |
17 Mar 15 |
olle |
if (item.comment) tooltip[tooltip.length] = 'Specimen: ' + item.comment; |
3180 |
17 Mar 15 |
olle |
if (item.rna.comment) tooltip[tooltip.length] = 'RNA: ' + item.rna.comment; |
3180 |
17 Mar 15 |
olle |
if (item.dna.comment) tooltip[tooltip.length] = 'DNA: ' + item.dna.comment; |
3180 |
17 Mar 15 |
olle |
1633 |
} |
3176 |
06 Mar 15 |
olle |
1634 |
|
3180 |
17 Mar 15 |
olle |
var modifiedReagents = false; |
3180 |
17 Mar 15 |
olle |
for (var rgNo = 0; rgNo < exreg.REAGENTS.length; rgNo++) |
3176 |
06 Mar 15 |
olle |
1637 |
{ |
3180 |
17 Mar 15 |
olle |
var rg = exreg.REAGENTS[rgNo]; |
3180 |
17 Mar 15 |
olle |
if (item[rg]) |
3180 |
17 Mar 15 |
olle |
1640 |
{ |
3180 |
17 Mar 15 |
olle |
tooltip[tooltip.length] = Doc.element(rg+'.title').innerHTML + ': ' + Strings.encodeTags(item[rg]); |
3180 |
17 Mar 15 |
olle |
modifiedReagents = true; |
3180 |
17 Mar 15 |
olle |
1643 |
} |
3176 |
06 Mar 15 |
olle |
1644 |
} |
3180 |
17 Mar 15 |
olle |
if (modifiedReagents) |
3180 |
17 Mar 15 |
olle |
1646 |
{ |
3180 |
17 Mar 15 |
olle |
comment[comment.length] = 'Reagents'; |
3180 |
17 Mar 15 |
olle |
1648 |
} |
3176 |
06 Mar 15 |
olle |
1649 |
|
3180 |
17 Mar 15 |
olle |
if (tooltip.length > 0) |
3180 |
17 Mar 15 |
olle |
1651 |
{ |
3180 |
17 Mar 15 |
olle |
cmnt.innerHTML = comment.join(', '); |
3180 |
17 Mar 15 |
olle |
Doc.addClass(cmnt, 'nondefault'); |
3180 |
17 Mar 15 |
olle |
cmnt.title = tooltip.join('\n'); |
3180 |
17 Mar 15 |
olle |
1655 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
1657 |
{ |
3180 |
17 Mar 15 |
olle |
cmnt.innerHTML = ''; |
3180 |
17 Mar 15 |
olle |
Doc.removeClass(cmnt, 'nondefault'); |
3180 |
17 Mar 15 |
olle |
cmnt.title = null; |
3180 |
17 Mar 15 |
olle |
1661 |
} |
3176 |
06 Mar 15 |
olle |
1662 |
} |
3176 |
06 Mar 15 |
olle |
1663 |
} |
3176 |
06 Mar 15 |
olle |
1664 |
|
3176 |
06 Mar 15 |
olle |
if (duplicatePosition) |
3176 |
06 Mar 15 |
olle |
1666 |
{ |
3354 |
27 May 15 |
olle |
var duplicatePositionStr = ExtractUtils.getDetailedQiacubePosition(duplicatePosition, qiacubeSortedPrefixes); |
3176 |
06 Mar 15 |
olle |
qiacubePositionsAreValid = false; |
3176 |
06 Mar 15 |
olle |
1669 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1671 |
{ |
3176 |
06 Mar 15 |
olle |
qiacubePositionsAreValid = true; |
3176 |
06 Mar 15 |
olle |
1673 |
} |
3176 |
06 Mar 15 |
olle |
1674 |
} |
3176 |
06 Mar 15 |
olle |
1675 |
|
3176 |
06 Mar 15 |
olle |
exreg.editDnaRnaDetails = function(event) |
3176 |
06 Mar 15 |
olle |
1677 |
{ |
3176 |
06 Mar 15 |
olle |
var index = Data.get(event.currentTarget, 'index'); |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3180 |
17 Mar 15 |
olle |
var numItems = selItemsList.length; |
3180 |
17 Mar 15 |
olle |
var item = null; |
3180 |
17 Mar 15 |
olle |
if (index < numItems) |
3180 |
17 Mar 15 |
olle |
1685 |
{ |
3180 |
17 Mar 15 |
olle |
item = selItemsList[index]; |
3180 |
17 Mar 15 |
olle |
1687 |
} |
3180 |
17 Mar 15 |
olle |
else |
3180 |
17 Mar 15 |
olle |
1689 |
{ |
3180 |
17 Mar 15 |
olle |
// Extra QIAcube item |
3180 |
17 Mar 15 |
olle |
item = extraItemsList[index - numItems]; |
3180 |
17 Mar 15 |
olle |
1692 |
} |
3176 |
06 Mar 15 |
olle |
var url = 'edit_dnarna_details.jsp?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
url += '&index='+index; |
3176 |
06 Mar 15 |
olle |
url += '&mode=' + 'ExtractionReg'; |
3176 |
06 Mar 15 |
olle |
url += '&specimen=' + item.name; |
3176 |
06 Mar 15 |
olle |
Dialogs.openPopup(url, 'EditDnaRnaDetails'+index, 750, 500); |
3176 |
06 Mar 15 |
olle |
1698 |
} |
3176 |
06 Mar 15 |
olle |
1699 |
|
3176 |
06 Mar 15 |
olle |
exreg.nanoDropFileOnChange = function() |
3176 |
06 Mar 15 |
olle |
1701 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var file = frm.nanoDropFile.files[0]; |
3176 |
06 Mar 15 |
olle |
1704 |
|
3176 |
06 Mar 15 |
olle |
var reader = new FileReader(); |
3176 |
06 Mar 15 |
olle |
reader.onload = exreg.nanoDropFileLoaded; |
3176 |
06 Mar 15 |
olle |
reader.readAsText(file); |
3176 |
06 Mar 15 |
olle |
1708 |
} |
3176 |
06 Mar 15 |
olle |
1709 |
|
3176 |
06 Mar 15 |
olle |
exreg.nanoDropFileLoaded = function(event) |
3176 |
06 Mar 15 |
olle |
1711 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.parseNanoDropFile(event.target.result); |
3176 |
06 Mar 15 |
olle |
1713 |
} |
3176 |
06 Mar 15 |
olle |
1714 |
|
3176 |
06 Mar 15 |
olle |
1715 |
|
3176 |
06 Mar 15 |
olle |
exreg.parseNanoDropFile = function(data) |
3176 |
06 Mar 15 |
olle |
1717 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
nanoDropFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
1720 |
|
3176 |
06 Mar 15 |
olle |
var numSpecimens = 0; |
3176 |
06 Mar 15 |
olle |
try |
3176 |
06 Mar 15 |
olle |
1723 |
{ |
3176 |
06 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
1725 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var numNanoDropItems = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1731 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
1734 |
{ |
3176 |
06 Mar 15 |
olle |
item.rna.ndConc = null; |
3176 |
06 Mar 15 |
olle |
item.rna.nd260by280 = null; |
3176 |
06 Mar 15 |
olle |
item.rna.nd260by230 = null; |
3176 |
06 Mar 15 |
olle |
numNanoDropItems++; |
3176 |
06 Mar 15 |
olle |
1739 |
} |
3176 |
06 Mar 15 |
olle |
1740 |
} |
3176 |
06 Mar 15 |
olle |
1741 |
|
3176 |
06 Mar 15 |
olle |
var lines = data.split(/[\n\r]+/); |
3176 |
06 Mar 15 |
olle |
var columns = lines[0].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
1744 |
|
3176 |
06 Mar 15 |
olle |
var sampleIndex = exreg.findColumn(columns, 'Sample ID'); |
3176 |
06 Mar 15 |
olle |
if (sampleIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1747 |
|
3176 |
06 Mar 15 |
olle |
var wellIndex = exreg.findColumn(columns, 'Well'); |
3176 |
06 Mar 15 |
olle |
if (wellIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1750 |
|
3176 |
06 Mar 15 |
olle |
var ndConcIndex = exreg.findColumn(columns, 'Conc.'); |
3176 |
06 Mar 15 |
olle |
if (ndConcIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1753 |
|
3176 |
06 Mar 15 |
olle |
var nd260by280Index = exreg.findColumn(columns, '260/280'); |
3176 |
06 Mar 15 |
olle |
if (nd260by280Index == -1) return; |
3176 |
06 Mar 15 |
olle |
1756 |
|
3176 |
06 Mar 15 |
olle |
var nd260by230Index = exreg.findColumn(columns, '260/230'); |
3176 |
06 Mar 15 |
olle |
if (nd260by230Index == -1) return; |
3176 |
06 Mar 15 |
olle |
1759 |
|
3176 |
06 Mar 15 |
olle |
var numImported = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 1; i < lines.length; i++) |
3176 |
06 Mar 15 |
olle |
1762 |
{ |
3176 |
06 Mar 15 |
olle |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
3176 |
06 Mar 15 |
olle |
1764 |
|
3176 |
06 Mar 15 |
olle |
var row = lines[i].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
if (row.length != columns.length) |
3176 |
06 Mar 15 |
olle |
1767 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1770 |
} |
3227 |
07 Apr 15 |
olle |
1771 |
|
3176 |
06 Mar 15 |
olle |
var sampleId = row[sampleIndex]; |
3176 |
06 Mar 15 |
olle |
if (!sampleId || sampleId == 'blank') continue; // with the next line |
3176 |
06 Mar 15 |
olle |
1774 |
|
3227 |
07 Apr 15 |
olle |
var rnaOrDna = exreg.findRnaOrDna(sampleId, i+1, 'nanoDropFile'); |
3176 |
06 Mar 15 |
olle |
if (!rnaOrDna) return; // This is an error condition |
3176 |
06 Mar 15 |
olle |
1777 |
|
3335 |
13 May 15 |
olle |
if (rnaOrDna.nanoDropWell != row[wellIndex]) |
3176 |
06 Mar 15 |
olle |
1779 |
{ |
3335 |
13 May 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; Expected to find "' + sampleId + '" in well [' + rnaOrDna.nanoDropWell + '] not [' + row[wellIndex] + ']'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1782 |
} |
3176 |
06 Mar 15 |
olle |
1783 |
|
3352 |
26 May 15 |
olle |
var ndConc = ExtractUtils.getNumber(row[ndConcIndex]); |
3176 |
06 Mar 15 |
olle |
if (isNaN(ndConc)) |
3176 |
06 Mar 15 |
olle |
1786 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid NDConc value for "' + sampleId + '": ' + row[ndConcIndex]); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1789 |
} |
3176 |
06 Mar 15 |
olle |
1790 |
|
3176 |
06 Mar 15 |
olle |
// If there are multiple entries for the same item, keep the largest NDConc |
3176 |
06 Mar 15 |
olle |
var isFirstValue = rnaOrDna.ndConc == null; |
3176 |
06 Mar 15 |
olle |
if (isFirstValue || ndConc > rnaOrDna.ndConc) |
3176 |
06 Mar 15 |
olle |
1794 |
{ |
3352 |
26 May 15 |
olle |
var nd260by280 = ExtractUtils.getNumber(row[nd260by280Index]); |
3176 |
06 Mar 15 |
olle |
if (isNaN(nd260by280)) |
3176 |
06 Mar 15 |
olle |
1797 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid 260/280 value for "' + sampleId + '": ' + row[nd260by280Index]); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1800 |
} |
3176 |
06 Mar 15 |
olle |
1801 |
|
3352 |
26 May 15 |
olle |
var nd260by230 = ExtractUtils.getNumber(row[nd260by230Index]); |
3176 |
06 Mar 15 |
olle |
if (isNaN(nd260by230)) |
3176 |
06 Mar 15 |
olle |
1804 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line ' + (i+1) + '; No valid 260/230 value for "' + sampleId + '": '+row[nd260by230Index]); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1807 |
} |
3176 |
06 Mar 15 |
olle |
1808 |
|
3176 |
06 Mar 15 |
olle |
// Store values |
3176 |
06 Mar 15 |
olle |
rnaOrDna.ndConc = ndConc; |
3176 |
06 Mar 15 |
olle |
rnaOrDna.nd260by280 = nd260by280; |
3176 |
06 Mar 15 |
olle |
rnaOrDna.nd260by230 = nd260by230; |
3176 |
06 Mar 15 |
olle |
1813 |
|
3176 |
06 Mar 15 |
olle |
// Only update counter for the first value (not when replacing a lower value) |
3176 |
06 Mar 15 |
olle |
if (isFirstValue) |
3176 |
06 Mar 15 |
olle |
1816 |
{ |
3176 |
06 Mar 15 |
olle |
numImported++; |
3176 |
06 Mar 15 |
olle |
1818 |
} |
3176 |
06 Mar 15 |
olle |
1819 |
} |
3176 |
06 Mar 15 |
olle |
1820 |
|
3176 |
06 Mar 15 |
olle |
1821 |
} |
3176 |
06 Mar 15 |
olle |
1822 |
|
3176 |
06 Mar 15 |
olle |
if (numImported != numNanoDropItems) |
3176 |
06 Mar 15 |
olle |
1824 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'Could not find NanoDrop values for all ' + numNanoDropItems + ' samples: ' + numImported); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1827 |
} |
3176 |
06 Mar 15 |
olle |
1828 |
|
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'valid'); |
3176 |
06 Mar 15 |
olle |
nanoDropFileIsValid = true; |
3176 |
06 Mar 15 |
olle |
1831 |
} |
3176 |
06 Mar 15 |
olle |
finally |
3176 |
06 Mar 15 |
olle |
1833 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
1835 |
} |
3176 |
06 Mar 15 |
olle |
1836 |
} |
3176 |
06 Mar 15 |
olle |
1837 |
|
3176 |
06 Mar 15 |
olle |
exreg.qubitFileOnChange = function() |
3176 |
06 Mar 15 |
olle |
1839 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var file = frm.qubitFile.files[0]; |
3176 |
06 Mar 15 |
olle |
1842 |
|
3176 |
06 Mar 15 |
olle |
var reader = new FileReader(); |
3176 |
06 Mar 15 |
olle |
reader.onload = exreg.qubitFileLoaded; |
3694 |
15 Jan 16 |
olle |
// Read with encoding "ISO-8859-1" to ensure that special characters will be correct |
3694 |
15 Jan 16 |
olle |
reader.readAsText(file, 'ISO-8859-1'); |
3176 |
06 Mar 15 |
olle |
1847 |
} |
3176 |
06 Mar 15 |
olle |
1848 |
|
3283 |
29 Apr 15 |
olle |
exreg.qubitFileDilutionFactorOnChange = function() |
3283 |
29 Apr 15 |
olle |
1850 |
{ |
3283 |
29 Apr 15 |
olle |
var frm = document.forms['meludi']; |
3283 |
29 Apr 15 |
olle |
var dilutionFactor = frm.qubitFileDilutionFactor.value; |
3352 |
26 May 15 |
olle |
dilutionFactor = ExtractUtils.getNumber(dilutionFactor); |
3283 |
29 Apr 15 |
olle |
1854 |
|
3283 |
29 Apr 15 |
olle |
if (isNaN(dilutionFactor)) |
3283 |
29 Apr 15 |
olle |
1856 |
{ |
3283 |
29 Apr 15 |
olle |
Wizard.setInputStatus('qubitFileDilutionFactor', 'invalid', 'Dilution factor must be a number.'); |
3283 |
29 Apr 15 |
olle |
return; |
3283 |
29 Apr 15 |
olle |
1859 |
} |
3283 |
29 Apr 15 |
olle |
else if (dilutionFactor <= 0) |
3283 |
29 Apr 15 |
olle |
1861 |
{ |
3283 |
29 Apr 15 |
olle |
Wizard.setInputStatus('qubitFileDilutionFactor', 'invalid', 'Dilution factor must be >= 0.'); |
3283 |
29 Apr 15 |
olle |
return; |
3283 |
29 Apr 15 |
olle |
1864 |
} |
3283 |
29 Apr 15 |
olle |
frm.qubitFileDilutionFactor.value = dilutionFactor; |
3283 |
29 Apr 15 |
olle |
Wizard.setInputStatus('qubitFileDilutionFactor', 'valid'); |
3283 |
29 Apr 15 |
olle |
1867 |
} |
3283 |
29 Apr 15 |
olle |
1868 |
|
3176 |
06 Mar 15 |
olle |
exreg.qubitFileLoaded = function(event) |
3176 |
06 Mar 15 |
olle |
1870 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.parseQubitFile(event.target.result); |
3176 |
06 Mar 15 |
olle |
1872 |
} |
3176 |
06 Mar 15 |
olle |
1873 |
|
3176 |
06 Mar 15 |
olle |
exreg.parseQubitFile = function(data) |
3176 |
06 Mar 15 |
olle |
1875 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3283 |
29 Apr 15 |
olle |
var dilutionFactorDefault = frm.qubitFileDilutionFactor.value; |
3176 |
06 Mar 15 |
olle |
qubitFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
1879 |
|
3176 |
06 Mar 15 |
olle |
var numSpecimens = 0; |
3176 |
06 Mar 15 |
olle |
try |
3176 |
06 Mar 15 |
olle |
1882 |
{ |
3176 |
06 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
1884 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
var qubitItemsList = []; |
3176 |
06 Mar 15 |
olle |
var numQubitItems = 0; |
3208 |
24 Mar 15 |
olle |
var qubitFileInfoText = null; |
3176 |
06 Mar 15 |
olle |
// Reset existing values, if not explicitly entered in input field |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
1893 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
1896 |
{ |
3176 |
06 Mar 15 |
olle |
var dnaConc = frm['dnaConc'+i]; |
3176 |
06 Mar 15 |
olle |
if (dnaConc != null) |
3176 |
06 Mar 15 |
olle |
1899 |
{ |
3176 |
06 Mar 15 |
olle |
var dnaConcValue = frm['dnaConc'+i].value; |
3176 |
06 Mar 15 |
olle |
if (dnaConcValue != null && dnaConcValue != '' && dnaConcValue != '-') |
3176 |
06 Mar 15 |
olle |
1902 |
{ |
3352 |
26 May 15 |
olle |
item.dna.qubitConc = ExtractUtils.getNumber(dnaConcValue); |
3176 |
06 Mar 15 |
olle |
1904 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1906 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = null; |
3176 |
06 Mar 15 |
olle |
item.dna.nd260by280 = null; |
3176 |
06 Mar 15 |
olle |
item.dna.nd260by230 = null; |
3176 |
06 Mar 15 |
olle |
1910 |
} |
3176 |
06 Mar 15 |
olle |
1911 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
1913 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = null; |
3176 |
06 Mar 15 |
olle |
item.dna.nd260by280 = null; |
3176 |
06 Mar 15 |
olle |
item.dna.nd260by230 = null; |
3176 |
06 Mar 15 |
olle |
1917 |
} |
3176 |
06 Mar 15 |
olle |
qubitItemsList[numQubitItems] = item; |
3176 |
06 Mar 15 |
olle |
numQubitItems++; |
3176 |
06 Mar 15 |
olle |
1920 |
} |
3176 |
06 Mar 15 |
olle |
1921 |
} |
3176 |
06 Mar 15 |
olle |
1922 |
|
3694 |
15 Jan 16 |
olle |
// Replace double quotes with blanks |
3694 |
15 Jan 16 |
olle |
var lines = []; |
3694 |
15 Jan 16 |
olle |
var rawLines = data.split(/[\n\r]+/); |
3694 |
15 Jan 16 |
olle |
for (i = 0; i < rawLines.length; i++) |
3694 |
15 Jan 16 |
olle |
1927 |
{ |
3694 |
15 Jan 16 |
olle |
var rawLine = rawLines[i]; |
3694 |
15 Jan 16 |
olle |
var line = rawLine.replace(/\"/g, ""); |
3694 |
15 Jan 16 |
olle |
lines[i] = line; |
3694 |
15 Jan 16 |
olle |
1931 |
} |
3694 |
15 Jan 16 |
olle |
// Inspect header line to get header version |
3694 |
15 Jan 16 |
olle |
var headerVersion = exreg.fetchQubitFileHeaderVersion(lines[0]); |
3694 |
15 Jan 16 |
olle |
if (headerVersion == null) |
3694 |
15 Jan 16 |
olle |
1935 |
{ |
3694 |
15 Jan 16 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'Unknown Qubit file header version'); |
3694 |
15 Jan 16 |
olle |
return; |
3694 |
15 Jan 16 |
olle |
1938 |
} |
3176 |
06 Mar 15 |
olle |
//var columns = lines[0].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
var columns = lines[0].split(/ *, */); |
3176 |
06 Mar 15 |
olle |
1941 |
|
3694 |
15 Jan 16 |
olle |
var nameHeader = exreg.fetchQubitFileColumnName('name', headerVersion); |
3694 |
15 Jan 16 |
olle |
var nameIndex = exreg.findColumn(columns, nameHeader); |
3176 |
06 Mar 15 |
olle |
if (nameIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1945 |
|
3694 |
15 Jan 16 |
olle |
var assayConcHeader = exreg.fetchQubitFileColumnName('conc', headerVersion); |
3694 |
15 Jan 16 |
olle |
var assayConcIndex = exreg.findColumn(columns, assayConcHeader); |
3176 |
06 Mar 15 |
olle |
if (assayConcIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1949 |
|
3694 |
15 Jan 16 |
olle |
var unitsHeader = exreg.fetchQubitFileColumnName('units', headerVersion); |
3694 |
15 Jan 16 |
olle |
var unitsIndex = exreg.findColumn(columns, unitsHeader); |
3176 |
06 Mar 15 |
olle |
if (unitsIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
1953 |
|
3694 |
15 Jan 16 |
olle |
var dilutionFactorHeader = exreg.fetchQubitFileColumnName('dilutionFactor', headerVersion); |
3694 |
15 Jan 16 |
olle |
var dilutionFactorIndex = exreg.findColumn(columns, dilutionFactorHeader); |
3208 |
24 Mar 15 |
olle |
if (dilutionFactorIndex == -1) return; |
3208 |
24 Mar 15 |
olle |
1957 |
|
3176 |
06 Mar 15 |
olle |
// Entry lines come in reversed chronological order |
3176 |
06 Mar 15 |
olle |
var qubitConcReversedList = []; |
3176 |
06 Mar 15 |
olle |
var numConcValues = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 1; i < lines.length; i++) |
3176 |
06 Mar 15 |
olle |
1962 |
{ |
3176 |
06 Mar 15 |
olle |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
3176 |
06 Mar 15 |
olle |
1964 |
|
3176 |
06 Mar 15 |
olle |
//var row = lines[i].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
var row = lines[i].split(/ *, */); |
3176 |
06 Mar 15 |
olle |
if (row.length != columns.length) |
3176 |
06 Mar 15 |
olle |
1968 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
1971 |
} |
3176 |
06 Mar 15 |
olle |
1972 |
|
3176 |
06 Mar 15 |
olle |
var sampleName = row[nameIndex]; |
3176 |
06 Mar 15 |
olle |
if (!sampleName) continue; // with the next line if sample name missing |
3176 |
06 Mar 15 |
olle |
1975 |
|
3176 |
06 Mar 15 |
olle |
var assayConc = row[assayConcIndex]; |
3176 |
06 Mar 15 |
olle |
var units = row[unitsIndex]; |
3208 |
24 Mar 15 |
olle |
var dilutionFactor = row[dilutionFactorIndex]; |
3268 |
23 Apr 15 |
olle |
1979 |
// |
3268 |
23 Apr 15 |
olle |
// Note: Up to this point, input variables are of type string. |
3268 |
23 Apr 15 |
olle |
// If the value represents a number, the variable needs to be |
3268 |
23 Apr 15 |
olle |
// converted to type number, which is important e.g. when calling |
3268 |
23 Apr 15 |
olle |
// function toFixed(numDecimals), which is defined for numbers, but not for strings. |
3268 |
23 Apr 15 |
olle |
1984 |
// |
3268 |
23 Apr 15 |
olle |
if (assayConc != null && !isNaN(assayConc)) |
3268 |
23 Apr 15 |
olle |
1986 |
{ |
3352 |
26 May 15 |
olle |
assayConc = ExtractUtils.getNumber(assayConc); |
3268 |
23 Apr 15 |
olle |
1988 |
} |
3268 |
23 Apr 15 |
olle |
1989 |
|
3208 |
24 Mar 15 |
olle |
if (dilutionFactor == null || dilutionFactor == '') |
3208 |
24 Mar 15 |
olle |
1991 |
{ |
3283 |
29 Apr 15 |
olle |
dilutionFactor = dilutionFactorDefault; |
3208 |
24 Mar 15 |
olle |
1993 |
} |
3208 |
24 Mar 15 |
olle |
1994 |
|
3268 |
23 Apr 15 |
olle |
if (!isNaN(assayConc)) |
3268 |
23 Apr 15 |
olle |
1996 |
{ |
3268 |
23 Apr 15 |
olle |
// Multiply with dilution factor |
3268 |
23 Apr 15 |
olle |
assayConc *= dilutionFactor; |
3268 |
23 Apr 15 |
olle |
1999 |
} |
3176 |
06 Mar 15 |
olle |
if (assayConc && units && units == 'ng/ml') |
3176 |
06 Mar 15 |
olle |
2001 |
{ |
3208 |
24 Mar 15 |
olle |
if (!isNaN(assayConc)) |
3176 |
06 Mar 15 |
olle |
2003 |
{ |
3268 |
23 Apr 15 |
olle |
// Convert to ng/microliter = microgram/milliliter |
3208 |
24 Mar 15 |
olle |
assayConc /= 1000.0; |
3176 |
06 Mar 15 |
olle |
2006 |
} |
3176 |
06 Mar 15 |
olle |
2007 |
} |
3176 |
06 Mar 15 |
olle |
2008 |
|
3176 |
06 Mar 15 |
olle |
if (assayConc) |
3176 |
06 Mar 15 |
olle |
2010 |
{ |
3176 |
06 Mar 15 |
olle |
qubitConcReversedList[numConcValues] = assayConc; |
3176 |
06 Mar 15 |
olle |
numConcValues++; |
3176 |
06 Mar 15 |
olle |
2013 |
} |
3176 |
06 Mar 15 |
olle |
2014 |
} |
3176 |
06 Mar 15 |
olle |
2015 |
|
3176 |
06 Mar 15 |
olle |
// Reverse list to get values in correct order |
3176 |
06 Mar 15 |
olle |
var qubitConcList = []; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numConcValues; i++) |
3176 |
06 Mar 15 |
olle |
2019 |
{ |
3176 |
06 Mar 15 |
olle |
qubitConcList[i] = qubitConcReversedList[(numConcValues - 1) - i]; |
3176 |
06 Mar 15 |
olle |
2021 |
} |
3176 |
06 Mar 15 |
olle |
2022 |
|
3176 |
06 Mar 15 |
olle |
var numImported = 0; |
3176 |
06 Mar 15 |
olle |
var qubitConcIndex = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2026 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
2029 |
{ |
3176 |
06 Mar 15 |
olle |
var qubitConc = qubitConcList[qubitConcIndex]; |
3176 |
06 Mar 15 |
olle |
if (isNaN(qubitConc)) |
3176 |
06 Mar 15 |
olle |
2032 |
{ |
3208 |
24 Mar 15 |
olle |
// This case is often "<0.50" (assay concentration < 0.50 ng/ml excluding dilution) |
3208 |
24 Mar 15 |
olle |
var qubitItem = qubitItemsList[qubitConcIndex]; |
3208 |
24 Mar 15 |
olle |
2035 |
/* |
3208 |
24 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'On line ' + (i+1) + ': No valid Assay Conc value for "' + qubitItem.name + '": ' + qubitConc); |
3176 |
06 Mar 15 |
olle |
return; |
3208 |
24 Mar 15 |
olle |
2038 |
*/ |
3208 |
24 Mar 15 |
olle |
qubitFileInfoText = 'Assay conc. value for "' + qubitItem.name + '": ' + qubitConc + ' set to 0.0.'; |
3208 |
24 Mar 15 |
olle |
qubitConc = 0.0; |
3176 |
06 Mar 15 |
olle |
2041 |
} |
3208 |
24 Mar 15 |
olle |
qubitConcIndex++; |
3176 |
06 Mar 15 |
olle |
numImported++; |
3176 |
06 Mar 15 |
olle |
2044 |
|
3176 |
06 Mar 15 |
olle |
var dnaConc = frm['dnaConc'+i]; |
3176 |
06 Mar 15 |
olle |
if (dnaConc != null) |
3176 |
06 Mar 15 |
olle |
2047 |
{ |
3176 |
06 Mar 15 |
olle |
var dnaConcValue = frm['dnaConc'+i].value; |
3176 |
06 Mar 15 |
olle |
if (dnaConcValue != null && dnaConcValue != '' && dnaConcValue != '-') |
3176 |
06 Mar 15 |
olle |
2050 |
{ |
3352 |
26 May 15 |
olle |
item.dna.qubitConc = ExtractUtils.getNumber(dnaConcValue); |
3176 |
06 Mar 15 |
olle |
2052 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2054 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = qubitConc; |
3176 |
06 Mar 15 |
olle |
2056 |
} |
3176 |
06 Mar 15 |
olle |
2057 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2059 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = qubitConc; |
3176 |
06 Mar 15 |
olle |
2061 |
} |
3176 |
06 Mar 15 |
olle |
2062 |
} |
3176 |
06 Mar 15 |
olle |
2063 |
} |
3176 |
06 Mar 15 |
olle |
2064 |
|
3176 |
06 Mar 15 |
olle |
if (numImported != numQubitItems) |
3176 |
06 Mar 15 |
olle |
2066 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'Could not find Qubit values for all ' + numQubitItems + ' samples: ' + numImported); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2069 |
} |
3176 |
06 Mar 15 |
olle |
2070 |
|
3208 |
24 Mar 15 |
olle |
if (qubitFileInfoText) |
3208 |
24 Mar 15 |
olle |
2072 |
{ |
3208 |
24 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'flag', qubitFileInfoText); |
3208 |
24 Mar 15 |
olle |
2074 |
} |
3208 |
24 Mar 15 |
olle |
else |
3208 |
24 Mar 15 |
olle |
2076 |
{ |
3208 |
24 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'valid'); |
3208 |
24 Mar 15 |
olle |
2078 |
} |
3176 |
06 Mar 15 |
olle |
qubitFileIsValid = true; |
3176 |
06 Mar 15 |
olle |
2080 |
} |
3176 |
06 Mar 15 |
olle |
finally |
3176 |
06 Mar 15 |
olle |
2082 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
2084 |
} |
3176 |
06 Mar 15 |
olle |
2085 |
} |
3176 |
06 Mar 15 |
olle |
2086 |
|
3694 |
15 Jan 16 |
olle |
2087 |
/** |
3694 |
15 Jan 16 |
olle |
* Returns a local Qubit file header version number |
3694 |
15 Jan 16 |
olle |
* after inspection of the header line, or `null` if unknown. |
3694 |
15 Jan 16 |
olle |
* The version number is only used locally, but was chosen |
3694 |
15 Jan 16 |
olle |
* to coincide with Qubit hardware versions 2 and 3. |
3694 |
15 Jan 16 |
olle |
2092 |
* |
3694 |
15 Jan 16 |
olle |
* @param header The header line with column names. |
3694 |
15 Jan 16 |
olle |
* @return The Qubit file header version number, or `null` if unknown. |
3694 |
15 Jan 16 |
olle |
2095 |
*/ |
3694 |
15 Jan 16 |
olle |
exreg.fetchQubitFileHeaderVersion = function(header) |
3694 |
15 Jan 16 |
olle |
2097 |
{ |
3694 |
15 Jan 16 |
olle |
var headerVersion = null; |
3694 |
15 Jan 16 |
olle |
if (header.indexOf('Assay Conc.') >= 0) |
3694 |
15 Jan 16 |
olle |
2100 |
{ |
3694 |
15 Jan 16 |
olle |
headerVersion = 2; |
3694 |
15 Jan 16 |
olle |
2102 |
} |
3694 |
15 Jan 16 |
olle |
else if (header.indexOf('Qubit® tube conc.') >= 0) |
3694 |
15 Jan 16 |
olle |
2104 |
{ |
3694 |
15 Jan 16 |
olle |
headerVersion = 3; |
3694 |
15 Jan 16 |
olle |
2106 |
} |
3694 |
15 Jan 16 |
olle |
return headerVersion; |
3694 |
15 Jan 16 |
olle |
2108 |
} |
3694 |
15 Jan 16 |
olle |
2109 |
|
3694 |
15 Jan 16 |
olle |
2110 |
/** |
3694 |
15 Jan 16 |
olle |
* Returns a column name in header of Qubit file |
3694 |
15 Jan 16 |
olle |
* after input of JSON key value for the column |
3694 |
15 Jan 16 |
olle |
* and local Qubit file header version number, |
3694 |
15 Jan 16 |
olle |
* or `null` if unknown. |
3694 |
15 Jan 16 |
olle |
2115 |
* |
3694 |
15 Jan 16 |
olle |
* @param key JSON key value for Qubit file column. |
3694 |
15 Jan 16 |
olle |
* @param headerVersion Local Qubit file header version number. |
3694 |
15 Jan 16 |
olle |
* @return Column name in header of Qubit file, or `null` if unknown. |
3694 |
15 Jan 16 |
olle |
2119 |
*/ |
3694 |
15 Jan 16 |
olle |
exreg.fetchQubitFileColumnName = function(key, headerVersion) |
3694 |
15 Jan 16 |
olle |
2121 |
{ |
3694 |
15 Jan 16 |
olle |
var jsonQubitFileColumnHeaders2 = {"name": "Name", "conc": "Assay Conc.", "units": "Units", "dilutionFactor": "Dilution Factor"}; |
3694 |
15 Jan 16 |
olle |
var jsonQubitFileColumnHeaders3 = {"name": "Assay Name", "conc": "Qubit® tube conc.", "units": "Units", "dilutionFactor": "Dilution Factor"}; |
3694 |
15 Jan 16 |
olle |
2124 |
|
3694 |
15 Jan 16 |
olle |
var columnName = null; |
3694 |
15 Jan 16 |
olle |
if (headerVersion == 2) |
3694 |
15 Jan 16 |
olle |
2127 |
{ |
3694 |
15 Jan 16 |
olle |
columnName = jsonQubitFileColumnHeaders2[key]; |
3694 |
15 Jan 16 |
olle |
2129 |
} |
3694 |
15 Jan 16 |
olle |
else if (headerVersion == 3) |
3694 |
15 Jan 16 |
olle |
2131 |
{ |
3694 |
15 Jan 16 |
olle |
columnName = jsonQubitFileColumnHeaders3[key]; |
3694 |
15 Jan 16 |
olle |
2133 |
} |
3694 |
15 Jan 16 |
olle |
return columnName; |
3694 |
15 Jan 16 |
olle |
2135 |
} |
3694 |
15 Jan 16 |
olle |
2136 |
|
3176 |
06 Mar 15 |
olle |
exreg.parseDnaInput = function(data) |
3176 |
06 Mar 15 |
olle |
2138 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
qubitFileIsValid = false; |
3176 |
06 Mar 15 |
olle |
2141 |
|
3208 |
24 Mar 15 |
olle |
var numQubitItems = 0; |
3176 |
06 Mar 15 |
olle |
try |
3176 |
06 Mar 15 |
olle |
2144 |
{ |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
2148 |
|
3176 |
06 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2151 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3176 |
06 Mar 15 |
olle |
var dnaConc = frm['dnaConc'+i]; |
3176 |
06 Mar 15 |
olle |
if (dnaConc != null) |
3176 |
06 Mar 15 |
olle |
2155 |
{ |
3176 |
06 Mar 15 |
olle |
var dnaConcValue = frm['dnaConc'+i].value; |
3176 |
06 Mar 15 |
olle |
if (dnaConcValue != null && dnaConcValue != '' && dnaConcValue != '-') |
3176 |
06 Mar 15 |
olle |
2158 |
{ |
3352 |
26 May 15 |
olle |
item.dna.qubitConc = ExtractUtils.getNumber(dnaConcValue); |
3176 |
06 Mar 15 |
olle |
2160 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2162 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = null; |
3176 |
06 Mar 15 |
olle |
2164 |
} |
3208 |
24 Mar 15 |
olle |
numQubitItems++; |
3176 |
06 Mar 15 |
olle |
2166 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2168 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.qubitConc = null; |
3176 |
06 Mar 15 |
olle |
2170 |
} |
3176 |
06 Mar 15 |
olle |
2171 |
} |
3176 |
06 Mar 15 |
olle |
2172 |
|
3176 |
06 Mar 15 |
olle |
var lines = data.split(/[\n\r]+/); |
3176 |
06 Mar 15 |
olle |
var columns = lines[0].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
2175 |
|
3176 |
06 Mar 15 |
olle |
var sampleIndex = exreg.findColumn(columns, 'Sample ID'); |
3176 |
06 Mar 15 |
olle |
if (sampleIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
2178 |
|
3176 |
06 Mar 15 |
olle |
var wellIndex = exreg.findColumn(columns, 'Well'); |
3176 |
06 Mar 15 |
olle |
if (wellIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
2181 |
|
3176 |
06 Mar 15 |
olle |
var qubitConcIndex = exreg.findColumn(columns, 'Conc.'); |
3176 |
06 Mar 15 |
olle |
if (qubitConcIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
2184 |
|
3176 |
06 Mar 15 |
olle |
var numImported = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 1; i < lines.length; i++) |
3176 |
06 Mar 15 |
olle |
2187 |
{ |
3176 |
06 Mar 15 |
olle |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
3176 |
06 Mar 15 |
olle |
2189 |
|
3176 |
06 Mar 15 |
olle |
var row = lines[i].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
if (row.length != columns.length) |
3176 |
06 Mar 15 |
olle |
2192 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2195 |
} |
3176 |
06 Mar 15 |
olle |
2196 |
|
3176 |
06 Mar 15 |
olle |
var sampleId = row[sampleIndex]; |
3176 |
06 Mar 15 |
olle |
if (!sampleId || sampleId == 'blank') continue; // with the next line |
3176 |
06 Mar 15 |
olle |
2199 |
|
3227 |
07 Apr 15 |
olle |
var rnaOrDna = exreg.findRnaOrDna(sampleId, i+1, 'qubitFile'); |
3176 |
06 Mar 15 |
olle |
if (!rnaOrDna) return; // This is an error condition |
3176 |
06 Mar 15 |
olle |
2202 |
|
3176 |
06 Mar 15 |
olle |
// No check for correct well since DNA is not stored on plate |
3176 |
06 Mar 15 |
olle |
2204 |
|
3352 |
26 May 15 |
olle |
var qubitConc = ExtractUtils.getNumber(row[qubitConcIndex]); |
3176 |
06 Mar 15 |
olle |
if (isNaN(qubitConc)) |
3176 |
06 Mar 15 |
olle |
2207 |
{ |
3227 |
07 Apr 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'On line ' + (i+1) + '; No valid qubitConc value for "' + sampleId + '": ' + row[qubitConcIndex]); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2210 |
} |
3176 |
06 Mar 15 |
olle |
2211 |
|
3176 |
06 Mar 15 |
olle |
// If there are multiple entries for the same item, keep the largest QubitConc |
3227 |
07 Apr 15 |
olle |
var isFirstValue = rnaOrDna.qubitConc == null; |
3227 |
07 Apr 15 |
olle |
if (isFirstValue || qubitConc > rnaOrDna.qubitConc) |
3176 |
06 Mar 15 |
olle |
2215 |
{ |
3176 |
06 Mar 15 |
olle |
// Store values |
3227 |
07 Apr 15 |
olle |
if (rnaOrDna.qubitConc == null || rnaOrDna.qubitConc == '') |
3176 |
06 Mar 15 |
olle |
2218 |
{ |
3227 |
07 Apr 15 |
olle |
rnaOrDna.qubitConc = qubitConc; |
3176 |
06 Mar 15 |
olle |
isFirstValue = false; |
3176 |
06 Mar 15 |
olle |
2221 |
} |
3176 |
06 Mar 15 |
olle |
2222 |
|
3176 |
06 Mar 15 |
olle |
// Only update counter for the first value (not when replacing a lower value) |
3176 |
06 Mar 15 |
olle |
if (isFirstValue) |
3176 |
06 Mar 15 |
olle |
2225 |
{ |
3176 |
06 Mar 15 |
olle |
numImported++; |
3176 |
06 Mar 15 |
olle |
2227 |
} |
3176 |
06 Mar 15 |
olle |
2228 |
} |
3176 |
06 Mar 15 |
olle |
2229 |
|
3176 |
06 Mar 15 |
olle |
2230 |
} |
3176 |
06 Mar 15 |
olle |
2231 |
|
3176 |
06 Mar 15 |
olle |
2232 |
/* |
3176 |
06 Mar 15 |
olle |
if (numImported != numSpecimens) |
3176 |
06 Mar 15 |
olle |
2234 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'invalid', 'Could not find values for all ' + numSpecimens + ' samples: ' + numImported); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2237 |
} |
3176 |
06 Mar 15 |
olle |
2238 |
*/ |
3176 |
06 Mar 15 |
olle |
2239 |
/* |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qubitFile', 'valid'); |
3176 |
06 Mar 15 |
olle |
qubitFileIsValid = true; |
3176 |
06 Mar 15 |
olle |
2242 |
*/ |
3176 |
06 Mar 15 |
olle |
2243 |
} |
3176 |
06 Mar 15 |
olle |
finally |
3176 |
06 Mar 15 |
olle |
2245 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
2247 |
} |
3176 |
06 Mar 15 |
olle |
2248 |
} |
3176 |
06 Mar 15 |
olle |
2249 |
|
3176 |
06 Mar 15 |
olle |
exreg.findColumn = function(columns, col) |
3176 |
06 Mar 15 |
olle |
2251 |
{ |
3176 |
06 Mar 15 |
olle |
var colIndex = columns.indexOf(col); |
3176 |
06 Mar 15 |
olle |
if (colIndex == -1) |
3176 |
06 Mar 15 |
olle |
2254 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('nanoDropFile', 'invalid', 'On line 1; Can\'t find "' + col + '" column'); |
3176 |
06 Mar 15 |
olle |
2256 |
} |
3176 |
06 Mar 15 |
olle |
return colIndex; |
3176 |
06 Mar 15 |
olle |
2258 |
} |
3176 |
06 Mar 15 |
olle |
2259 |
|
3176 |
06 Mar 15 |
olle |
exreg.qPcrFileOnChange = function() |
3176 |
06 Mar 15 |
olle |
2261 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var file = frm.qPcrFile.files[0]; |
3176 |
06 Mar 15 |
olle |
2264 |
|
3176 |
06 Mar 15 |
olle |
var reader = new FileReader(); |
3176 |
06 Mar 15 |
olle |
reader.onload = exreg.qPcrFileLoaded; |
3176 |
06 Mar 15 |
olle |
reader.readAsText(file); |
3176 |
06 Mar 15 |
olle |
2268 |
} |
3176 |
06 Mar 15 |
olle |
2269 |
|
3176 |
06 Mar 15 |
olle |
exreg.qPcrFileLoaded = function(event) |
3176 |
06 Mar 15 |
olle |
2271 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.parseQPcrFile(event.target.result); |
3176 |
06 Mar 15 |
olle |
2273 |
} |
3176 |
06 Mar 15 |
olle |
2274 |
|
3176 |
06 Mar 15 |
olle |
exreg.parseQPcrFile = function(data) |
3176 |
06 Mar 15 |
olle |
2276 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
qPcrFileIsValid = false; |
3271 |
23 Apr 15 |
olle |
var qPcrFileInfoText = null; |
3176 |
06 Mar 15 |
olle |
2280 |
|
3176 |
06 Mar 15 |
olle |
var numQPcrItems = 0; |
3176 |
06 Mar 15 |
olle |
try |
3176 |
06 Mar 15 |
olle |
2283 |
{ |
3176 |
06 Mar 15 |
olle |
// Reset the existing values |
3176 |
06 Mar 15 |
olle |
2285 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2290 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
2293 |
{ |
3176 |
06 Mar 15 |
olle |
item.dna.deltaCt = null; |
3176 |
06 Mar 15 |
olle |
numQPcrItems++; |
3176 |
06 Mar 15 |
olle |
2296 |
} |
3176 |
06 Mar 15 |
olle |
2297 |
} |
3176 |
06 Mar 15 |
olle |
2298 |
|
3176 |
06 Mar 15 |
olle |
// Find column separator as first character after first occurrence of search string |
3352 |
26 May 15 |
olle |
var separator = ExtractUtils.findSeparator(data, "Well"); |
3176 |
06 Mar 15 |
olle |
if (separator == null) |
3176 |
06 Mar 15 |
olle |
2302 |
{ |
3176 |
06 Mar 15 |
olle |
// Comma is default separator |
3176 |
06 Mar 15 |
olle |
separator = ','; |
3176 |
06 Mar 15 |
olle |
2305 |
} |
3176 |
06 Mar 15 |
olle |
var columnSplitRegexp = new RegExp(" *" + separator + " *",''); |
3176 |
06 Mar 15 |
olle |
var lines = data.split(/[\n\r]+/); |
3176 |
06 Mar 15 |
olle |
//var columns = lines[0].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
//var columns = lines[0].split(/ *, */); |
3176 |
06 Mar 15 |
olle |
//var columns = lines[0].split(/ *; */); |
3176 |
06 Mar 15 |
olle |
var columns = lines[0].split(columnSplitRegexp); |
3176 |
06 Mar 15 |
olle |
2312 |
|
3176 |
06 Mar 15 |
olle |
var sampleIndex = exreg.findQPcrColumn(columns, 'Sample'); |
3176 |
06 Mar 15 |
olle |
if (sampleIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
var deltaCtIndex = exreg.findQPcrColumn(columns, 'Delta Ct'); |
3176 |
06 Mar 15 |
olle |
if (deltaCtIndex == -1) return; |
3176 |
06 Mar 15 |
olle |
2317 |
|
3176 |
06 Mar 15 |
olle |
var numImported = 0; |
3176 |
06 Mar 15 |
olle |
for (var i = 1; i < lines.length; i++) |
3176 |
06 Mar 15 |
olle |
2320 |
{ |
3176 |
06 Mar 15 |
olle |
if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines |
3176 |
06 Mar 15 |
olle |
//var row = lines[i].split(/ *\t */); |
3176 |
06 Mar 15 |
olle |
//var row = lines[i].split(/ *, */); |
3176 |
06 Mar 15 |
olle |
// Exchange decimal comma for decimal dot inside double quotes |
3352 |
26 May 15 |
olle |
var procLine = ExtractUtils.setDecimalDotInsideDoubleQuotes(lines[i]); |
3176 |
06 Mar 15 |
olle |
//var row = procLine.split(/ *, */); |
3176 |
06 Mar 15 |
olle |
//var row = procLine.split(/ *; */); |
3176 |
06 Mar 15 |
olle |
var row = procLine.split(columnSplitRegexp); |
3176 |
06 Mar 15 |
olle |
if (row.length != columns.length) |
3176 |
06 Mar 15 |
olle |
2330 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'invalid', 'On line ' + (i+1) + '; Unexpected number of columns: ' + row.length + " instead of " + columns.length); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2333 |
} |
3176 |
06 Mar 15 |
olle |
2334 |
|
3176 |
06 Mar 15 |
olle |
var sampleId = row[sampleIndex]; |
3176 |
06 Mar 15 |
olle |
if (!sampleId || sampleId == 'blank' || sampleId == '' || sampleId == 'QCT') continue; // with the next line |
3176 |
06 Mar 15 |
olle |
2337 |
|
3271 |
23 Apr 15 |
olle |
//var messageId = 'qPcrFile'; |
3271 |
23 Apr 15 |
olle |
var messageId = null; |
3271 |
23 Apr 15 |
olle |
var rnaOrDna = exreg.findRnaOrDna(sampleId, i+1, messageId); |
3271 |
23 Apr 15 |
olle |
if (!rnaOrDna) |
3271 |
23 Apr 15 |
olle |
2342 |
{ |
3271 |
23 Apr 15 |
olle |
// No RNA/DNA found with sample ID |
3271 |
23 Apr 15 |
olle |
qPcrFileInfoText = 'On line ' + (i+1) + '; Can\'t find RNA/DNA with name "' + sampleId + '"'; |
3271 |
23 Apr 15 |
olle |
// Continue with the next line |
3271 |
23 Apr 15 |
olle |
continue; |
3271 |
23 Apr 15 |
olle |
2347 |
} |
3176 |
06 Mar 15 |
olle |
2348 |
/* |
3176 |
06 Mar 15 |
olle |
if (rnaOrDna.well != row[wellIndex]) |
3176 |
06 Mar 15 |
olle |
2350 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'invalid', 'On line ' + (i+1) + '; Expected to find "' + sampleId + '" in well [' + rnaOrDna.well + '] not [' + row[wellIndex] + ']'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2353 |
} |
3176 |
06 Mar 15 |
olle |
2354 |
*/ |
3176 |
06 Mar 15 |
olle |
var isFirstValue = rnaOrDna.deltaCt == null; |
3176 |
06 Mar 15 |
olle |
if (isFirstValue) |
3176 |
06 Mar 15 |
olle |
2357 |
{ |
3352 |
26 May 15 |
olle |
//var deltaCt = ExtractUtils.getNumber(row[deltaCtIndex]); |
3176 |
06 Mar 15 |
olle |
var deltaCtStr = row[deltaCtIndex]; |
3176 |
06 Mar 15 |
olle |
// Remove any double quotes surrounding value string |
3176 |
06 Mar 15 |
olle |
if (deltaCtStr.indexOf('"') == 0) |
3176 |
06 Mar 15 |
olle |
2362 |
{ |
3176 |
06 Mar 15 |
olle |
deltaCtStr = deltaCtStr.substring(1, deltaCtStr.length - 1); |
3176 |
06 Mar 15 |
olle |
2364 |
} |
3352 |
26 May 15 |
olle |
var deltaCt = ExtractUtils.getNumber(deltaCtStr); |
3176 |
06 Mar 15 |
olle |
if (isNaN(deltaCt)) |
3176 |
06 Mar 15 |
olle |
2367 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'invalid', 'On line ' + (i+1) + '; No valid delta-Ct value for "' + sampleId + '": ' + row[deltaCtIndex]); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2370 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2372 |
{ |
3176 |
06 Mar 15 |
olle |
// Store values |
3176 |
06 Mar 15 |
olle |
rnaOrDna.deltaCt = deltaCt; |
3176 |
06 Mar 15 |
olle |
numImported++; |
3176 |
06 Mar 15 |
olle |
2376 |
} |
3176 |
06 Mar 15 |
olle |
2377 |
} |
3176 |
06 Mar 15 |
olle |
2378 |
} |
3176 |
06 Mar 15 |
olle |
2379 |
|
3176 |
06 Mar 15 |
olle |
if (numImported != numQPcrItems) |
3176 |
06 Mar 15 |
olle |
2381 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'invalid', 'Could not find values for all ' + numQPcrItems + ' samples: ' + numImported); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2384 |
} |
3176 |
06 Mar 15 |
olle |
2385 |
|
3271 |
23 Apr 15 |
olle |
if (qPcrFileInfoText) |
3271 |
23 Apr 15 |
olle |
2387 |
{ |
3271 |
23 Apr 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'flag', qPcrFileInfoText); |
3271 |
23 Apr 15 |
olle |
2389 |
} |
3271 |
23 Apr 15 |
olle |
else |
3271 |
23 Apr 15 |
olle |
2391 |
{ |
3271 |
23 Apr 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'valid'); |
3271 |
23 Apr 15 |
olle |
2393 |
} |
3176 |
06 Mar 15 |
olle |
qPcrFileIsValid = true; |
3176 |
06 Mar 15 |
olle |
2395 |
} |
3176 |
06 Mar 15 |
olle |
finally |
3176 |
06 Mar 15 |
olle |
2397 |
{ |
3176 |
06 Mar 15 |
olle |
exreg.updateDetailsTable(); |
3176 |
06 Mar 15 |
olle |
2399 |
} |
3176 |
06 Mar 15 |
olle |
2400 |
} |
3176 |
06 Mar 15 |
olle |
2401 |
|
3176 |
06 Mar 15 |
olle |
exreg.findQPcrColumn = function(columns, col) |
3176 |
06 Mar 15 |
olle |
2403 |
{ |
3176 |
06 Mar 15 |
olle |
var colIndex = columns.indexOf(col); |
3176 |
06 Mar 15 |
olle |
if (colIndex == -1) |
3176 |
06 Mar 15 |
olle |
2406 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.setInputStatus('qPcrFile', 'invalid', 'On line 1; Can\'t find "' + col + '" column'); |
3176 |
06 Mar 15 |
olle |
2408 |
} |
3176 |
06 Mar 15 |
olle |
return colIndex; |
3176 |
06 Mar 15 |
olle |
2410 |
} |
3176 |
06 Mar 15 |
olle |
2411 |
|
3227 |
07 Apr 15 |
olle |
exreg.findRnaOrDna = function(sampleId, lineNo, messageId) |
3176 |
06 Mar 15 |
olle |
2413 |
{ |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2418 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3176 |
06 Mar 15 |
olle |
var test_rna_name = item.rna.name; |
3176 |
06 Mar 15 |
olle |
var test_dna_name = item.dna.name; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
2423 |
{ |
3176 |
06 Mar 15 |
olle |
test_rna_name = item.name; |
3227 |
07 Apr 15 |
olle |
2425 |
} |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isDna(item)) |
3227 |
07 Apr 15 |
olle |
2427 |
{ |
3176 |
06 Mar 15 |
olle |
test_dna_name = item.name; |
3176 |
06 Mar 15 |
olle |
2429 |
} |
3176 |
06 Mar 15 |
olle |
if (test_rna_name == sampleId) |
3176 |
06 Mar 15 |
olle |
2431 |
{ |
3176 |
06 Mar 15 |
olle |
return item.rna; |
3176 |
06 Mar 15 |
olle |
2433 |
} |
3176 |
06 Mar 15 |
olle |
else if (test_dna_name == sampleId) |
3176 |
06 Mar 15 |
olle |
2435 |
{ |
3176 |
06 Mar 15 |
olle |
return item.dna; |
3176 |
06 Mar 15 |
olle |
2437 |
} |
3176 |
06 Mar 15 |
olle |
2438 |
} |
3271 |
23 Apr 15 |
olle |
if (messageId) |
3271 |
23 Apr 15 |
olle |
2440 |
{ |
3271 |
23 Apr 15 |
olle |
Wizard.setInputStatus(messageId, 'invalid', 'On line ' + lineNo + '; Can\'t find RNA/DNA with name "' + sampleId + '"'); |
3271 |
23 Apr 15 |
olle |
2442 |
} |
3176 |
06 Mar 15 |
olle |
return null; |
3176 |
06 Mar 15 |
olle |
2444 |
} |
3176 |
06 Mar 15 |
olle |
2445 |
|
3332 |
12 May 15 |
olle |
exreg.downloadReagentLotNoFile = function() |
3332 |
12 May 15 |
olle |
2447 |
{ |
3332 |
12 May 15 |
olle |
var frm = document.forms['meludi']; |
3332 |
12 May 15 |
olle |
2449 |
|
3332 |
12 May 15 |
olle |
var reagentInfo = {}; |
3332 |
12 May 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3332 |
12 May 15 |
olle |
url += '&cmd=DownloadReagentLotNoFile'; |
3432 |
29 Jun 15 |
olle |
url += '&startListName='+encodeURIComponent(frm.startListName.value); |
3332 |
12 May 15 |
olle |
url += '&isolationDate='+encodeURIComponent(frm.isolationDate.value); |
3332 |
12 May 15 |
olle |
2455 |
|
3332 |
12 May 15 |
olle |
// Reagents |
3332 |
12 May 15 |
olle |
for (var i = 0; i < exreg.REAGENTS.length; i++) |
3332 |
12 May 15 |
olle |
2458 |
{ |
3332 |
12 May 15 |
olle |
var rg = exreg.REAGENTS[i]; |
3332 |
12 May 15 |
olle |
reagentInfo[rg] = frm[rg].value; |
3332 |
12 May 15 |
olle |
2461 |
} |
3332 |
12 May 15 |
olle |
2462 |
|
3332 |
12 May 15 |
olle |
url += '&reagentInfo=' + encodeURIComponent(JSON.stringify(reagentInfo)); |
3332 |
12 May 15 |
olle |
window.open(url); |
3332 |
12 May 15 |
olle |
2465 |
} |
3332 |
12 May 15 |
olle |
2466 |
|
3176 |
06 Mar 15 |
olle |
exreg.generateFakeNanoDropFile = function() |
3176 |
06 Mar 15 |
olle |
2468 |
{ |
3176 |
06 Mar 15 |
olle |
if (location.protocol == 'https:') |
3176 |
06 Mar 15 |
olle |
2470 |
{ |
3176 |
06 Mar 15 |
olle |
Forms.showNotification('btnFakeNanoDropFile', 'For security reasons, this function can\'t be used on HTTPS servers.'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2473 |
} |
3176 |
06 Mar 15 |
olle |
2474 |
|
3176 |
06 Mar 15 |
olle |
var FILE_HEADER = ['Well', 'Sample ID', 'Conc.', '260/280', '260/230']; |
3176 |
06 Mar 15 |
olle |
var data = FILE_HEADER.join('\t')+'\n'; |
3176 |
06 Mar 15 |
olle |
2477 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2482 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
2485 |
{ |
3176 |
06 Mar 15 |
olle |
var line = []; |
3176 |
06 Mar 15 |
olle |
// RNA |
3176 |
06 Mar 15 |
olle |
line[0] = item.rna.well; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3227 |
07 Apr 15 |
olle |
2490 |
{ |
3227 |
07 Apr 15 |
olle |
line[1] = item.rna.name; |
3227 |
07 Apr 15 |
olle |
2492 |
} |
3352 |
26 May 15 |
olle |
else if (ExtractUtils.isRna(item)) |
3227 |
07 Apr 15 |
olle |
2494 |
{ |
3227 |
07 Apr 15 |
olle |
line[1] = item.name; |
3227 |
07 Apr 15 |
olle |
2496 |
} |
3176 |
06 Mar 15 |
olle |
line[2] = Numbers.formatNumber(Math.random()*100+10, 2); |
3176 |
06 Mar 15 |
olle |
line[3] = Numbers.formatNumber(Math.random()*.5+2, 2); |
3176 |
06 Mar 15 |
olle |
line[4] = Numbers.formatNumber(Math.random()+1, 2); |
3176 |
06 Mar 15 |
olle |
data += line.join('\t') + '\n'; |
3176 |
06 Mar 15 |
olle |
2501 |
} |
3176 |
06 Mar 15 |
olle |
2502 |
} |
3176 |
06 Mar 15 |
olle |
exreg.parseNanoDropFile(data); |
3176 |
06 Mar 15 |
olle |
2504 |
} |
3176 |
06 Mar 15 |
olle |
2505 |
|
3176 |
06 Mar 15 |
olle |
exreg.generateFakeDnaInput = function() |
3176 |
06 Mar 15 |
olle |
2507 |
{ |
3176 |
06 Mar 15 |
olle |
if (location.protocol == 'https:') |
3176 |
06 Mar 15 |
olle |
2509 |
{ |
3176 |
06 Mar 15 |
olle |
Forms.showNotification('btnFakeDnaInput', 'For security reasons, this function can\'t be used on HTTPS servers.'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2512 |
} |
3176 |
06 Mar 15 |
olle |
2513 |
|
3176 |
06 Mar 15 |
olle |
var FILE_HEADER = ['Well', 'Sample ID', 'Conc.', '260/280', '260/230']; |
3176 |
06 Mar 15 |
olle |
var data = FILE_HEADER.join('\t')+'\n'; |
3176 |
06 Mar 15 |
olle |
2516 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2521 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
2524 |
{ |
3176 |
06 Mar 15 |
olle |
var line = []; |
3176 |
06 Mar 15 |
olle |
// DNA |
3176 |
06 Mar 15 |
olle |
line[0] = item.dna.well; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3227 |
07 Apr 15 |
olle |
2529 |
{ |
3227 |
07 Apr 15 |
olle |
line[1] = item.dna.name; |
3227 |
07 Apr 15 |
olle |
2531 |
} |
3352 |
26 May 15 |
olle |
else if (ExtractUtils.isDna(item)) |
3227 |
07 Apr 15 |
olle |
2533 |
{ |
3227 |
07 Apr 15 |
olle |
line[1] = item.name; |
3227 |
07 Apr 15 |
olle |
2535 |
} |
3176 |
06 Mar 15 |
olle |
line[2] = Numbers.formatNumber(Math.random()*100+10, 2); |
3176 |
06 Mar 15 |
olle |
line[3] = Numbers.formatNumber(Math.random()*.5+2, 2); |
3176 |
06 Mar 15 |
olle |
line[4] = Numbers.formatNumber(Math.random()+1, 2); |
3176 |
06 Mar 15 |
olle |
data += line.join('\t') + '\n'; |
3176 |
06 Mar 15 |
olle |
2540 |
} |
3176 |
06 Mar 15 |
olle |
2541 |
} |
3176 |
06 Mar 15 |
olle |
exreg.parseDnaInput(data); |
3176 |
06 Mar 15 |
olle |
2543 |
} |
3176 |
06 Mar 15 |
olle |
2544 |
|
3176 |
06 Mar 15 |
olle |
exreg.generateFakeQPcrFile = function() |
3176 |
06 Mar 15 |
olle |
2546 |
{ |
3176 |
06 Mar 15 |
olle |
if (location.protocol == 'https:') |
3176 |
06 Mar 15 |
olle |
2548 |
{ |
3176 |
06 Mar 15 |
olle |
Forms.showNotification('btnFakeQPcrFile', 'For security reasons, this function can\'t be used on HTTPS servers.'); |
3176 |
06 Mar 15 |
olle |
return; |
3176 |
06 Mar 15 |
olle |
2551 |
} |
3176 |
06 Mar 15 |
olle |
var FILE_HEADER = ['Well', 'Fluor', 'Content', 'Sample', 'Cq', 'Ct', 'Delta Ct']; |
3176 |
06 Mar 15 |
olle |
var data = FILE_HEADER.join(',')+'\n'; |
3176 |
06 Mar 15 |
olle |
2554 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2559 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isDna(item)) |
3176 |
06 Mar 15 |
olle |
2562 |
{ |
3176 |
06 Mar 15 |
olle |
for (var j = 0; j < 3; j++) |
3176 |
06 Mar 15 |
olle |
2564 |
{ |
3176 |
06 Mar 15 |
olle |
var line = []; |
3176 |
06 Mar 15 |
olle |
// DNA |
3176 |
06 Mar 15 |
olle |
line[0] = item.dna.well; |
3176 |
06 Mar 15 |
olle |
line[1] = 'SYBR'; |
3176 |
06 Mar 15 |
olle |
line[2] = 'Unkn'; |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item)) |
3227 |
07 Apr 15 |
olle |
2571 |
{ |
3227 |
07 Apr 15 |
olle |
line[3] = item.dna.name; |
3227 |
07 Apr 15 |
olle |
2573 |
} |
3352 |
26 May 15 |
olle |
else if (ExtractUtils.isDna(item)) |
3227 |
07 Apr 15 |
olle |
2575 |
{ |
3227 |
07 Apr 15 |
olle |
line[3] = item.name; |
3227 |
07 Apr 15 |
olle |
2577 |
} |
3176 |
06 Mar 15 |
olle |
if (j == 0) |
3176 |
06 Mar 15 |
olle |
2579 |
{ |
3176 |
06 Mar 15 |
olle |
line[4] = '"' + Numbers.formatNumber(Math.random()*100+10, 2) + '"'; |
3176 |
06 Mar 15 |
olle |
line[5] = '"' + Numbers.formatNumber(Math.random()*.5+2, 2) + '"'; |
3176 |
06 Mar 15 |
olle |
line[6] = '"' + Numbers.formatNumber(Math.random()+1, 2) + '"'; |
3176 |
06 Mar 15 |
olle |
2583 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2585 |
{ |
3176 |
06 Mar 15 |
olle |
line[4] = '"' + Numbers.formatNumber(Math.random()*100+10, 2) + '"'; |
3176 |
06 Mar 15 |
olle |
line[5] = ''; |
3176 |
06 Mar 15 |
olle |
line[6] = ''; |
3176 |
06 Mar 15 |
olle |
2589 |
} |
3176 |
06 Mar 15 |
olle |
data += line.join(',') + '\n'; |
3176 |
06 Mar 15 |
olle |
2591 |
} |
3176 |
06 Mar 15 |
olle |
2592 |
} |
3176 |
06 Mar 15 |
olle |
2593 |
} |
3176 |
06 Mar 15 |
olle |
exreg.parseQPcrFile(data); |
3176 |
06 Mar 15 |
olle |
2595 |
} |
3176 |
06 Mar 15 |
olle |
2596 |
|
3176 |
06 Mar 15 |
olle |
exreg.validateStep3 = function(event) |
3176 |
06 Mar 15 |
olle |
2598 |
{ |
3176 |
06 Mar 15 |
olle |
var valid = true; |
3224 |
02 Apr 15 |
olle |
2600 |
/* |
3176 |
06 Mar 15 |
olle |
valid &= nanoDropFileIsValid; |
3224 |
02 Apr 15 |
olle |
2602 |
*/ |
3176 |
06 Mar 15 |
olle |
valid &= qiacubePositionsAreValid; |
3176 |
06 Mar 15 |
olle |
2604 |
|
3176 |
06 Mar 15 |
olle |
if (!valid) event.preventDefault(); |
3176 |
06 Mar 15 |
olle |
2606 |
} |
3176 |
06 Mar 15 |
olle |
2607 |
|
3176 |
06 Mar 15 |
olle |
exreg.submit = function() |
3176 |
06 Mar 15 |
olle |
2609 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
2611 |
|
3176 |
06 Mar 15 |
olle |
var submitInfo = {}; |
3176 |
06 Mar 15 |
olle |
submitInfo.items = []; |
3176 |
06 Mar 15 |
olle |
2614 |
|
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < numItems; i++) |
3176 |
06 Mar 15 |
olle |
2619 |
{ |
3176 |
06 Mar 15 |
olle |
var item = selItemsList[i]; |
3177 |
09 Mar 15 |
olle |
2621 |
/* |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
2623 |
{ |
3176 |
06 Mar 15 |
olle |
item.rna.preNormalize = frm['rnaPreNormalize'+i].checked; |
3176 |
06 Mar 15 |
olle |
2625 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2627 |
{ |
3176 |
06 Mar 15 |
olle |
item.rna.preNormalize = false; |
3176 |
06 Mar 15 |
olle |
2629 |
} |
3177 |
09 Mar 15 |
olle |
2630 |
*/ |
3176 |
06 Mar 15 |
olle |
submitInfo.items[submitInfo.items.length] = item; |
3176 |
06 Mar 15 |
olle |
2632 |
} |
3176 |
06 Mar 15 |
olle |
2633 |
|
3176 |
06 Mar 15 |
olle |
// Extraction |
3432 |
29 Jun 15 |
olle |
submitInfo.startListName = frm.startListName.value; |
3432 |
29 Jun 15 |
olle |
submitInfo.startListId = frm.startListId.value; |
3180 |
17 Mar 15 |
olle |
submitInfo.isolationDate = frm.isolationDate.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.extractionOperator = frm.extractionOperator.value; |
3180 |
17 Mar 15 |
olle |
submitInfo.extractionProtocol = parseInt(frm.extractionProtocolId.value, 10); |
3352 |
26 May 15 |
olle |
submitInfo.rnaDefaultVolume = ExtractUtils.getNumber(frm.rnaDefaultVolume.value); |
3352 |
26 May 15 |
olle |
submitInfo.dnaDefaultVolume = ExtractUtils.getNumber(frm.dnaDefaultVolume.value); |
3176 |
06 Mar 15 |
olle |
2642 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube |
3176 |
06 Mar 15 |
olle |
submitInfo.qiacubeDate = frm.qiacubeDate.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.qiacubeOperator = frm.qiacubeOperator.value; |
3176 |
06 Mar 15 |
olle |
submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value, 10); |
3176 |
06 Mar 15 |
olle |
2647 |
|
3176 |
06 Mar 15 |
olle |
// Reagents |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < exreg.REAGENTS.length; i++) |
3176 |
06 Mar 15 |
olle |
2650 |
{ |
3176 |
06 Mar 15 |
olle |
var rg = exreg.REAGENTS[i]; |
3176 |
06 Mar 15 |
olle |
submitInfo[rg] = frm[rg].value; |
3176 |
06 Mar 15 |
olle |
2653 |
} |
3176 |
06 Mar 15 |
olle |
2654 |
|
3176 |
06 Mar 15 |
olle |
var url = '../Extraction.servlet?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
url += '&cmd=RegisterDnaRna'; |
3176 |
06 Mar 15 |
olle |
Wizard.showLoadingAnimation('Performing registration...'); |
3176 |
06 Mar 15 |
olle |
Wizard.asyncJsonRequest(url, exreg.submissionResults, 'POST', JSON.stringify(submitInfo)); |
3176 |
06 Mar 15 |
olle |
2659 |
} |
3176 |
06 Mar 15 |
olle |
2660 |
|
3176 |
06 Mar 15 |
olle |
exreg.submissionResults = function(response) |
3176 |
06 Mar 15 |
olle |
2662 |
{ |
3176 |
06 Mar 15 |
olle |
Wizard.showFinalMessage(response.messages); |
3176 |
06 Mar 15 |
olle |
Doc.show('gorestart'); |
3199 |
19 Mar 15 |
olle |
Doc.show('gocreate'); |
3336 |
13 May 15 |
olle |
trackingProtocolPreview = false; |
3176 |
06 Mar 15 |
olle |
if (response.createdRna && response.createdRna.length > 0) |
3176 |
06 Mar 15 |
olle |
2668 |
{ |
3176 |
06 Mar 15 |
olle |
createdRna = response.createdRna; |
3176 |
06 Mar 15 |
olle |
2670 |
/* |
3176 |
06 Mar 15 |
olle |
Doc.show('rnaQcWizard'); |
3176 |
06 Mar 15 |
olle |
2672 |
*/ |
3176 |
06 Mar 15 |
olle |
2673 |
} |
3176 |
06 Mar 15 |
olle |
2674 |
} |
3176 |
06 Mar 15 |
olle |
2675 |
|
3176 |
06 Mar 15 |
olle |
exreg.createProtocol = function() |
3176 |
06 Mar 15 |
olle |
2677 |
{ |
3176 |
06 Mar 15 |
olle |
var frm = document.forms['meludi']; |
3176 |
06 Mar 15 |
olle |
var submitInfo = {}; |
3176 |
06 Mar 15 |
olle |
submitInfo.items = []; |
3176 |
06 Mar 15 |
olle |
2681 |
|
3180 |
17 Mar 15 |
olle |
submitInfo.docMode = 'report'; |
3176 |
06 Mar 15 |
olle |
// Get list of selected extract source items |
3176 |
06 Mar 15 |
olle |
var selItemsList = exreg.getSelectedItemsList(); |
3176 |
06 Mar 15 |
olle |
var numItems = selItemsList.length; |
3432 |
29 Jun 15 |
olle |
var totNumItems = numItems; |
3180 |
17 Mar 15 |
olle |
for (var i = 0; i < totNumItems; i++) |
3176 |
06 Mar 15 |
olle |
2688 |
{ |
3180 |
17 Mar 15 |
olle |
var item = null; |
3432 |
29 Jun 15 |
olle |
item = selItemsList[i]; |
3177 |
09 Mar 15 |
olle |
2691 |
/* |
3352 |
26 May 15 |
olle |
if (ExtractUtils.isSpecimen(item) || ExtractUtils.isRna(item)) |
3176 |
06 Mar 15 |
olle |
2693 |
{ |
3176 |
06 Mar 15 |
olle |
item.rna.preNormalize = frm['rnaPreNormalize'+i].checked; |
3176 |
06 Mar 15 |
olle |
2695 |
} |
3176 |
06 Mar 15 |
olle |
else |
3176 |
06 Mar 15 |
olle |
2697 |
{ |
3176 |
06 Mar 15 |
olle |
item.rna.preNormalize = false; |
3176 |
06 Mar 15 |
olle |
2699 |
} |
3177 |
09 Mar 15 |
olle |
2700 |
*/ |
3176 |
06 Mar 15 |
olle |
submitInfo.items[submitInfo.items.length] = item; |
3176 |
06 Mar 15 |
olle |
2702 |
} |
3176 |
06 Mar 15 |
olle |
2703 |
|
3176 |
06 Mar 15 |
olle |
// Extraction |
3432 |
29 Jun 15 |
olle |
submitInfo.startListName = frm.startListName.value; |
3180 |
17 Mar 15 |
olle |
submitInfo.isolationDate = frm.isolationDate.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.extractionOperator = frm.extractionOperator.value; |
3180 |
17 Mar 15 |
olle |
submitInfo.extractionProtocol = parseInt(frm.extractionProtocolId.value, 10); |
3180 |
17 Mar 15 |
olle |
var extractionProtocolName = frm.extractionProtocolName.value; |
3176 |
06 Mar 15 |
olle |
var protocolVersionNo = ''; |
3176 |
06 Mar 15 |
olle |
if (extractionProtocolName) |
3176 |
06 Mar 15 |
olle |
2712 |
{ |
3202 |
19 Mar 15 |
olle |
protocolVersionNo = extractionProtocolName; |
3202 |
19 Mar 15 |
olle |
// Remove part of string up to and including last "v" |
3202 |
19 Mar 15 |
olle |
var vIndex = protocolVersionNo.indexOf('v'); |
3202 |
19 Mar 15 |
olle |
while (vIndex >= 0) |
3176 |
06 Mar 15 |
olle |
2717 |
{ |
3202 |
19 Mar 15 |
olle |
// Remove part of string up to and including first "v" |
3202 |
19 Mar 15 |
olle |
protocolVersionNo = protocolVersionNo.substring(vIndex + 1); |
3202 |
19 Mar 15 |
olle |
vIndex = protocolVersionNo.indexOf('v'); |
3176 |
06 Mar 15 |
olle |
2721 |
} |
3176 |
06 Mar 15 |
olle |
2722 |
} |
3199 |
19 Mar 15 |
olle |
var protocolPreviewFlag = null; |
3336 |
13 May 15 |
olle |
if (trackingProtocolPreview) |
3199 |
19 Mar 15 |
olle |
2725 |
{ |
3199 |
19 Mar 15 |
olle |
protocolPreviewFlag = 'true'; |
3199 |
19 Mar 15 |
olle |
2727 |
} |
3176 |
06 Mar 15 |
olle |
submitInfo.extractionProtocolName = extractionProtocolName; |
3176 |
06 Mar 15 |
olle |
submitInfo.protocolVersionNo = protocolVersionNo; |
3199 |
19 Mar 15 |
olle |
submitInfo.protocolPreviewFlag = protocolPreviewFlag; |
3352 |
26 May 15 |
olle |
submitInfo.dnaDefaultVolume = ExtractUtils.getNumber(frm.dnaDefaultVolume.value); |
3176 |
06 Mar 15 |
olle |
2732 |
|
3176 |
06 Mar 15 |
olle |
// QIAcube |
3176 |
06 Mar 15 |
olle |
submitInfo.qiacubeDate = frm.qiacubeDate.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.qiacubeOperator = frm.qiacubeOperator.value; |
3176 |
06 Mar 15 |
olle |
submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value, 10); |
3501 |
21 Sep 15 |
olle |
2737 |
|
3501 |
21 Sep 15 |
olle |
// Specimen reagents |
3501 |
21 Sep 15 |
olle |
submitInfo.xyleneSpecimen = frm.xyleneSpecimen.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.etoh995Specimen = frm.etoh995Specimen.value; |
3176 |
06 Mar 15 |
olle |
submitInfo.allPrepFfpeKit = frm.allPrepFfpeKit.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferPkdSpecimen = frm.bufferPkdSpecimen.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferAtlSpecimen = frm.bufferAtlSpecimen.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.proteinaseKSpecimen = frm.proteinaseKSpecimen.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.rnaseASpecimen = frm.rnaseASpecimen.value; |
3501 |
21 Sep 15 |
olle |
2746 |
|
3501 |
21 Sep 15 |
olle |
// QIAcube |
3501 |
21 Sep 15 |
olle |
submitInfo.etoh995 = frm.etoh995.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferRlt = frm.bufferRlt.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferFrn = frm.bufferFrn.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferRpe = frm.bufferRpe.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferAl = frm.bufferAl.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferAw1 = frm.bufferAw1.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferAw2 = frm.bufferAw2.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferAte = frm.bufferAte.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.bufferRdd = frm.bufferRdd.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.rnaseFreeWater = frm.rnaseFreeWater.value; |
3436 |
02 Jul 15 |
olle |
submitInfo.dnaseMix = frm.dnaseMix.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.rneasyMinEluteSpinColumn = frm.rneasyMinEluteSpinColumn.value; |
3501 |
21 Sep 15 |
olle |
submitInfo.qiaampMinEluteSpinColumn = frm.qiaampMinEluteSpinColumn.value; |
3176 |
06 Mar 15 |
olle |
2761 |
|
3324 |
11 May 15 |
olle |
// Quality control reagents |
3324 |
11 May 15 |
olle |
submitInfo.kapaSybrFast = frm.kapaSybrFast.value; |
3324 |
11 May 15 |
olle |
submitInfo.qualityControlPrimersQcpRgt = frm.qualityControlPrimersQcpRgt.value; |
3438 |
03 Jul 15 |
olle |
submitInfo.qualityControlTemplateQct = frm.qualityControlTemplateQct.value; |
3324 |
11 May 15 |
olle |
submitInfo.qubitDnaHighSens = frm.qubitDnaHighSens.value; |
3324 |
11 May 15 |
olle |
submitInfo.qubitDnaBroadRange = frm.qubitDnaBroadRange.value; |
3324 |
11 May 15 |
olle |
2768 |
|
3176 |
06 Mar 15 |
olle |
// Save values in hidden input fields for retrieval after HTML request |
3176 |
06 Mar 15 |
olle |
var submitInfoJsonStr = JSON.stringify(submitInfo); |
3176 |
06 Mar 15 |
olle |
frm.hiddenSubmitInfo.value = submitInfoJsonStr; |
3176 |
06 Mar 15 |
olle |
frm.hiddenNumItems.value = submitInfo.items.length; |
3176 |
06 Mar 15 |
olle |
frm.hiddenCounterBalanceInfoRow.value = counterBalanceInfoRow; |
3176 |
06 Mar 15 |
olle |
2774 |
|
3176 |
06 Mar 15 |
olle |
// Calling frm.submit() will change jsp file to extraction_protocol2.jsp |
3176 |
06 Mar 15 |
olle |
frm.submit(); |
3176 |
06 Mar 15 |
olle |
2777 |
} |
3176 |
06 Mar 15 |
olle |
2778 |
|
3176 |
06 Mar 15 |
olle |
2779 |
/* |
3176 |
06 Mar 15 |
olle |
exreg.goRnaQc = function() |
3176 |
06 Mar 15 |
olle |
2781 |
{ |
3176 |
06 Mar 15 |
olle |
var url = 'rnaqc_aliquot.jsp?ID='+App.getSessionId(); |
3176 |
06 Mar 15 |
olle |
for (var i = 0; i < createdRna.length; i++) |
3176 |
06 Mar 15 |
olle |
2784 |
{ |
3176 |
06 Mar 15 |
olle |
url += '&rna='+createdRna[i]; |
3176 |
06 Mar 15 |
olle |
2786 |
} |
3176 |
06 Mar 15 |
olle |
location.href = url; |
3176 |
06 Mar 15 |
olle |
2788 |
} |
3176 |
06 Mar 15 |
olle |
2789 |
*/ |
3176 |
06 Mar 15 |
olle |
2790 |
|
3176 |
06 Mar 15 |
olle |
return exreg; |
3176 |
06 Mar 15 |
olle |
2792 |
}(); |
3176 |
06 Mar 15 |
olle |
2793 |
|
3176 |
06 Mar 15 |
olle |
Doc.onLoad(ExtractionReg.initPage); |
3176 |
06 Mar 15 |
olle |
2795 |
|