3449 |
28 Jul 15 |
olle |
var Protocol = function() |
3449 |
28 Jul 15 |
olle |
2 |
{ |
3449 |
28 Jul 15 |
olle |
var protocol = {}; |
3449 |
28 Jul 15 |
olle |
var debug = 0; |
3449 |
28 Jul 15 |
olle |
5 |
|
3449 |
28 Jul 15 |
olle |
var LOW_QUANTITY_WARNING_FACTOR = 2; |
3449 |
28 Jul 15 |
olle |
7 |
|
3449 |
28 Jul 15 |
olle |
// Page initialization |
3449 |
28 Jul 15 |
olle |
protocol.initPage = function() |
3449 |
28 Jul 15 |
olle |
10 |
{ |
3449 |
28 Jul 15 |
olle |
var pageId = Doc.getPageId(); |
3449 |
28 Jul 15 |
olle |
//alert("dna_protocol.js::initPage(): pageId = " + pageId); |
3449 |
28 Jul 15 |
olle |
if (pageId == 'protocol') |
3449 |
28 Jul 15 |
olle |
14 |
{ |
3449 |
28 Jul 15 |
olle |
Buttons.addClickHandler('print-button', Wizard.goPrint); |
3449 |
28 Jul 15 |
olle |
16 |
|
3449 |
28 Jul 15 |
olle |
var dnaPlateId = Data.int('page-data', 'dna-plate'); |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::initPage(): dnaPlateId = " + dnaPlateId); |
3449 |
28 Jul 15 |
olle |
19 |
|
3449 |
28 Jul 15 |
olle |
20 |
/* |
3449 |
28 Jul 15 |
olle |
var url = '../MRna.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetMRnaInfoForPlate&bioplate='+mrnaPlateId; |
3449 |
28 Jul 15 |
olle |
Wizard.showLoadingAnimation('Loading mRNA bioplate information...'); |
3449 |
28 Jul 15 |
olle |
24 |
*/ |
3449 |
28 Jul 15 |
olle |
var url = '../Dna.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetDnaInfoForPlate&bioplate='+dnaPlateId; |
3449 |
28 Jul 15 |
olle |
Wizard.showLoadingAnimation('Loading DNA bioplate information...'); |
3449 |
28 Jul 15 |
olle |
Wizard.asyncJsonRequest(url, protocol.initializeProtocol); |
3449 |
28 Jul 15 |
olle |
29 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
31 |
{ |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('bioplate', 'change', protocol.bioplateOnChange); |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('listview', 'click', protocol.viewProtocol); |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('plateview', 'click', protocol.viewProtocol); |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('stratageneConc', 'keypress', Events.numberOnly); |
3449 |
28 Jul 15 |
olle |
36 |
|
3449 |
28 Jul 15 |
olle |
37 |
/* |
3449 |
28 Jul 15 |
olle |
var url = '../Dna.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetUnprocessedPlates&plateType=DNA'; |
3449 |
28 Jul 15 |
olle |
40 |
*/ |
3449 |
28 Jul 15 |
olle |
var url = '../LibPrep.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetLibraryPlatesForLibPrep'; |
3449 |
28 Jul 15 |
olle |
Wizard.showLoadingAnimation('Loading DNA plates...'); |
3449 |
28 Jul 15 |
olle |
Wizard.asyncJsonRequest(url, protocol.initializeStep1); |
3449 |
28 Jul 15 |
olle |
45 |
} |
3449 |
28 Jul 15 |
olle |
46 |
} |
3449 |
28 Jul 15 |
olle |
47 |
|
3449 |
28 Jul 15 |
olle |
48 |
|
3449 |
28 Jul 15 |
olle |
protocol.initializeStep1 = function(response) |
3449 |
28 Jul 15 |
olle |
50 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
52 |
|
3449 |
28 Jul 15 |
olle |
var bioplates = response.bioplates; |
3449 |
28 Jul 15 |
olle |
var plates = frm.bioplate; |
3449 |
28 Jul 15 |
olle |
if (bioplates.length > 0) |
3449 |
28 Jul 15 |
olle |
56 |
{ |
3449 |
28 Jul 15 |
olle |
for (var i=0; i < bioplates.length; i++) |
3449 |
28 Jul 15 |
olle |
58 |
{ |
3449 |
28 Jul 15 |
olle |
var bioplate = bioplates[i]; |
3449 |
28 Jul 15 |
olle |
var name = bioplate.name; |
3449 |
28 Jul 15 |
olle |
if (bioplate.AutoProcessing == 'PreNormalizeRNA') |
3449 |
28 Jul 15 |
olle |
62 |
{ |
3449 |
28 Jul 15 |
olle |
name += ' (pre-normalized)'; |
3449 |
28 Jul 15 |
olle |
64 |
} |
3449 |
28 Jul 15 |
olle |
else if (bioplate.DilutionDate) |
3449 |
28 Jul 15 |
olle |
66 |
{ |
3449 |
28 Jul 15 |
olle |
name += ' (diluted ' + Meludi.reformatDate(bioplate.DilutionDate) + ')'; |
3449 |
28 Jul 15 |
olle |
68 |
} |
3449 |
28 Jul 15 |
olle |
var option = new Option(name, bioplate.id); |
3449 |
28 Jul 15 |
olle |
option.bioplate = bioplate; |
3449 |
28 Jul 15 |
olle |
plates.options[plates.length] = option; |
3449 |
28 Jul 15 |
olle |
72 |
} |
3449 |
28 Jul 15 |
olle |
bioplateIsValid = true; |
3449 |
28 Jul 15 |
olle |
74 |
|
3449 |
28 Jul 15 |
olle |
protocol.bioplateOnChange(); |
3449 |
28 Jul 15 |
olle |
protocol.loadStratageneConc(); |
3449 |
28 Jul 15 |
olle |
77 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
79 |
{ |
3449 |
28 Jul 15 |
olle |
Wizard.setFatalError('No DNA bioplates available for processing.'); |
3449 |
28 Jul 15 |
olle |
return; |
3449 |
28 Jul 15 |
olle |
82 |
} |
3449 |
28 Jul 15 |
olle |
83 |
|
3449 |
28 Jul 15 |
olle |
Doc.show('step-1'); |
3449 |
28 Jul 15 |
olle |
Doc.show('gonext'); |
3449 |
28 Jul 15 |
olle |
86 |
} |
3449 |
28 Jul 15 |
olle |
87 |
|
3449 |
28 Jul 15 |
olle |
88 |
|
3449 |
28 Jul 15 |
olle |
// Add pools to the pools list based on the bioplate selection |
3449 |
28 Jul 15 |
olle |
protocol.bioplateOnChange = function() |
3449 |
28 Jul 15 |
olle |
91 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate; |
3449 |
28 Jul 15 |
olle |
Doc.element('comments').innerHTML = Strings.encodeTags(bioplate.comments); |
3449 |
28 Jul 15 |
olle |
frm.poolSchema.value = bioplate.poolSchema; |
3449 |
28 Jul 15 |
olle |
96 |
} |
3449 |
28 Jul 15 |
olle |
97 |
|
3449 |
28 Jul 15 |
olle |
protocol.saveStratageneConc = function() |
3449 |
28 Jul 15 |
olle |
99 |
{ |
3449 |
28 Jul 15 |
olle |
if (!window.localStorage) return; |
3449 |
28 Jul 15 |
olle |
101 |
|
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
var stratageneInfo = new Object(); |
3449 |
28 Jul 15 |
olle |
stratageneInfo.conc = frm.stratageneConc.value; |
3449 |
28 Jul 15 |
olle |
window.localStorage.setItem('meludi.stratagene-info', JSON.stringify(stratageneInfo)); |
3449 |
28 Jul 15 |
olle |
106 |
} |
3449 |
28 Jul 15 |
olle |
107 |
|
3449 |
28 Jul 15 |
olle |
protocol.loadStratageneConc = function() |
3449 |
28 Jul 15 |
olle |
109 |
{ |
3449 |
28 Jul 15 |
olle |
if (!window.localStorage) return; |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
112 |
|
3449 |
28 Jul 15 |
olle |
var stratageneInfo = JSON.parse(window.localStorage.getItem('meludi.stratagene-info')); |
3449 |
28 Jul 15 |
olle |
if (stratageneInfo) |
3449 |
28 Jul 15 |
olle |
115 |
{ |
3449 |
28 Jul 15 |
olle |
frm.stratageneConc.value = stratageneInfo.conc; |
3449 |
28 Jul 15 |
olle |
117 |
} |
3449 |
28 Jul 15 |
olle |
118 |
} |
3449 |
28 Jul 15 |
olle |
119 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewProtocol = function(event) |
3449 |
28 Jul 15 |
olle |
121 |
{ |
3449 |
28 Jul 15 |
olle |
122 |
/* |
3449 |
28 Jul 15 |
olle |
protocol.saveStratageneConc(); |
3449 |
28 Jul 15 |
olle |
124 |
*/ |
3449 |
28 Jul 15 |
olle |
125 |
|
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
if (frm.bioplate && !frm.bioplate.disabled) |
3449 |
28 Jul 15 |
olle |
128 |
{ |
3449 |
28 Jul 15 |
olle |
frm.view.value = Data.get(event.currentTarget, 'protocol-type'); |
3449 |
28 Jul 15 |
olle |
frm.submit(); |
3449 |
28 Jul 15 |
olle |
131 |
} |
3449 |
28 Jul 15 |
olle |
132 |
} |
3449 |
28 Jul 15 |
olle |
133 |
|
3449 |
28 Jul 15 |
olle |
134 |
|
3449 |
28 Jul 15 |
olle |
protocol.initializeProtocol = function(response) |
3449 |
28 Jul 15 |
olle |
136 |
{ |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::initializeProtocol(): Start"); |
3449 |
28 Jul 15 |
olle |
var plate = response.plate; |
3449 |
28 Jul 15 |
olle |
if (plate.DilutionDate) |
3449 |
28 Jul 15 |
olle |
140 |
{ |
3449 |
28 Jul 15 |
olle |
Doc.element('dilution-date').innerHTML = Meludi.reformatDate(plate.DilutionDate); |
3449 |
28 Jul 15 |
olle |
Doc.element('dilution-operator').innerHTML = Strings.encodeTags(plate.DilutionOperator); |
3449 |
28 Jul 15 |
olle |
143 |
} |
3449 |
28 Jul 15 |
olle |
144 |
|
3449 |
28 Jul 15 |
olle |
var list = response.dna; |
3449 |
28 Jul 15 |
olle |
var stratageneConc = Data.float('page-data', 'stratagene-conc'); |
3449 |
28 Jul 15 |
olle |
147 |
|
3449 |
28 Jul 15 |
olle |
// Pre-process the return DNA items |
3449 |
28 Jul 15 |
olle |
var allPreNormalized = true; |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::initializeProtocol(): list.length = " + list.length); |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
152 |
{ |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::initializeProtocol(): i = " + i); |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::initializeProtocol(): list[" + i + "].dna.name = " + list[i].dna.name); |
3449 |
28 Jul 15 |
olle |
155 |
/* |
3449 |
28 Jul 15 |
olle |
allPreNormalized &= list[i].rna.preNormalized; |
3449 |
28 Jul 15 |
olle |
157 |
*/ |
3449 |
28 Jul 15 |
olle |
allPreNormalized &= list[i].dna.preNormalized; |
3449 |
28 Jul 15 |
olle |
protocol.checkAndPreProcessDna(list[i], stratageneConc); |
3449 |
28 Jul 15 |
olle |
160 |
} |
3449 |
28 Jul 15 |
olle |
161 |
|
3449 |
28 Jul 15 |
olle |
var view = Data.get('page-data', 'view'); |
3449 |
28 Jul 15 |
olle |
if (view == 'list') |
3449 |
28 Jul 15 |
olle |
164 |
{ |
3449 |
28 Jul 15 |
olle |
protocol.viewAsList(list); |
3449 |
28 Jul 15 |
olle |
166 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
168 |
{ |
3449 |
28 Jul 15 |
olle |
protocol.viewAsPlate(plate, list) |
3449 |
28 Jul 15 |
olle |
170 |
} |
3449 |
28 Jul 15 |
olle |
if (allPreNormalized) |
3449 |
28 Jul 15 |
olle |
172 |
{ |
3449 |
28 Jul 15 |
olle |
Doc.element('dilution-date').innerHTML = 'PreNormalized'; |
3449 |
28 Jul 15 |
olle |
174 |
} |
3449 |
28 Jul 15 |
olle |
175 |
} |
3449 |
28 Jul 15 |
olle |
176 |
|
3449 |
28 Jul 15 |
olle |
protocol.checkAndPreProcessDna = function(mrna, stratageneConc) |
3449 |
28 Jul 15 |
olle |
178 |
{ |
3449 |
28 Jul 15 |
olle |
var rna = mrna.rna; |
3449 |
28 Jul 15 |
olle |
// Set the 'stratagene' flag |
3449 |
28 Jul 15 |
olle |
rna.stratagene = Meludi.isStratagene(rna.name); |
3449 |
28 Jul 15 |
olle |
rna.external = Meludi.isExternal(rna.name); |
3449 |
28 Jul 15 |
olle |
183 |
|
3449 |
28 Jul 15 |
olle |
// Set the 'QC' flag |
3449 |
28 Jul 15 |
olle |
rna.qc = mrna.UseForQC; |
3449 |
28 Jul 15 |
olle |
186 |
|
3449 |
28 Jul 15 |
olle |
if (stratageneConc > 0) |
3449 |
28 Jul 15 |
olle |
188 |
{ |
3449 |
28 Jul 15 |
olle |
if (rna.stratagene && !rna.NDConc) rna.NDConc = stratageneConc; |
3449 |
28 Jul 15 |
olle |
190 |
} |
3449 |
28 Jul 15 |
olle |
191 |
|
3449 |
28 Jul 15 |
olle |
// Calculate volume to use and water to add based on concentration |
3449 |
28 Jul 15 |
olle |
var remarks = []; |
3449 |
28 Jul 15 |
olle |
if (rna.NDConc && rna.usedQuantity) |
3449 |
28 Jul 15 |
olle |
195 |
{ |
3449 |
28 Jul 15 |
olle |
rna.volume = Math.ceil(10000*rna.usedQuantity/rna.NDConc) / 10; // µl |
3449 |
28 Jul 15 |
olle |
if (rna.preNormalized) |
3449 |
28 Jul 15 |
olle |
198 |
{ |
3449 |
28 Jul 15 |
olle |
rna.water = 0; |
3449 |
28 Jul 15 |
olle |
200 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
202 |
{ |
3449 |
28 Jul 15 |
olle |
var totalVolume = mrna.DilutionConc ? 1000 * rna.usedQuantity / mrna.DilutionConc : 50; |
3449 |
28 Jul 15 |
olle |
rna.water = totalVolume-rna.volume; |
3449 |
28 Jul 15 |
olle |
if (totalVolume > 50) |
3449 |
28 Jul 15 |
olle |
206 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Large mix; Use 50µl'; |
3449 |
28 Jul 15 |
olle |
208 |
} |
3449 |
28 Jul 15 |
olle |
209 |
} |
3449 |
28 Jul 15 |
olle |
210 |
} |
3449 |
28 Jul 15 |
olle |
211 |
|
3449 |
28 Jul 15 |
olle |
// check for some issues that may indicate problems |
3449 |
28 Jul 15 |
olle |
if (rna.qc) remarks[remarks.length] = 'QC'; |
3449 |
28 Jul 15 |
olle |
if (!rna.stratagene && !rna.external) |
3449 |
28 Jul 15 |
olle |
215 |
{ |
3449 |
28 Jul 15 |
olle |
if (!rna.bioWell && !rna.preNormalized) |
3449 |
28 Jul 15 |
olle |
217 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'No location'; |
3449 |
28 Jul 15 |
olle |
219 |
} |
3449 |
28 Jul 15 |
olle |
if (!rna.remainingQuantity) |
3449 |
28 Jul 15 |
olle |
221 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'No quantity'; |
3449 |
28 Jul 15 |
olle |
223 |
} |
3449 |
28 Jul 15 |
olle |
else if (rna.remainingQuantity < rna.usedQuantity) |
3449 |
28 Jul 15 |
olle |
225 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Not enough RNA'; |
3449 |
28 Jul 15 |
olle |
227 |
} |
3449 |
28 Jul 15 |
olle |
else if (rna.remainingQuantity < rna.usedQuantity * LOW_QUANTITY_WARNING_FACTOR && !rna.preNormalized) |
3449 |
28 Jul 15 |
olle |
229 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Low quantity'; |
3449 |
28 Jul 15 |
olle |
231 |
} |
3449 |
28 Jul 15 |
olle |
if (!rna.NDConc) |
3449 |
28 Jul 15 |
olle |
233 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'No NDConc value'; |
3449 |
28 Jul 15 |
olle |
235 |
} |
3449 |
28 Jul 15 |
olle |
236 |
} |
3449 |
28 Jul 15 |
olle |
else if (rna.stratagene) |
3449 |
28 Jul 15 |
olle |
238 |
{ |
3449 |
28 Jul 15 |
olle |
if (!rna.NDConc && rna.usedQuantity) |
3449 |
28 Jul 15 |
olle |
240 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Use ' + Numbers.formatNumber(rna.usedQuantity, 2) + ' µg RNA'; |
3449 |
28 Jul 15 |
olle |
242 |
} |
3449 |
28 Jul 15 |
olle |
243 |
} |
3449 |
28 Jul 15 |
olle |
else if (rna.external) |
3449 |
28 Jul 15 |
olle |
245 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Use ' + Numbers.formatNumber(rna.usedQuantity, 2) + ' µg RNA'; |
3449 |
28 Jul 15 |
olle |
247 |
} |
3449 |
28 Jul 15 |
olle |
if (mrna.comment) remarks[remarks.length] = mrna.comment; |
3449 |
28 Jul 15 |
olle |
rna.remarks = remarks; |
3449 |
28 Jul 15 |
olle |
250 |
} |
3449 |
28 Jul 15 |
olle |
251 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewAsPlate = function(plate, list) |
3449 |
28 Jul 15 |
olle |
253 |
{ |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::viewAsPlate(): Start"); |
3449 |
28 Jul 15 |
olle |
var schema = PoolSchema.getById(plate.poolSchema); |
3449 |
28 Jul 15 |
olle |
Plate.init(plate.rows, plate.columns, schema, WellPainter); |
3449 |
28 Jul 15 |
olle |
257 |
|
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::viewAsPlate(): list.length = " + list.length); |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
260 |
{ |
3449 |
28 Jul 15 |
olle |
var mrna = list[i]; |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::viewAsPlate(): i = " + i + " mrna = " + JSON.stringify(mrna)); |
3449 |
28 Jul 15 |
olle |
var well = mrna.bioWell; |
3449 |
28 Jul 15 |
olle |
Plate.getWell(well.row, well.column).setExtract(mrna); |
3449 |
28 Jul 15 |
olle |
265 |
} |
3449 |
28 Jul 15 |
olle |
266 |
|
3449 |
28 Jul 15 |
olle |
Plate.paint(Plate.getWells()); |
3449 |
28 Jul 15 |
olle |
PoolSchema.buildPoolTableRow(schema, plate.columns); |
3449 |
28 Jul 15 |
olle |
Doc.show('all-protocol'); |
3449 |
28 Jul 15 |
olle |
270 |
} |
3449 |
28 Jul 15 |
olle |
271 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewAsList = function(list) |
3449 |
28 Jul 15 |
olle |
273 |
{ |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::viewAsList(): Start"); |
3449 |
28 Jul 15 |
olle |
alert("dna_protocol.js::viewAsList(): list.length = " + list.length); |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
277 |
{ |
3449 |
28 Jul 15 |
olle |
var mrna = list[i]; |
3449 |
28 Jul 15 |
olle |
var rna = mrna.rna; |
3449 |
28 Jul 15 |
olle |
var idSuffix = mrna.bioWell.column + '.' + mrna.bioWell.row; |
3449 |
28 Jul 15 |
olle |
var tableRow = Doc.element('row.'+idSuffix); |
3449 |
28 Jul 15 |
olle |
282 |
|
3449 |
28 Jul 15 |
olle |
Doc.removeClass(tableRow, 'empty'); |
3449 |
28 Jul 15 |
olle |
if (rna.external) Doc.addClass(tableRow, 'external'); |
3449 |
28 Jul 15 |
olle |
if (rna.stratagene) Doc.addClass(tableRow, 'stratagene'); |
3449 |
28 Jul 15 |
olle |
Doc.element('rna.'+idSuffix).innerHTML = Strings.encodeTags(rna.external && mrna.externalId ? mrna.externalId : rna.name); |
3449 |
28 Jul 15 |
olle |
Doc.element('box.'+idSuffix).innerHTML = Strings.encodeTags(protocol.getPlateCoordinate(rna, true)); |
3449 |
28 Jul 15 |
olle |
Doc.element('ndconc.'+idSuffix).innerHTML = Numbers.formatNumber(rna.NDConc, 2); |
3449 |
28 Jul 15 |
olle |
Doc.element('remain.'+idSuffix).innerHTML = Numbers.formatNumber(rna.remainingQuantity, 2); |
3449 |
28 Jul 15 |
olle |
Doc.element('volume.'+idSuffix).innerHTML = Numbers.formatNumber(rna.volume, 1); |
3449 |
28 Jul 15 |
olle |
Doc.element('water.'+idSuffix).innerHTML = rna.preNormalized ? '—' : Numbers.formatNumber(rna.water, 1); |
3449 |
28 Jul 15 |
olle |
Doc.element('remarks.'+idSuffix).innerHTML = rna.remarks.join('; '); |
3449 |
28 Jul 15 |
olle |
293 |
} |
3449 |
28 Jul 15 |
olle |
294 |
|
3449 |
28 Jul 15 |
olle |
Doc.show('all-protocol'); |
3449 |
28 Jul 15 |
olle |
296 |
} |
3449 |
28 Jul 15 |
olle |
297 |
|
3449 |
28 Jul 15 |
olle |
298 |
|
3449 |
28 Jul 15 |
olle |
protocol.getPlateCoordinate = function(rna, includePlateName) |
3449 |
28 Jul 15 |
olle |
300 |
{ |
3449 |
28 Jul 15 |
olle |
var c = ''; |
3449 |
28 Jul 15 |
olle |
if (rna.bioWell) |
3449 |
28 Jul 15 |
olle |
303 |
{ |
3449 |
28 Jul 15 |
olle |
if (includePlateName) c += rna.bioWell.bioPlate.name; |
3449 |
28 Jul 15 |
olle |
c += ' ' + Meludi.wellToAlpha(rna.bioWell.row) + (rna.bioWell.column+1); |
3449 |
28 Jul 15 |
olle |
306 |
} |
3449 |
28 Jul 15 |
olle |
else if (rna.preNormalized) |
3449 |
28 Jul 15 |
olle |
308 |
{ |
3449 |
28 Jul 15 |
olle |
c = 'PreNorm.'; |
3449 |
28 Jul 15 |
olle |
310 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
312 |
{ |
3449 |
28 Jul 15 |
olle |
c = ' '; |
3449 |
28 Jul 15 |
olle |
314 |
} |
3449 |
28 Jul 15 |
olle |
return c; |
3449 |
28 Jul 15 |
olle |
316 |
} |
3449 |
28 Jul 15 |
olle |
317 |
|
3449 |
28 Jul 15 |
olle |
318 |
|
3449 |
28 Jul 15 |
olle |
return protocol; |
3449 |
28 Jul 15 |
olle |
320 |
}(); |
3449 |
28 Jul 15 |
olle |
321 |
|
3449 |
28 Jul 15 |
olle |
Doc.onLoad(Protocol.initPage); |
3449 |
28 Jul 15 |
olle |
323 |
|
3449 |
28 Jul 15 |
olle |
324 |
|
3449 |
28 Jul 15 |
olle |
var WellPainter = function() |
3449 |
28 Jul 15 |
olle |
326 |
{ |
3449 |
28 Jul 15 |
olle |
var painter = {}; |
3449 |
28 Jul 15 |
olle |
328 |
|
3449 |
28 Jul 15 |
olle |
painter.getClassNameForWell = function(well) |
3449 |
28 Jul 15 |
olle |
330 |
{ |
3449 |
28 Jul 15 |
olle |
var cls = ''; |
3449 |
28 Jul 15 |
olle |
var mrna = well.extract; |
3449 |
28 Jul 15 |
olle |
if (mrna) |
3449 |
28 Jul 15 |
olle |
334 |
{ |
3449 |
28 Jul 15 |
olle |
var rna = mrna.rna; |
3449 |
28 Jul 15 |
olle |
if (rna.qc) cls += ' qc'; |
3449 |
28 Jul 15 |
olle |
if (rna.external) cls += ' external'; |
3449 |
28 Jul 15 |
olle |
if (rna.stratagene) cls += ' stratagene'; |
3449 |
28 Jul 15 |
olle |
339 |
} |
3449 |
28 Jul 15 |
olle |
return cls; |
3449 |
28 Jul 15 |
olle |
341 |
} |
3449 |
28 Jul 15 |
olle |
342 |
|
3449 |
28 Jul 15 |
olle |
painter.getWellText = function(well) |
3449 |
28 Jul 15 |
olle |
344 |
{ |
3449 |
28 Jul 15 |
olle |
var text = ''; |
3449 |
28 Jul 15 |
olle |
var mrna = well.extract; |
3449 |
28 Jul 15 |
olle |
if (mrna) |
3449 |
28 Jul 15 |
olle |
348 |
{ |
3449 |
28 Jul 15 |
olle |
var rna = mrna.rna; |
3449 |
28 Jul 15 |
olle |
var name = rna.external && mrna.externalId ? mrna.externalId : rna.name; |
3449 |
28 Jul 15 |
olle |
text += '<div class="rna">'+name+'</div>'; |
3449 |
28 Jul 15 |
olle |
text += '<div class="box">'+Strings.encodeTags(Protocol.getPlateCoordinate(rna, true))+'</div>'; |
3449 |
28 Jul 15 |
olle |
text += '<div class="remain">'+Numbers.formatNumber(rna.remainingQuantity, 2, 'µg')+'</div>'; |
3449 |
28 Jul 15 |
olle |
text += '<div class="ndconc">'+Numbers.formatNumber(rna.NDConc, 2, 'ng/µl') + '</div>'; |
3449 |
28 Jul 15 |
olle |
355 |
|
3449 |
28 Jul 15 |
olle |
if (rna.volume >= 0 && rna.water >= 0) |
3449 |
28 Jul 15 |
olle |
357 |
{ |
3449 |
28 Jul 15 |
olle |
text += '<div><span class="volume">'+Numbers.formatNumber(rna.volume, 1)+'µl</span>'; |
3449 |
28 Jul 15 |
olle |
text += '<span class="water">'+(rna.preNormalized ? '—' : Numbers.formatNumber(rna.water, 1)+'µl')+'</span></div>'; |
3449 |
28 Jul 15 |
olle |
360 |
} |
3449 |
28 Jul 15 |
olle |
text += '<div class="remarks">'+ rna.remarks.join('; ') + '</div>'; |
3449 |
28 Jul 15 |
olle |
362 |
} |
3449 |
28 Jul 15 |
olle |
return text; |
3449 |
28 Jul 15 |
olle |
364 |
} |
3449 |
28 Jul 15 |
olle |
365 |
|
3449 |
28 Jul 15 |
olle |
return painter; |
3449 |
28 Jul 15 |
olle |
367 |
}(); |
3449 |
28 Jul 15 |
olle |
368 |
|