1807 |
23 Jan 13 |
nicklas |
1 |
|
1807 |
23 Jan 13 |
nicklas |
var POOL_NAMES = |
1807 |
23 Jan 13 |
nicklas |
['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix', 'x', 'xi', 'xii' ]; |
1807 |
23 Jan 13 |
nicklas |
4 |
|
3809 |
22 Mar 16 |
nicklas |
var BC_1_8 = ['AD001', 'AD002', 'AD003', 'AD004', 'AD005', 'AD006', 'AD007', 'AD008']; |
3809 |
22 Mar 16 |
nicklas |
var BC_8_1 = ['AD008', 'AD007', 'AD006', 'AD005', 'AD004', 'AD003', 'AD002', 'AD001']; |
3809 |
22 Mar 16 |
nicklas |
var BC_9_16 = ['AD009', 'AD010', 'AD011', 'AD012', 'AD013', 'AD014', 'AD015', 'AD016']; |
3809 |
22 Mar 16 |
nicklas |
var BC_16_9 = ['AD016', 'AD015', 'AD014', 'AD013', 'AD012', 'AD011', 'AD010', 'AD009']; |
3809 |
22 Mar 16 |
nicklas |
var BC_18_27 = ['AD018', 'AD019', 'AD020', 'AD021', 'AD022', 'AD023', 'AD025', 'AD027']; |
3809 |
22 Mar 16 |
nicklas |
var BC_27_18 = ['AD027', 'AD025', 'AD023', 'AD022', 'AD021', 'AD020', 'AD019', 'AD018']; |
1814 |
30 Jan 13 |
nicklas |
11 |
|
1809 |
25 Jan 13 |
nicklas |
// Index Sets = IS |
1814 |
30 Jan 13 |
nicklas |
var IS_G1 = {color: 'bg-green', barcodes: BC_1_8}; |
1814 |
30 Jan 13 |
nicklas |
var IS_G2 = {color: 'bg-green', barcodes: BC_9_16}; |
1814 |
30 Jan 13 |
nicklas |
var IS_G3 = {color: 'bg-green', barcodes: BC_18_27}; |
1809 |
25 Jan 13 |
nicklas |
16 |
|
2218 |
10 Feb 14 |
nicklas |
var IS_G4 = {color: 'bg-green-dk', barcodes: BC_8_1}; |
2218 |
10 Feb 14 |
nicklas |
var IS_G5 = {color: 'bg-green-dk', barcodes: BC_16_9}; |
2218 |
10 Feb 14 |
nicklas |
var IS_G6 = {color: 'bg-green-dk', barcodes: BC_27_18}; |
2218 |
10 Feb 14 |
nicklas |
20 |
|
1814 |
30 Jan 13 |
nicklas |
var IS_B1 = {color: 'bg-blue', barcodes: BC_1_8}; |
1814 |
30 Jan 13 |
nicklas |
var IS_B2 = {color: 'bg-blue', barcodes: BC_9_16}; |
1814 |
30 Jan 13 |
nicklas |
var IS_B3 = {color: 'bg-blue', barcodes: BC_18_27}; |
1809 |
25 Jan 13 |
nicklas |
24 |
|
2218 |
10 Feb 14 |
nicklas |
var IS_B4 = {color: 'bg-blue-dk', barcodes: BC_8_1}; |
2218 |
10 Feb 14 |
nicklas |
var IS_B5 = {color: 'bg-blue-dk', barcodes: BC_16_9}; |
2218 |
10 Feb 14 |
nicklas |
var IS_B6 = {color: 'bg-blue-dk', barcodes: BC_27_18}; |
2218 |
10 Feb 14 |
nicklas |
28 |
|
1814 |
30 Jan 13 |
nicklas |
var IS_Y1 = {color: 'bg-yellow', barcodes: BC_1_8}; |
1814 |
30 Jan 13 |
nicklas |
var IS_Y2 = {color: 'bg-yellow', barcodes: BC_9_16}; |
1814 |
30 Jan 13 |
nicklas |
var IS_Y3 = {color: 'bg-yellow', barcodes: BC_18_27}; |
1814 |
30 Jan 13 |
nicklas |
32 |
|
2218 |
10 Feb 14 |
nicklas |
var IS_Y4 = {color: 'bg-yellow-dk', barcodes: BC_8_1}; |
2218 |
10 Feb 14 |
nicklas |
var IS_Y5 = {color: 'bg-yellow-dk', barcodes: BC_16_9}; |
2218 |
10 Feb 14 |
nicklas |
var IS_Y6 = {color: 'bg-yellow-dk', barcodes: BC_27_18}; |
1814 |
30 Jan 13 |
nicklas |
36 |
|
1807 |
23 Jan 13 |
nicklas |
var POOL_SCHEMA = |
1807 |
23 Jan 13 |
nicklas |
38 |
[ |
1807 |
23 Jan 13 |
nicklas |
39 |
{ |
4426 |
27 Mar 17 |
nicklas |
id: '1by24offset', |
4426 |
27 Mar 17 |
nicklas |
name: '1 pool × 24 samples (offset)', |
4426 |
27 Mar 17 |
nicklas |
type: 'manual', |
4426 |
27 Mar 17 |
nicklas |
numPools: 1, |
4426 |
27 Mar 17 |
nicklas |
numWellsPerPool: 24, |
4426 |
27 Mar 17 |
nicklas |
columnClasses: ['pool-left', 'pool-middle', 'pool-right'], |
4426 |
27 Mar 17 |
nicklas |
barcodeVariants: |
4426 |
27 Mar 17 |
nicklas |
47 |
[ |
4426 |
27 Mar 17 |
nicklas |
{name: 'A', indexSets: [null, null, IS_G1, IS_B2, IS_Y3, null, null, null, null, null, null, null]} |
4426 |
27 Mar 17 |
nicklas |
49 |
], |
4426 |
27 Mar 17 |
nicklas |
50 |
|
4426 |
27 Mar 17 |
nicklas |
getPoolNumForColumn: function(colNum) |
4426 |
27 Mar 17 |
nicklas |
52 |
{ |
4426 |
27 Mar 17 |
nicklas |
var poolNum = -1; |
4426 |
27 Mar 17 |
nicklas |
if (colNum >= 2 && colNum <= 4) |
4426 |
27 Mar 17 |
nicklas |
55 |
{ |
4426 |
27 Mar 17 |
nicklas |
poolNum = 0; |
4426 |
27 Mar 17 |
nicklas |
57 |
} |
4426 |
27 Mar 17 |
nicklas |
return poolNum; |
4426 |
27 Mar 17 |
nicklas |
59 |
}, |
4426 |
27 Mar 17 |
nicklas |
60 |
|
4426 |
27 Mar 17 |
nicklas |
getClassNameForWell: function(well) |
4426 |
27 Mar 17 |
nicklas |
62 |
{ |
4426 |
27 Mar 17 |
nicklas |
var c = well.column; |
4426 |
27 Mar 17 |
nicklas |
var cls = (c >= 2 && c <= 4) ? 'primary ' : 'secondary '; |
4426 |
27 Mar 17 |
nicklas |
cls += (c >= 1 && c <= 5) ? this.columnClasses[(c+1) % 3] : ''; |
4426 |
27 Mar 17 |
nicklas |
return cls; |
4426 |
27 Mar 17 |
nicklas |
67 |
}, |
4426 |
27 Mar 17 |
nicklas |
68 |
|
4426 |
27 Mar 17 |
nicklas |
getWellsInPool: function(plate, poolNum) |
4426 |
27 Mar 17 |
nicklas |
70 |
{ |
4426 |
27 Mar 17 |
nicklas |
var result = []; |
4426 |
27 Mar 17 |
nicklas |
var index = poolNum*this.numWellsPerPool+2*plate.rows; |
4426 |
27 Mar 17 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
4426 |
27 Mar 17 |
nicklas |
74 |
{ |
4426 |
27 Mar 17 |
nicklas |
result[result.length] = plate.wells[index]; |
4426 |
27 Mar 17 |
nicklas |
index++; |
4426 |
27 Mar 17 |
nicklas |
77 |
} |
4426 |
27 Mar 17 |
nicklas |
return result; |
4426 |
27 Mar 17 |
nicklas |
79 |
} |
4426 |
27 Mar 17 |
nicklas |
80 |
}, |
4426 |
27 Mar 17 |
nicklas |
81 |
{ |
4426 |
27 Mar 17 |
nicklas |
id: '2by24offset', |
4426 |
27 Mar 17 |
nicklas |
name: '2 pool × 24 samples (offset)', |
4426 |
27 Mar 17 |
nicklas |
type: 'manual', |
4426 |
27 Mar 17 |
nicklas |
numPools: 2, |
4426 |
27 Mar 17 |
nicklas |
numWellsPerPool: 24, |
4426 |
27 Mar 17 |
nicklas |
columnClasses: ['pool-left', 'pool-middle', 'pool-right'], |
4426 |
27 Mar 17 |
nicklas |
barcodeVariants: |
4426 |
27 Mar 17 |
nicklas |
89 |
[ |
4426 |
27 Mar 17 |
nicklas |
{name: 'A-A', indexSets: [null, null, IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3, null, null, null, null]} |
4426 |
27 Mar 17 |
nicklas |
91 |
], |
4426 |
27 Mar 17 |
nicklas |
92 |
|
4426 |
27 Mar 17 |
nicklas |
getPoolNumForColumn: function(colNum) |
4426 |
27 Mar 17 |
nicklas |
94 |
{ |
4426 |
27 Mar 17 |
nicklas |
var poolNum = -1; |
4426 |
27 Mar 17 |
nicklas |
if (colNum >= 2 && colNum <= 7) |
4426 |
27 Mar 17 |
nicklas |
97 |
{ |
4426 |
27 Mar 17 |
nicklas |
poolNum = Math.floor((colNum - 2) / 3); |
4426 |
27 Mar 17 |
nicklas |
99 |
} |
4426 |
27 Mar 17 |
nicklas |
return poolNum; |
4426 |
27 Mar 17 |
nicklas |
101 |
}, |
4426 |
27 Mar 17 |
nicklas |
102 |
|
4426 |
27 Mar 17 |
nicklas |
getClassNameForWell: function(well) |
4426 |
27 Mar 17 |
nicklas |
104 |
{ |
4426 |
27 Mar 17 |
nicklas |
var c = well.column; |
4426 |
27 Mar 17 |
nicklas |
var cls = (c >= 2 && c <= 7) ? 'primary ' : 'secondary '; |
4426 |
27 Mar 17 |
nicklas |
cls += (c >= 1 && c <= 8) ? this.columnClasses[(c+1) % 3] : ''; |
4426 |
27 Mar 17 |
nicklas |
return cls; |
4426 |
27 Mar 17 |
nicklas |
109 |
}, |
4426 |
27 Mar 17 |
nicklas |
110 |
|
4426 |
27 Mar 17 |
nicklas |
getWellsInPool: function(plate, poolNum) |
4426 |
27 Mar 17 |
nicklas |
112 |
{ |
4426 |
27 Mar 17 |
nicklas |
var result = []; |
4426 |
27 Mar 17 |
nicklas |
var index = poolNum*this.numWellsPerPool+2*plate.rows; |
4426 |
27 Mar 17 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
4426 |
27 Mar 17 |
nicklas |
116 |
{ |
4426 |
27 Mar 17 |
nicklas |
result[result.length] = plate.wells[index]; |
4426 |
27 Mar 17 |
nicklas |
index++; |
4426 |
27 Mar 17 |
nicklas |
119 |
} |
4426 |
27 Mar 17 |
nicklas |
return result; |
4426 |
27 Mar 17 |
nicklas |
121 |
} |
4426 |
27 Mar 17 |
nicklas |
122 |
}, |
4426 |
27 Mar 17 |
nicklas |
123 |
{ |
1807 |
23 Jan 13 |
nicklas |
id: '4by24', |
1807 |
23 Jan 13 |
nicklas |
name: '4 pools × 24 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
1807 |
23 Jan 13 |
nicklas |
numPools: 4, |
1807 |
23 Jan 13 |
nicklas |
numWellsPerPool: 24, |
1807 |
23 Jan 13 |
nicklas |
columnClasses: ['pool-left', 'pool-middle', 'pool-right'], |
1809 |
25 Jan 13 |
nicklas |
barcodeVariants: |
1809 |
25 Jan 13 |
nicklas |
131 |
[ |
2218 |
10 Feb 14 |
nicklas |
132 |
{ |
2218 |
10 Feb 14 |
nicklas |
name: 'A-B-C-D', |
2218 |
10 Feb 14 |
nicklas |
indexSets: [IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y6, IS_G4, IS_B5, IS_Y3, IS_G4, IS_B5, IS_Y6] |
2218 |
10 Feb 14 |
nicklas |
135 |
}, |
2218 |
10 Feb 14 |
nicklas |
136 |
{ |
2218 |
10 Feb 14 |
nicklas |
name: 'A-A-A-A', |
2218 |
10 Feb 14 |
nicklas |
indexSets: [IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3] |
2218 |
10 Feb 14 |
nicklas |
139 |
}, |
2218 |
10 Feb 14 |
nicklas |
140 |
{ |
2218 |
10 Feb 14 |
nicklas |
/* Same as A-A-A-A, kept for backwards compatibility */ |
2218 |
10 Feb 14 |
nicklas |
name: 'FULL', |
2218 |
10 Feb 14 |
nicklas |
disabled: 1, |
2218 |
10 Feb 14 |
nicklas |
indexSets: [IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3, IS_G1, IS_B2, IS_Y3] |
2218 |
10 Feb 14 |
nicklas |
145 |
} |
1809 |
25 Jan 13 |
nicklas |
146 |
], |
1807 |
23 Jan 13 |
nicklas |
147 |
|
1807 |
23 Jan 13 |
nicklas |
getPoolNumForColumn: function(colNum) |
1807 |
23 Jan 13 |
nicklas |
149 |
{ |
1807 |
23 Jan 13 |
nicklas |
var poolNum = Math.floor(colNum / 3); |
1807 |
23 Jan 13 |
nicklas |
return poolNum; |
1807 |
23 Jan 13 |
nicklas |
152 |
}, |
1807 |
23 Jan 13 |
nicklas |
153 |
|
1807 |
23 Jan 13 |
nicklas |
getClassNameForWell: function(well) |
1807 |
23 Jan 13 |
nicklas |
155 |
{ |
1807 |
23 Jan 13 |
nicklas |
var c = well.column; |
1807 |
23 Jan 13 |
nicklas |
var cls = 'primary '; |
1807 |
23 Jan 13 |
nicklas |
cls += this.columnClasses[c % 3]; |
1807 |
23 Jan 13 |
nicklas |
return cls; |
1807 |
23 Jan 13 |
nicklas |
160 |
}, |
1807 |
23 Jan 13 |
nicklas |
161 |
|
1807 |
23 Jan 13 |
nicklas |
getWellsInPool: function(plate, poolNum) |
1807 |
23 Jan 13 |
nicklas |
163 |
{ |
1807 |
23 Jan 13 |
nicklas |
var result = []; |
1807 |
23 Jan 13 |
nicklas |
var index = poolNum * this.numWellsPerPool; |
1807 |
23 Jan 13 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
1807 |
23 Jan 13 |
nicklas |
167 |
{ |
1807 |
23 Jan 13 |
nicklas |
result[result.length] = plate.wells[index]; |
1807 |
23 Jan 13 |
nicklas |
index++; |
1807 |
23 Jan 13 |
nicklas |
170 |
} |
1807 |
23 Jan 13 |
nicklas |
return result; |
1807 |
23 Jan 13 |
nicklas |
172 |
} |
1807 |
23 Jan 13 |
nicklas |
173 |
|
1807 |
23 Jan 13 |
nicklas |
174 |
}, |
1807 |
23 Jan 13 |
nicklas |
175 |
{ |
3235 |
10 Apr 15 |
nicklas |
id: '1by16', |
3235 |
10 Apr 15 |
nicklas |
name: '1 pool × 16 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
3235 |
10 Apr 15 |
nicklas |
numPools: 1, |
3235 |
10 Apr 15 |
nicklas |
numWellsPerPool: 16, |
3235 |
10 Apr 15 |
nicklas |
columnClasses: ['pool-right', 'pool-left'], |
3235 |
10 Apr 15 |
nicklas |
barcodeVariants: |
3235 |
10 Apr 15 |
nicklas |
183 |
[ |
3235 |
10 Apr 15 |
nicklas |
{name: 'A', indexSets: [null, null, null, null, null, IS_G1, IS_G2, null, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'B', indexSets: [null, null, null, null, null, IS_B2, IS_B3, null, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'C', indexSets: [null, null, null, null, null, IS_Y3, IS_Y1, null, null, null, null, null]} |
3235 |
10 Apr 15 |
nicklas |
187 |
], |
3235 |
10 Apr 15 |
nicklas |
188 |
|
3235 |
10 Apr 15 |
nicklas |
getPoolNumForColumn: function(colNum) |
3235 |
10 Apr 15 |
nicklas |
190 |
{ |
3235 |
10 Apr 15 |
nicklas |
var poolNum = -1; |
3235 |
10 Apr 15 |
nicklas |
if (colNum == 5 || colNum == 6) |
3235 |
10 Apr 15 |
nicklas |
193 |
{ |
3235 |
10 Apr 15 |
nicklas |
poolNum = 0; |
3235 |
10 Apr 15 |
nicklas |
195 |
} |
3235 |
10 Apr 15 |
nicklas |
return poolNum; |
3235 |
10 Apr 15 |
nicklas |
197 |
}, |
3235 |
10 Apr 15 |
nicklas |
198 |
|
3235 |
10 Apr 15 |
nicklas |
getClassNameForWell: function(well) |
3235 |
10 Apr 15 |
nicklas |
200 |
{ |
3235 |
10 Apr 15 |
nicklas |
var c = well.column; |
3235 |
10 Apr 15 |
nicklas |
var cls = (c == 5 || c == 6) ? 'primary ' : 'secondary '; |
3235 |
10 Apr 15 |
nicklas |
cls += (c >= 4 && c <= 7) ? this.columnClasses[c % 2] : ''; |
3235 |
10 Apr 15 |
nicklas |
return cls; |
3235 |
10 Apr 15 |
nicklas |
205 |
}, |
3235 |
10 Apr 15 |
nicklas |
206 |
|
3235 |
10 Apr 15 |
nicklas |
getWellsInPool: function(plate, poolNum) |
3235 |
10 Apr 15 |
nicklas |
208 |
{ |
3235 |
10 Apr 15 |
nicklas |
var result = []; |
3235 |
10 Apr 15 |
nicklas |
var index = poolNum*this.numWellsPerPool+5*plate.rows; |
3235 |
10 Apr 15 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
3235 |
10 Apr 15 |
nicklas |
212 |
{ |
3235 |
10 Apr 15 |
nicklas |
result[result.length] = plate.wells[index]; |
3235 |
10 Apr 15 |
nicklas |
index++; |
3235 |
10 Apr 15 |
nicklas |
215 |
} |
3235 |
10 Apr 15 |
nicklas |
return result; |
3235 |
10 Apr 15 |
nicklas |
217 |
} |
3235 |
10 Apr 15 |
nicklas |
218 |
}, |
3235 |
10 Apr 15 |
nicklas |
219 |
{ |
3510 |
24 Sep 15 |
nicklas |
id: '1by16offset', |
3510 |
24 Sep 15 |
nicklas |
name: '1 pool × 16 samples (offset)', |
3510 |
24 Sep 15 |
nicklas |
type: 'manual', |
3510 |
24 Sep 15 |
nicklas |
numPools: 1, |
3510 |
24 Sep 15 |
nicklas |
numWellsPerPool: 16, |
3510 |
24 Sep 15 |
nicklas |
columnClasses: ['pool-left', 'pool-right'], |
3510 |
24 Sep 15 |
nicklas |
barcodeVariants: |
3510 |
24 Sep 15 |
nicklas |
227 |
[ |
3510 |
24 Sep 15 |
nicklas |
{name: 'A', indexSets: [null, null, IS_G1, IS_G2, null, null, null, null, null, null, null, null]}, |
3510 |
24 Sep 15 |
nicklas |
{name: 'B', indexSets: [null, null, IS_B2, IS_B3, null, null, null, null, null, null, null, null]}, |
3510 |
24 Sep 15 |
nicklas |
{name: 'C', indexSets: [null, null, IS_Y3, IS_Y1, null, null, null, null, null, null, null, null]} |
3510 |
24 Sep 15 |
nicklas |
231 |
], |
3510 |
24 Sep 15 |
nicklas |
232 |
|
3510 |
24 Sep 15 |
nicklas |
getPoolNumForColumn: function(colNum) |
3510 |
24 Sep 15 |
nicklas |
234 |
{ |
3510 |
24 Sep 15 |
nicklas |
var poolNum = -1; |
3510 |
24 Sep 15 |
nicklas |
if (colNum == 2 || colNum == 3) |
3510 |
24 Sep 15 |
nicklas |
237 |
{ |
3510 |
24 Sep 15 |
nicklas |
poolNum = 0; |
3510 |
24 Sep 15 |
nicklas |
239 |
} |
3510 |
24 Sep 15 |
nicklas |
return poolNum; |
3510 |
24 Sep 15 |
nicklas |
241 |
}, |
3510 |
24 Sep 15 |
nicklas |
242 |
|
3510 |
24 Sep 15 |
nicklas |
getClassNameForWell: function(well) |
3510 |
24 Sep 15 |
nicklas |
244 |
{ |
3510 |
24 Sep 15 |
nicklas |
var c = well.column; |
3510 |
24 Sep 15 |
nicklas |
var cls = (c == 2 || c == 3) ? 'primary ' : 'secondary '; |
3510 |
24 Sep 15 |
nicklas |
cls += (c >= 1 && c <= 4) ? this.columnClasses[c % 2] : ''; |
3510 |
24 Sep 15 |
nicklas |
return cls; |
3510 |
24 Sep 15 |
nicklas |
249 |
}, |
3510 |
24 Sep 15 |
nicklas |
250 |
|
3510 |
24 Sep 15 |
nicklas |
getWellsInPool: function(plate, poolNum) |
3510 |
24 Sep 15 |
nicklas |
252 |
{ |
3510 |
24 Sep 15 |
nicklas |
var result = []; |
3510 |
24 Sep 15 |
nicklas |
var index = poolNum*this.numWellsPerPool+2*plate.rows; |
3510 |
24 Sep 15 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
3510 |
24 Sep 15 |
nicklas |
256 |
{ |
3510 |
24 Sep 15 |
nicklas |
result[result.length] = plate.wells[index]; |
3510 |
24 Sep 15 |
nicklas |
index++; |
3510 |
24 Sep 15 |
nicklas |
259 |
} |
3510 |
24 Sep 15 |
nicklas |
return result; |
3510 |
24 Sep 15 |
nicklas |
261 |
} |
3510 |
24 Sep 15 |
nicklas |
262 |
}, |
3510 |
24 Sep 15 |
nicklas |
263 |
{ |
3235 |
10 Apr 15 |
nicklas |
id: '2by16', |
3235 |
10 Apr 15 |
nicklas |
name: '2 pools × 16 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
3235 |
10 Apr 15 |
nicklas |
numPools: 2, |
1807 |
23 Jan 13 |
nicklas |
numWellsPerPool: 16, |
1807 |
23 Jan 13 |
nicklas |
columnClasses: ['pool-left', 'pool-right'], |
1809 |
25 Jan 13 |
nicklas |
barcodeVariants: |
1809 |
25 Jan 13 |
nicklas |
271 |
[ |
3235 |
10 Apr 15 |
nicklas |
{name: 'A-B', indexSets: [null, null, null, null, IS_G1, IS_G2, IS_B3, IS_B1, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'B-C', indexSets: [null, null, null, null, IS_B3, IS_B1, IS_Y2, IS_Y3, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'C-A', indexSets: [null, null, null, null, IS_Y2, IS_Y3, IS_G1, IS_G2, null, null, null, null]} |
1809 |
25 Jan 13 |
nicklas |
275 |
], |
1807 |
23 Jan 13 |
nicklas |
276 |
|
1807 |
23 Jan 13 |
nicklas |
getPoolNumForColumn: function(colNum) |
1807 |
23 Jan 13 |
nicklas |
278 |
{ |
1807 |
23 Jan 13 |
nicklas |
var poolNum = -1; |
3235 |
10 Apr 15 |
nicklas |
if (colNum >= 4 && colNum <= 7) |
1807 |
23 Jan 13 |
nicklas |
281 |
{ |
3235 |
10 Apr 15 |
nicklas |
poolNum = Math.floor((colNum - 4) / 2); |
1807 |
23 Jan 13 |
nicklas |
283 |
} |
1807 |
23 Jan 13 |
nicklas |
return poolNum; |
1807 |
23 Jan 13 |
nicklas |
285 |
}, |
1807 |
23 Jan 13 |
nicklas |
286 |
|
1807 |
23 Jan 13 |
nicklas |
getClassNameForWell: function(well) |
1807 |
23 Jan 13 |
nicklas |
288 |
{ |
1807 |
23 Jan 13 |
nicklas |
var c = well.column; |
3235 |
10 Apr 15 |
nicklas |
var cls = (c >= 4 && c <= 7) ? 'primary ' : 'secondary '; |
3235 |
10 Apr 15 |
nicklas |
if (c >= 3 && c <= 8) cls += this.columnClasses[c % 2]; |
1807 |
23 Jan 13 |
nicklas |
return cls; |
1807 |
23 Jan 13 |
nicklas |
293 |
}, |
1807 |
23 Jan 13 |
nicklas |
294 |
|
1807 |
23 Jan 13 |
nicklas |
getWellsInPool: function(plate, poolNum) |
1807 |
23 Jan 13 |
nicklas |
296 |
{ |
1807 |
23 Jan 13 |
nicklas |
var result = []; |
3235 |
10 Apr 15 |
nicklas |
var index = poolNum*this.numWellsPerPool + 4 * plate.rows; |
1807 |
23 Jan 13 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
1807 |
23 Jan 13 |
nicklas |
300 |
{ |
1807 |
23 Jan 13 |
nicklas |
result[result.length] = plate.wells[index]; |
1807 |
23 Jan 13 |
nicklas |
index++; |
1807 |
23 Jan 13 |
nicklas |
303 |
} |
1807 |
23 Jan 13 |
nicklas |
return result; |
1807 |
23 Jan 13 |
nicklas |
305 |
} |
1807 |
23 Jan 13 |
nicklas |
306 |
}, |
1807 |
23 Jan 13 |
nicklas |
307 |
{ |
4555 |
29 Aug 17 |
nicklas |
id: '2by16offset', |
4555 |
29 Aug 17 |
nicklas |
name: '2 pool × 16 samples (offset)', |
4555 |
29 Aug 17 |
nicklas |
type: 'manual', |
4555 |
29 Aug 17 |
nicklas |
numPools: 2, |
4555 |
29 Aug 17 |
nicklas |
numWellsPerPool: 16, |
4555 |
29 Aug 17 |
nicklas |
columnClasses: ['pool-left', 'pool-right'], |
4555 |
29 Aug 17 |
nicklas |
barcodeVariants: |
4555 |
29 Aug 17 |
nicklas |
315 |
[ |
4555 |
29 Aug 17 |
nicklas |
{name: 'A-B', indexSets: [null, null, IS_G1, IS_G2, IS_B3, IS_B1, null, null, null, null, null, null]}, |
4555 |
29 Aug 17 |
nicklas |
{name: 'B-C', indexSets: [null, null, IS_B3, IS_B1, IS_Y2, IS_Y3, null, null, null, null, null, null]}, |
4555 |
29 Aug 17 |
nicklas |
{name: 'C-A', indexSets: [null, null, IS_Y2, IS_Y3, IS_G1, IS_G2, null, null, null, null, null, null]} |
4555 |
29 Aug 17 |
nicklas |
319 |
], |
4555 |
29 Aug 17 |
nicklas |
320 |
|
4555 |
29 Aug 17 |
nicklas |
getPoolNumForColumn: function(colNum) |
4555 |
29 Aug 17 |
nicklas |
322 |
{ |
4555 |
29 Aug 17 |
nicklas |
var poolNum = -1; |
4555 |
29 Aug 17 |
nicklas |
if (colNum >= 2 && colNum <= 5) |
4555 |
29 Aug 17 |
nicklas |
325 |
{ |
4555 |
29 Aug 17 |
nicklas |
poolNum = Math.floor((colNum - 2) / 2); |
4555 |
29 Aug 17 |
nicklas |
327 |
} |
4555 |
29 Aug 17 |
nicklas |
return poolNum; |
4555 |
29 Aug 17 |
nicklas |
329 |
}, |
4555 |
29 Aug 17 |
nicklas |
330 |
|
4555 |
29 Aug 17 |
nicklas |
getClassNameForWell: function(well) |
4555 |
29 Aug 17 |
nicklas |
332 |
{ |
4555 |
29 Aug 17 |
nicklas |
var c = well.column; |
4555 |
29 Aug 17 |
nicklas |
var cls = (c >= 2 && c <= 5) ? 'primary ' : 'secondary '; |
4555 |
29 Aug 17 |
nicklas |
if (c >= 1 && c <= 6) cls += this.columnClasses[c % 2]; |
4555 |
29 Aug 17 |
nicklas |
return cls; |
4555 |
29 Aug 17 |
nicklas |
337 |
}, |
4555 |
29 Aug 17 |
nicklas |
338 |
|
4555 |
29 Aug 17 |
nicklas |
getWellsInPool: function(plate, poolNum) |
4555 |
29 Aug 17 |
nicklas |
340 |
{ |
4555 |
29 Aug 17 |
nicklas |
var result = []; |
4555 |
29 Aug 17 |
nicklas |
var index = poolNum*this.numWellsPerPool + 2*plate.rows; |
4555 |
29 Aug 17 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
4555 |
29 Aug 17 |
nicklas |
344 |
{ |
4555 |
29 Aug 17 |
nicklas |
result[result.length] = plate.wells[index]; |
4555 |
29 Aug 17 |
nicklas |
index++; |
4555 |
29 Aug 17 |
nicklas |
347 |
} |
4555 |
29 Aug 17 |
nicklas |
return result; |
4555 |
29 Aug 17 |
nicklas |
349 |
} |
4555 |
29 Aug 17 |
nicklas |
350 |
}, |
4555 |
29 Aug 17 |
nicklas |
351 |
{ |
3235 |
10 Apr 15 |
nicklas |
id: '3by16', |
3235 |
10 Apr 15 |
nicklas |
name: '3 pools × 16 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
3235 |
10 Apr 15 |
nicklas |
numPools: 3, |
1807 |
23 Jan 13 |
nicklas |
numWellsPerPool: 16, |
1807 |
23 Jan 13 |
nicklas |
columnClasses: ['pool-right', 'pool-left'], |
1809 |
25 Jan 13 |
nicklas |
barcodeVariants: |
1809 |
25 Jan 13 |
nicklas |
359 |
[ |
3235 |
10 Apr 15 |
nicklas |
{name: 'A-B-C', indexSets: [null, null, null, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'B-C-A', indexSets: [null, null, null, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, null, null, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'C-A-B', indexSets: [null, null, null, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B2, null, null, null, null]} |
1809 |
25 Jan 13 |
nicklas |
363 |
], |
3235 |
10 Apr 15 |
nicklas |
364 |
|
1807 |
23 Jan 13 |
nicklas |
getPoolNumForColumn: function(colNum) |
1807 |
23 Jan 13 |
nicklas |
366 |
{ |
1807 |
23 Jan 13 |
nicklas |
var poolNum = -1; |
3235 |
10 Apr 15 |
nicklas |
if (colNum >= 3 && colNum <= 8) |
1807 |
23 Jan 13 |
nicklas |
369 |
{ |
3235 |
10 Apr 15 |
nicklas |
poolNum = Math.floor((colNum - 3) / 2); |
1807 |
23 Jan 13 |
nicklas |
371 |
} |
1807 |
23 Jan 13 |
nicklas |
return poolNum; |
1807 |
23 Jan 13 |
nicklas |
373 |
}, |
3235 |
10 Apr 15 |
nicklas |
374 |
|
1807 |
23 Jan 13 |
nicklas |
getClassNameForWell: function(well) |
1807 |
23 Jan 13 |
nicklas |
376 |
{ |
1807 |
23 Jan 13 |
nicklas |
var c = well.column; |
3235 |
10 Apr 15 |
nicklas |
var cls = (c >= 3 && c <= 8) ? 'primary ' : 'secondary '; |
3235 |
10 Apr 15 |
nicklas |
if (c >= 2 && c <= 9) cls += this.columnClasses[c % 2]; |
1807 |
23 Jan 13 |
nicklas |
return cls; |
1807 |
23 Jan 13 |
nicklas |
381 |
}, |
3235 |
10 Apr 15 |
nicklas |
382 |
|
3235 |
10 Apr 15 |
nicklas |
getWellsInPool: function(plate, poolNum) |
3235 |
10 Apr 15 |
nicklas |
384 |
{ |
3235 |
10 Apr 15 |
nicklas |
var result = []; |
3235 |
10 Apr 15 |
nicklas |
var index = poolNum*this.numWellsPerPool + 3 * plate.rows; |
3235 |
10 Apr 15 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
3235 |
10 Apr 15 |
nicklas |
388 |
{ |
3235 |
10 Apr 15 |
nicklas |
result[result.length] = plate.wells[index]; |
3235 |
10 Apr 15 |
nicklas |
index++; |
3235 |
10 Apr 15 |
nicklas |
391 |
} |
3235 |
10 Apr 15 |
nicklas |
return result; |
3235 |
10 Apr 15 |
nicklas |
393 |
} |
3235 |
10 Apr 15 |
nicklas |
394 |
}, |
3235 |
10 Apr 15 |
nicklas |
395 |
{ |
3235 |
10 Apr 15 |
nicklas |
id: '4by16', |
3235 |
10 Apr 15 |
nicklas |
name: '4 pools × 16 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
3235 |
10 Apr 15 |
nicklas |
numPools: 4, |
3235 |
10 Apr 15 |
nicklas |
numWellsPerPool: 16, |
3235 |
10 Apr 15 |
nicklas |
columnClasses: ['pool-left', 'pool-right'], |
3235 |
10 Apr 15 |
nicklas |
barcodeVariants: |
3235 |
10 Apr 15 |
nicklas |
403 |
[ |
3235 |
10 Apr 15 |
nicklas |
{name: 'A-B-C-A', indexSets: [null, null, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'B-C-A-B', indexSets: [null, null, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B1, null, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'C-A-B-C', indexSets: [null, null, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, null, null]} |
3235 |
10 Apr 15 |
nicklas |
407 |
], |
3235 |
10 Apr 15 |
nicklas |
408 |
|
3235 |
10 Apr 15 |
nicklas |
getPoolNumForColumn: function(colNum) |
3235 |
10 Apr 15 |
nicklas |
410 |
{ |
3235 |
10 Apr 15 |
nicklas |
var poolNum = -1; |
3235 |
10 Apr 15 |
nicklas |
if (colNum >= 2 && colNum <= 9) |
3235 |
10 Apr 15 |
nicklas |
413 |
{ |
3235 |
10 Apr 15 |
nicklas |
poolNum = Math.floor((colNum - 2) / 2); |
3235 |
10 Apr 15 |
nicklas |
415 |
} |
3235 |
10 Apr 15 |
nicklas |
return poolNum; |
3235 |
10 Apr 15 |
nicklas |
417 |
}, |
3235 |
10 Apr 15 |
nicklas |
418 |
|
3235 |
10 Apr 15 |
nicklas |
getClassNameForWell: function(well) |
3235 |
10 Apr 15 |
nicklas |
420 |
{ |
3235 |
10 Apr 15 |
nicklas |
var c = well.column; |
3235 |
10 Apr 15 |
nicklas |
var cls = (c >= 2 && c <= 9) ? 'primary ' : 'secondary '; |
3235 |
10 Apr 15 |
nicklas |
if (c >= 1 && c <= 10) cls += this.columnClasses[c % 2]; |
3235 |
10 Apr 15 |
nicklas |
return cls; |
3235 |
10 Apr 15 |
nicklas |
425 |
}, |
1807 |
23 Jan 13 |
nicklas |
426 |
|
1807 |
23 Jan 13 |
nicklas |
getWellsInPool: function(plate, poolNum) |
1807 |
23 Jan 13 |
nicklas |
428 |
{ |
1807 |
23 Jan 13 |
nicklas |
var result = []; |
3235 |
10 Apr 15 |
nicklas |
var index = poolNum*this.numWellsPerPool + 2 * plate.rows; |
1807 |
23 Jan 13 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
1807 |
23 Jan 13 |
nicklas |
432 |
{ |
1807 |
23 Jan 13 |
nicklas |
result[result.length] = plate.wells[index]; |
1807 |
23 Jan 13 |
nicklas |
index++; |
1807 |
23 Jan 13 |
nicklas |
435 |
} |
1807 |
23 Jan 13 |
nicklas |
return result; |
1807 |
23 Jan 13 |
nicklas |
437 |
} |
3235 |
10 Apr 15 |
nicklas |
438 |
}, |
2838 |
20 Oct 14 |
nicklas |
439 |
{ |
3235 |
10 Apr 15 |
nicklas |
id: '5by16', |
3235 |
10 Apr 15 |
nicklas |
name: '5 pools × 16 samples', |
3289 |
30 Apr 15 |
nicklas |
type: 'manual', |
3235 |
10 Apr 15 |
nicklas |
numPools: 5, |
2838 |
20 Oct 14 |
nicklas |
numWellsPerPool: 16, |
2838 |
20 Oct 14 |
nicklas |
columnClasses: ['pool-right', 'pool-left'], |
2838 |
20 Oct 14 |
nicklas |
barcodeVariants: |
2838 |
20 Oct 14 |
nicklas |
447 |
[ |
3235 |
10 Apr 15 |
nicklas |
{name: 'A-B-C-A-B', indexSets: [null, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B1, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'B-C-A-B-C', indexSets: [null, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, null]}, |
3235 |
10 Apr 15 |
nicklas |
{name: 'C-A-B-C-A', indexSets: [null, IS_Y2, IS_Y3, IS_G1, IS_G2, IS_B3, IS_B1, IS_Y2, IS_Y3, IS_G1, IS_G2, null]} |
2838 |
20 Oct 14 |
nicklas |
451 |
], |
3235 |
10 Apr 15 |
nicklas |
452 |
|
2838 |
20 Oct 14 |
nicklas |
getPoolNumForColumn: function(colNum) |
2838 |
20 Oct 14 |
nicklas |
454 |
{ |
2838 |
20 Oct 14 |
nicklas |
var poolNum = -1; |
3235 |
10 Apr 15 |
nicklas |
if (colNum >= 1 && colNum <= 10) |
2838 |
20 Oct 14 |
nicklas |
457 |
{ |
3235 |
10 Apr 15 |
nicklas |
poolNum = Math.floor((colNum-1) / 2); |
2838 |
20 Oct 14 |
nicklas |
459 |
} |
2838 |
20 Oct 14 |
nicklas |
return poolNum; |
2838 |
20 Oct 14 |
nicklas |
461 |
}, |
3235 |
10 Apr 15 |
nicklas |
462 |
|
2838 |
20 Oct 14 |
nicklas |
getClassNameForWell: function(well) |
2838 |
20 Oct 14 |
nicklas |
464 |
{ |
2838 |
20 Oct 14 |
nicklas |
var c = well.column; |
3235 |
10 Apr 15 |
nicklas |
var cls = (c >= 1 && c <= 10) ? 'primary ' : 'secondary '; |
3235 |
10 Apr 15 |
nicklas |
cls += this.columnClasses[c % 2]; |
2838 |
20 Oct 14 |
nicklas |
return cls; |
2838 |
20 Oct 14 |
nicklas |
469 |
}, |
3235 |
10 Apr 15 |
nicklas |
470 |
|
2838 |
20 Oct 14 |
nicklas |
getWellsInPool: function(plate, poolNum) |
3235 |
10 Apr 15 |
nicklas |
472 |
{ |
3235 |
10 Apr 15 |
nicklas |
var result = []; |
3235 |
10 Apr 15 |
nicklas |
var index = poolNum*this.numWellsPerPool+plate.rows; |
2838 |
20 Oct 14 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
2838 |
20 Oct 14 |
nicklas |
476 |
{ |
2838 |
20 Oct 14 |
nicklas |
result[result.length] = plate.wells[index]; |
2838 |
20 Oct 14 |
nicklas |
index++; |
2838 |
20 Oct 14 |
nicklas |
479 |
} |
3235 |
10 Apr 15 |
nicklas |
return result; |
3235 |
10 Apr 15 |
nicklas |
481 |
} |
5884 |
27 Mar 20 |
nicklas |
482 |
}, |
5884 |
27 Mar 20 |
nicklas |
483 |
{ |
5884 |
27 Mar 20 |
nicklas |
id: 'external32', |
5884 |
27 Mar 20 |
nicklas |
name: 'External × 32 samples (offset)', |
5884 |
27 Mar 20 |
nicklas |
type: 'external', |
5884 |
27 Mar 20 |
nicklas |
numPools: 1, |
5884 |
27 Mar 20 |
nicklas |
numWellsPerPool: 32, |
5884 |
27 Mar 20 |
nicklas |
columnClasses: ['pool-left', 'pool-middle', 'pool-middle', 'pool-right'], |
5884 |
27 Mar 20 |
nicklas |
barcodeVariants: [], |
5884 |
27 Mar 20 |
nicklas |
491 |
|
5884 |
27 Mar 20 |
nicklas |
getPoolNumForColumn: function(colNum) |
5884 |
27 Mar 20 |
nicklas |
493 |
{ |
5884 |
27 Mar 20 |
nicklas |
var poolNum = -1; |
5884 |
27 Mar 20 |
nicklas |
if (colNum >= 2 && colNum <= 5) |
5884 |
27 Mar 20 |
nicklas |
496 |
{ |
5884 |
27 Mar 20 |
nicklas |
poolNum = 0; |
5884 |
27 Mar 20 |
nicklas |
498 |
} |
5884 |
27 Mar 20 |
nicklas |
return poolNum; |
5884 |
27 Mar 20 |
nicklas |
500 |
}, |
5884 |
27 Mar 20 |
nicklas |
501 |
|
5884 |
27 Mar 20 |
nicklas |
getClassNameForWell: function(well) |
5884 |
27 Mar 20 |
nicklas |
503 |
{ |
5884 |
27 Mar 20 |
nicklas |
var c = well.column; |
5884 |
27 Mar 20 |
nicklas |
var cls = (c >= 2 && c <= 5) ? 'primary ' : 'secondary '; |
5884 |
27 Mar 20 |
nicklas |
cls += (c >= 1 && c <= 6) ? this.columnClasses[(c+2) % 4] : ''; |
5884 |
27 Mar 20 |
nicklas |
return cls; |
5884 |
27 Mar 20 |
nicklas |
508 |
}, |
5884 |
27 Mar 20 |
nicklas |
509 |
|
5884 |
27 Mar 20 |
nicklas |
getWellsInPool: function(plate, poolNum) |
5884 |
27 Mar 20 |
nicklas |
511 |
{ |
5884 |
27 Mar 20 |
nicklas |
var result = []; |
5884 |
27 Mar 20 |
nicklas |
var index = poolNum*this.numWellsPerPool+2*plate.rows; |
5884 |
27 Mar 20 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
5884 |
27 Mar 20 |
nicklas |
515 |
{ |
5884 |
27 Mar 20 |
nicklas |
result[result.length] = plate.wells[index]; |
5884 |
27 Mar 20 |
nicklas |
index++; |
5884 |
27 Mar 20 |
nicklas |
518 |
} |
5884 |
27 Mar 20 |
nicklas |
return result; |
5884 |
27 Mar 20 |
nicklas |
520 |
} |
5884 |
27 Mar 20 |
nicklas |
521 |
}, |
5884 |
27 Mar 20 |
nicklas |
522 |
{ |
5884 |
27 Mar 20 |
nicklas |
id: 'external64', |
5884 |
27 Mar 20 |
nicklas |
name: 'External × 64 samples', |
5884 |
27 Mar 20 |
nicklas |
type: 'external', |
5884 |
27 Mar 20 |
nicklas |
numPools: 1, |
5884 |
27 Mar 20 |
nicklas |
numWellsPerPool: 64, |
5884 |
27 Mar 20 |
nicklas |
columnClasses: ['pool-left', 'pool-middle', 'pool-middle', 'pool-middle', 'pool-middle', 'pool-middle', 'pool-middle', 'pool-right'], |
5884 |
27 Mar 20 |
nicklas |
barcodeVariants: [], |
5884 |
27 Mar 20 |
nicklas |
530 |
|
5884 |
27 Mar 20 |
nicklas |
getPoolNumForColumn: function(colNum) |
5884 |
27 Mar 20 |
nicklas |
532 |
{ |
5884 |
27 Mar 20 |
nicklas |
var poolNum = -1; |
5884 |
27 Mar 20 |
nicklas |
if (colNum >= 2 && colNum <= 9) |
5884 |
27 Mar 20 |
nicklas |
535 |
{ |
5884 |
27 Mar 20 |
nicklas |
poolNum = 0; |
5884 |
27 Mar 20 |
nicklas |
537 |
} |
5884 |
27 Mar 20 |
nicklas |
return poolNum; |
5884 |
27 Mar 20 |
nicklas |
539 |
}, |
5884 |
27 Mar 20 |
nicklas |
540 |
|
5884 |
27 Mar 20 |
nicklas |
getClassNameForWell: function(well) |
5884 |
27 Mar 20 |
nicklas |
542 |
{ |
5884 |
27 Mar 20 |
nicklas |
var c = well.column; |
5884 |
27 Mar 20 |
nicklas |
var cls = (c >= 2 && c <= 9) ? 'primary ' : 'secondary '; |
5884 |
27 Mar 20 |
nicklas |
cls += (c >= 1 && c <= 10) ? this.columnClasses[(c+6) % 8] : ''; |
5884 |
27 Mar 20 |
nicklas |
return cls; |
5884 |
27 Mar 20 |
nicklas |
547 |
}, |
5884 |
27 Mar 20 |
nicklas |
548 |
|
5884 |
27 Mar 20 |
nicklas |
getWellsInPool: function(plate, poolNum) |
5884 |
27 Mar 20 |
nicklas |
550 |
{ |
5884 |
27 Mar 20 |
nicklas |
var result = []; |
5884 |
27 Mar 20 |
nicklas |
var index = poolNum*this.numWellsPerPool+2*plate.rows; |
5884 |
27 Mar 20 |
nicklas |
while (result.length < this.numWellsPerPool && index < plate.wells.length) |
5884 |
27 Mar 20 |
nicklas |
554 |
{ |
5884 |
27 Mar 20 |
nicklas |
result[result.length] = plate.wells[index]; |
5884 |
27 Mar 20 |
nicklas |
index++; |
5884 |
27 Mar 20 |
nicklas |
557 |
} |
5884 |
27 Mar 20 |
nicklas |
return result; |
5884 |
27 Mar 20 |
nicklas |
559 |
} |
1807 |
23 Jan 13 |
nicklas |
560 |
} |
1807 |
23 Jan 13 |
nicklas |
561 |
]; |
1807 |
23 Jan 13 |
nicklas |
562 |
|
1809 |
25 Jan 13 |
nicklas |
563 |
/** |
1809 |
25 Jan 13 |
nicklas |
Methods for handling pooling layout schemas. |
1809 |
25 Jan 13 |
nicklas |
565 |
*/ |
1807 |
23 Jan 13 |
nicklas |
var PoolSchema = function() |
1807 |
23 Jan 13 |
nicklas |
567 |
{ |
1807 |
23 Jan 13 |
nicklas |
var ps = {}; |
1807 |
23 Jan 13 |
nicklas |
569 |
|
3289 |
30 Apr 15 |
nicklas |
ps.initList = function(list, selectedId, type) |
1807 |
23 Jan 13 |
nicklas |
571 |
{ |
3289 |
30 Apr 15 |
nicklas |
var selectedSchema = null; |
1807 |
23 Jan 13 |
nicklas |
for (var i = 0; i < POOL_SCHEMA.length; i++) |
1807 |
23 Jan 13 |
nicklas |
574 |
{ |
1807 |
23 Jan 13 |
nicklas |
var schema = POOL_SCHEMA[i]; |
3289 |
30 Apr 15 |
nicklas |
if (!type || schema.type == type) |
3289 |
30 Apr 15 |
nicklas |
577 |
{ |
3289 |
30 Apr 15 |
nicklas |
var option = new Option(schema.name, schema.id); |
3289 |
30 Apr 15 |
nicklas |
list[list.length] = option; |
3289 |
30 Apr 15 |
nicklas |
if (selectedId == schema.id || selectedSchema == null) |
3289 |
30 Apr 15 |
nicklas |
581 |
{ |
3289 |
30 Apr 15 |
nicklas |
selectedSchema = schema; |
3289 |
30 Apr 15 |
nicklas |
list.selectedIndex = list.length-1; |
3289 |
30 Apr 15 |
nicklas |
584 |
} |
3289 |
30 Apr 15 |
nicklas |
585 |
} |
1807 |
23 Jan 13 |
nicklas |
586 |
} |
3289 |
30 Apr 15 |
nicklas |
return selectedSchema; |
1807 |
23 Jan 13 |
nicklas |
588 |
} |
1807 |
23 Jan 13 |
nicklas |
589 |
|
1809 |
25 Jan 13 |
nicklas |
ps.initVariantList = function(list, schema, selectedId) |
1809 |
25 Jan 13 |
nicklas |
591 |
{ |
1809 |
25 Jan 13 |
nicklas |
if (!selectedId) selectedId = schema.barcodeVariants[0].name; |
1809 |
25 Jan 13 |
nicklas |
var selectedIndex = 0; |
1809 |
25 Jan 13 |
nicklas |
list.length = 0; |
1809 |
25 Jan 13 |
nicklas |
for (var i = 0; i < schema.barcodeVariants.length; i++) |
1809 |
25 Jan 13 |
nicklas |
596 |
{ |
1809 |
25 Jan 13 |
nicklas |
var variant = schema.barcodeVariants[i]; |
2218 |
10 Feb 14 |
nicklas |
if (!variant.disabled) |
2218 |
10 Feb 14 |
nicklas |
599 |
{ |
2218 |
10 Feb 14 |
nicklas |
var option = new Option(variant.name, variant.name); |
2218 |
10 Feb 14 |
nicklas |
list[list.length] = option; |
2218 |
10 Feb 14 |
nicklas |
if (selectedId == variant.name) selectedIndex = i; |
2218 |
10 Feb 14 |
nicklas |
603 |
} |
1809 |
25 Jan 13 |
nicklas |
604 |
} |
1809 |
25 Jan 13 |
nicklas |
list.selectedIndex = selectedIndex; |
1809 |
25 Jan 13 |
nicklas |
return schema.barcodeVariants[selectedIndex]; |
1809 |
25 Jan 13 |
nicklas |
607 |
} |
1807 |
23 Jan 13 |
nicklas |
608 |
|
1807 |
23 Jan 13 |
nicklas |
ps.getById = function(schemaId) |
1807 |
23 Jan 13 |
nicklas |
610 |
{ |
1807 |
23 Jan 13 |
nicklas |
for (var i = 0; i < POOL_SCHEMA.length; i++) |
1807 |
23 Jan 13 |
nicklas |
612 |
{ |
1807 |
23 Jan 13 |
nicklas |
if (POOL_SCHEMA[i].id == schemaId) |
1807 |
23 Jan 13 |
nicklas |
614 |
{ |
1807 |
23 Jan 13 |
nicklas |
return POOL_SCHEMA[i]; |
1807 |
23 Jan 13 |
nicklas |
616 |
} |
1807 |
23 Jan 13 |
nicklas |
617 |
} |
1807 |
23 Jan 13 |
nicklas |
return null; |
1807 |
23 Jan 13 |
nicklas |
619 |
} |
1807 |
23 Jan 13 |
nicklas |
620 |
|
1814 |
30 Jan 13 |
nicklas |
ps.getBarcodeVariantByName = function(schema, barcodeVariant) |
1814 |
30 Jan 13 |
nicklas |
622 |
{ |
1814 |
30 Jan 13 |
nicklas |
for (var i = 0; i < schema.barcodeVariants.length; i++) |
1814 |
30 Jan 13 |
nicklas |
624 |
{ |
1814 |
30 Jan 13 |
nicklas |
if (barcodeVariant == schema.barcodeVariants[i].name) |
1814 |
30 Jan 13 |
nicklas |
626 |
{ |
1814 |
30 Jan 13 |
nicklas |
return schema.barcodeVariants[i]; |
1814 |
30 Jan 13 |
nicklas |
628 |
} |
1814 |
30 Jan 13 |
nicklas |
629 |
} |
1814 |
30 Jan 13 |
nicklas |
return schema.barcodeVariants[0]; |
1814 |
30 Jan 13 |
nicklas |
631 |
} |
1814 |
30 Jan 13 |
nicklas |
632 |
|
3297 |
30 Apr 15 |
nicklas |
ps.buildPoolTableRow = function(schema, columns, interactive, prefix, suffix) |
1807 |
23 Jan 13 |
nicklas |
634 |
{ |
3297 |
30 Apr 15 |
nicklas |
if (!prefix) prefix = ''; |
3297 |
30 Apr 15 |
nicklas |
if (!suffix) suffix = ''; |
1807 |
23 Jan 13 |
nicklas |
var html = '<th></th>'; |
1807 |
23 Jan 13 |
nicklas |
var colNum = 0; |
1807 |
23 Jan 13 |
nicklas |
var poolClass = interactive ? 'pool link' : 'pool'; |
1807 |
23 Jan 13 |
nicklas |
var afterPool = false; |
1807 |
23 Jan 13 |
nicklas |
while (colNum < columns) |
1807 |
23 Jan 13 |
nicklas |
642 |
{ |
1807 |
23 Jan 13 |
nicklas |
var poolNum = schema ? schema.getPoolNumForColumn(colNum) : -1; |
1807 |
23 Jan 13 |
nicklas |
var colspan = 1; |
1807 |
23 Jan 13 |
nicklas |
if (poolNum == -1) |
1807 |
23 Jan 13 |
nicklas |
646 |
{ |
2218 |
10 Feb 14 |
nicklas |
while (colNum+colspan < columns) |
2218 |
10 Feb 14 |
nicklas |
648 |
{ |
2218 |
10 Feb 14 |
nicklas |
if (schema.getPoolNumForColumn(colNum+colspan) != -1) break; |
2218 |
10 Feb 14 |
nicklas |
colspan++; |
2218 |
10 Feb 14 |
nicklas |
651 |
} |
2218 |
10 Feb 14 |
nicklas |
var className = afterPool ? 'nopool-after-pool' : 'nopool-before-pool'; |
2218 |
10 Feb 14 |
nicklas |
html += '<th class="'+className+'" colspan="'+colspan+'"> </th>'; |
1807 |
23 Jan 13 |
nicklas |
654 |
} |
1807 |
23 Jan 13 |
nicklas |
else |
1807 |
23 Jan 13 |
nicklas |
656 |
{ |
1807 |
23 Jan 13 |
nicklas |
while (colNum+colspan < columns) |
1807 |
23 Jan 13 |
nicklas |
658 |
{ |
1807 |
23 Jan 13 |
nicklas |
if (schema.getPoolNumForColumn(colNum+colspan) != poolNum) break; |
1807 |
23 Jan 13 |
nicklas |
colspan++; |
1807 |
23 Jan 13 |
nicklas |
661 |
} |
1807 |
23 Jan 13 |
nicklas |
html += '<th id="pool.' + poolNum + '" colspan="'+colspan+'"'; |
1807 |
23 Jan 13 |
nicklas |
html += ' class="'+poolClass+'"'; |
1809 |
25 Jan 13 |
nicklas |
html += ' data-pool-num="' + poolNum + '"'; |
1807 |
23 Jan 13 |
nicklas |
html += '>'+POOL_NAMES[poolNum]+'</th>'; |
1807 |
23 Jan 13 |
nicklas |
afterPool = true; |
1807 |
23 Jan 13 |
nicklas |
667 |
} |
1807 |
23 Jan 13 |
nicklas |
colNum += colspan; |
1807 |
23 Jan 13 |
nicklas |
669 |
} |
1809 |
25 Jan 13 |
nicklas |
670 |
|
1809 |
25 Jan 13 |
nicklas |
var row = document.getElementById('pool-row'); |
3297 |
30 Apr 15 |
nicklas |
row.innerHTML = prefix+html+suffix; |
1807 |
23 Jan 13 |
nicklas |
673 |
} |
1807 |
23 Jan 13 |
nicklas |
674 |
|
1807 |
23 Jan 13 |
nicklas |
return ps; |
1807 |
23 Jan 13 |
nicklas |
676 |
}(); |
1809 |
25 Jan 13 |
nicklas |
677 |
|
1809 |
25 Jan 13 |
nicklas |
678 |
|
2027 |
30 Sep 13 |
nicklas |
var PoolMix = function() |
2027 |
30 Sep 13 |
nicklas |
680 |
{ |
2027 |
30 Sep 13 |
nicklas |
681 |
|
2027 |
30 Sep 13 |
nicklas |
var LIMIT_FOR_EXTRA_LARGE_MIX = 1.0; |
2027 |
30 Sep 13 |
nicklas |
var AVAILABLE_VOLUME = 10.0; |
2027 |
30 Sep 13 |
nicklas |
var AVAILABLE_VOLUME_AFTER_SPEEDVAC = 5.0; |
2027 |
30 Sep 13 |
nicklas |
685 |
|
2027 |
30 Sep 13 |
nicklas |
var pm = {}; |
2027 |
30 Sep 13 |
nicklas |
687 |
|
2027 |
30 Sep 13 |
nicklas |
688 |
/** |
2027 |
30 Sep 13 |
nicklas |
Round the value to the nearest value with |
2027 |
30 Sep 13 |
nicklas |
the given number of decimals (default=1). |
2027 |
30 Sep 13 |
nicklas |
691 |
*/ |
2027 |
30 Sep 13 |
nicklas |
pm.round = function(value, numDecimals) |
2027 |
30 Sep 13 |
nicklas |
693 |
{ |
2027 |
30 Sep 13 |
nicklas |
if (!numDecimals) numDecimals = 1; |
2027 |
30 Sep 13 |
nicklas |
var pow = Math.pow(10, numDecimals); |
2027 |
30 Sep 13 |
nicklas |
return Math.round(value * pow) / pow; |
2027 |
30 Sep 13 |
nicklas |
697 |
} |
2027 |
30 Sep 13 |
nicklas |
698 |
|
2027 |
30 Sep 13 |
nicklas |
699 |
/** |
2027 |
30 Sep 13 |
nicklas |
Round the value down to the nearest value with |
2027 |
30 Sep 13 |
nicklas |
the given number of decimals (default=1). |
2027 |
30 Sep 13 |
nicklas |
702 |
*/ |
2027 |
30 Sep 13 |
nicklas |
pm.floor = function(value, numDecimals) |
2027 |
30 Sep 13 |
nicklas |
704 |
{ |
2027 |
30 Sep 13 |
nicklas |
if (!numDecimals) numDecimals = 1; |
2027 |
30 Sep 13 |
nicklas |
var pow = Math.pow(10, numDecimals); |
2027 |
30 Sep 13 |
nicklas |
return Math.floor(value * pow) / pow; |
2027 |
30 Sep 13 |
nicklas |
708 |
} |
2027 |
30 Sep 13 |
nicklas |
709 |
|
2027 |
30 Sep 13 |
nicklas |
710 |
/** |
2027 |
30 Sep 13 |
nicklas |
Round the value up to the nearest value with |
2027 |
30 Sep 13 |
nicklas |
the given number of decimals (default=1). |
2027 |
30 Sep 13 |
nicklas |
713 |
*/ |
2027 |
30 Sep 13 |
nicklas |
pm.ceil = function(value, numDecimals) |
2027 |
30 Sep 13 |
nicklas |
715 |
{ |
2027 |
30 Sep 13 |
nicklas |
if (!numDecimals) numDecimals = 1; |
2027 |
30 Sep 13 |
nicklas |
var pow = Math.pow(10, numDecimals); |
2027 |
30 Sep 13 |
nicklas |
return Math.ceil(value * pow) / pow; |
2027 |
30 Sep 13 |
nicklas |
719 |
} |
2027 |
30 Sep 13 |
nicklas |
720 |
|
2027 |
30 Sep 13 |
nicklas |
721 |
/** |
2140 |
18 Nov 13 |
nicklas |
Checks if v1 is less than v2 within the given accuracy |
2140 |
18 Nov 13 |
nicklas |
Eg. v1+accuracy <= v2 |
2140 |
18 Nov 13 |
nicklas |
724 |
*/ |
2140 |
18 Nov 13 |
nicklas |
pm.lessThan = function(v1, v2, accuracy) |
2140 |
18 Nov 13 |
nicklas |
726 |
{ |
2140 |
18 Nov 13 |
nicklas |
return v1 + accuracy < v2; |
2140 |
18 Nov 13 |
nicklas |
728 |
} |
2140 |
18 Nov 13 |
nicklas |
729 |
|
2140 |
18 Nov 13 |
nicklas |
730 |
/** |
2140 |
18 Nov 13 |
nicklas |
Calculate the volume of a lib to use for a pool given the |
2027 |
30 Sep 13 |
nicklas |
target molarity for the pool and average volume for each lib |
2140 |
18 Nov 13 |
nicklas |
in the pool. This method calculates two different volumes: |
2027 |
30 Sep 13 |
nicklas |
734 |
|
2140 |
18 Nov 13 |
nicklas |
lib.volume = The theoretical volume needed to reach the same |
2140 |
18 Nov 13 |
nicklas |
amount of DNA as the target molarity and volume suggests |
2027 |
30 Sep 13 |
nicklas |
737 |
|
2140 |
18 Nov 13 |
nicklas |
lib.actualVolume: The actual volume that can be used due to |
2140 |
18 Nov 13 |
nicklas |
remaining quantity, lib molarity and mixing strategy |
2140 |
18 Nov 13 |
nicklas |
740 |
|
2027 |
30 Sep 13 |
nicklas |
The volume is rounded to one decimal in µl. |
2140 |
18 Nov 13 |
nicklas |
742 |
|
2027 |
30 Sep 13 |
nicklas |
743 |
*/ |
2041 |
04 Oct 13 |
nicklas |
pm.calculateLibVolume = function(lib, targetMolarity, targetVolume, mixingStrategy) |
2027 |
30 Sep 13 |
nicklas |
745 |
{ |
5436 |
17 May 19 |
nicklas |
if (!lib.molarity) return; |
3314 |
07 May 15 |
nicklas |
var volume = targetVolume * targetMolarity / lib.molarity; |
2027 |
30 Sep 13 |
nicklas |
var mixFactor = 1; |
2140 |
18 Nov 13 |
nicklas |
749 |
|
2140 |
18 Nov 13 |
nicklas |
if (pm.lessThan(volume, LIMIT_FOR_EXTRA_LARGE_MIX, 0.05)) |
2027 |
30 Sep 13 |
nicklas |
751 |
{ |
2186 |
10 Jan 14 |
nicklas |
// Mix 'dil' so that we take about 2 times the minimal limit |
2186 |
10 Jan 14 |
nicklas |
mixFactor = Math.max(2 * LIMIT_FOR_EXTRA_LARGE_MIX / volume); |
2027 |
30 Sep 13 |
nicklas |
754 |
} |
3314 |
07 May 15 |
nicklas |
755 |
|
3314 |
07 May 15 |
nicklas |
// Re-calculate the volume to get the rounding correct (eg. to avoid doubling rounding errors) |
3314 |
07 May 15 |
nicklas |
volume = pm.round(mixFactor * volume) / mixFactor; |
2027 |
30 Sep 13 |
nicklas |
758 |
|
2140 |
18 Nov 13 |
nicklas |
// This is the theoretical volume that should be used... |
2027 |
30 Sep 13 |
nicklas |
lib.volume = volume; |
2140 |
18 Nov 13 |
nicklas |
lib.eb = null; |
2027 |
30 Sep 13 |
nicklas |
lib.mixFactor = mixFactor; |
2140 |
18 Nov 13 |
nicklas |
763 |
|
2140 |
18 Nov 13 |
nicklas |
// However, reality has limitations due to remaining volume, mixing strategy, etc. |
2140 |
18 Nov 13 |
nicklas |
// Check what volume that can actually be used |
2186 |
10 Jan 14 |
nicklas |
if (mixingStrategy == 'fixed') |
2140 |
18 Nov 13 |
nicklas |
767 |
{ |
2140 |
18 Nov 13 |
nicklas |
// Do not use more than target volume or remaining volume |
2140 |
18 Nov 13 |
nicklas |
volume = Math.min(volume, targetVolume, lib.remainingVolume); |
2140 |
18 Nov 13 |
nicklas |
770 |
} |
2140 |
18 Nov 13 |
nicklas |
else |
2140 |
18 Nov 13 |
nicklas |
772 |
{ |
2140 |
18 Nov 13 |
nicklas |
volume = Math.min(volume, lib.remainingVolume); |
2140 |
18 Nov 13 |
nicklas |
774 |
} |
2140 |
18 Nov 13 |
nicklas |
lib.actualVolume = volume; |
2027 |
30 Sep 13 |
nicklas |
776 |
} |
2027 |
30 Sep 13 |
nicklas |
777 |
|
2027 |
30 Sep 13 |
nicklas |
778 |
/** |
2140 |
18 Nov 13 |
nicklas |
Same as above method except that we already know the mixFactor and actualVolume of |
2140 |
18 Nov 13 |
nicklas |
the lib since that has already been saved to the database. |
2027 |
30 Sep 13 |
nicklas |
781 |
*/ |
2140 |
18 Nov 13 |
nicklas |
pm.calculateLibVolumeForProtocol = function(lib, targetMolarity, targetVolume, mixingStrategy) |
2027 |
30 Sep 13 |
nicklas |
783 |
{ |
2140 |
18 Nov 13 |
nicklas |
if (lib.mixFactor > 1) |
2027 |
30 Sep 13 |
nicklas |
785 |
{ |
2186 |
10 Jan 14 |
nicklas |
lib.volume = pm.round(lib.mixFactor * targetVolume * targetMolarity / lib.molarity) / lib.mixFactor; |
2027 |
30 Sep 13 |
nicklas |
787 |
} |
2041 |
04 Oct 13 |
nicklas |
else |
2027 |
30 Sep 13 |
nicklas |
789 |
{ |
2140 |
18 Nov 13 |
nicklas |
lib.volume = pm.round(targetVolume * targetMolarity / lib.molarity); |
2140 |
18 Nov 13 |
nicklas |
791 |
} |
2140 |
18 Nov 13 |
nicklas |
792 |
} |
2041 |
04 Oct 13 |
nicklas |
793 |
|
2140 |
18 Nov 13 |
nicklas |
794 |
|
2140 |
18 Nov 13 |
nicklas |
795 |
/** |
2140 |
18 Nov 13 |
nicklas |
Calculate the volume of EB to mix with a lib. |
2140 |
18 Nov 13 |
nicklas |
797 |
|
2140 |
18 Nov 13 |
nicklas |
The volume is rounded to one decimal in µl. |
2140 |
18 Nov 13 |
nicklas |
799 |
*/ |
2140 |
18 Nov 13 |
nicklas |
pm.calculateEbVolume = function(lib, targetMolarity, targetVolume, mixingStrategy) |
2140 |
18 Nov 13 |
nicklas |
801 |
{ |
2140 |
18 Nov 13 |
nicklas |
var eb = 0; |
2186 |
10 Jan 14 |
nicklas |
if (mixingStrategy == 'fixed') |
2140 |
18 Nov 13 |
nicklas |
804 |
{ |
2140 |
18 Nov 13 |
nicklas |
eb = targetVolume - lib.volume; |
2140 |
18 Nov 13 |
nicklas |
806 |
} |
2186 |
10 Jan 14 |
nicklas |
else if (lib.mixFactor > 1) |
2186 |
10 Jan 14 |
nicklas |
808 |
{ |
2186 |
10 Jan 14 |
nicklas |
eb = (lib.targetVolume ? lib.targetVolume : targetVolume) - lib.volume; |
2186 |
10 Jan 14 |
nicklas |
810 |
} |
2140 |
18 Nov 13 |
nicklas |
811 |
|
2140 |
18 Nov 13 |
nicklas |
// This is the theoretical volume that should be used... |
2140 |
18 Nov 13 |
nicklas |
lib.eb = eb; |
2186 |
10 Jan 14 |
nicklas |
lib.mixingStrategy = mixingStrategy; |
2140 |
18 Nov 13 |
nicklas |
815 |
|
2140 |
18 Nov 13 |
nicklas |
// However, reality has limitations due to remaining volume, mixing strategy, etc. |
2140 |
18 Nov 13 |
nicklas |
// Check what volume that can actually be used |
2140 |
18 Nov 13 |
nicklas |
if (mixingStrategy == 'fixed' || lib.mixFactor > 1) |
2140 |
18 Nov 13 |
nicklas |
819 |
{ |
2140 |
18 Nov 13 |
nicklas |
if (pm.lessThan(lib.molarity, targetMolarity, 0.01)) |
2041 |
04 Oct 13 |
nicklas |
821 |
{ |
2140 |
18 Nov 13 |
nicklas |
// Do not dilute if molarity is lower than target molarity |
2140 |
18 Nov 13 |
nicklas |
eb = 0; |
2041 |
04 Oct 13 |
nicklas |
824 |
} |
2140 |
18 Nov 13 |
nicklas |
else if (pm.lessThan(lib.actualVolume, lib.volume, 0.05)) |
2041 |
04 Oct 13 |
nicklas |
826 |
{ |
2140 |
18 Nov 13 |
nicklas |
// Reduce EB by the same factor as we have to reduce the volume |
2140 |
18 Nov 13 |
nicklas |
// so the final molarity is still |
2140 |
18 Nov 13 |
nicklas |
eb = pm.round(eb * lib.actualVolume / lib.volume); |
2041 |
04 Oct 13 |
nicklas |
830 |
} |
2140 |
18 Nov 13 |
nicklas |
831 |
} |
2140 |
18 Nov 13 |
nicklas |
lib.actualEb = eb; |
2027 |
30 Sep 13 |
nicklas |
833 |
} |
2140 |
18 Nov 13 |
nicklas |
834 |
|
2027 |
30 Sep 13 |
nicklas |
835 |
|
2140 |
18 Nov 13 |
nicklas |
836 |
|
2140 |
18 Nov 13 |
nicklas |
837 |
/** |
2140 |
18 Nov 13 |
nicklas |
Summarize information for the pool. This will calculate the following and |
2140 |
18 Nov 13 |
nicklas |
return as an object: |
2140 |
18 Nov 13 |
nicklas |
840 |
|
2140 |
18 Nov 13 |
nicklas |
libVolume: Total volume of libs in the pool (µl) |
2140 |
18 Nov 13 |
nicklas |
libAmount: Total amount of libs in the pool (nano-mol) |
2140 |
18 Nov 13 |
nicklas |
ebVolumeFromLibs: Total EB volume from mixed directly with libs |
2140 |
18 Nov 13 |
nicklas |
ebVolumeExtra: Extra EB to add to the pool (dynamic mixing) |
2140 |
18 Nov 13 |
nicklas |
molarity: The final pool molarity after mixing everything |
2140 |
18 Nov 13 |
nicklas |
846 |
*/ |
2140 |
18 Nov 13 |
nicklas |
pm.calculateFinalPoolInfo = function(libs, targetMolarity, targetVolume, mixingStrategy) |
2027 |
30 Sep 13 |
nicklas |
848 |
{ |
2027 |
30 Sep 13 |
nicklas |
var libVolume = 0; |
2027 |
30 Sep 13 |
nicklas |
var libAmount = 0; |
2140 |
18 Nov 13 |
nicklas |
var ebVolumeFromLibs = 0; |
2140 |
18 Nov 13 |
nicklas |
852 |
|
2027 |
30 Sep 13 |
nicklas |
for (var libNo = 0; libNo < libs.length; libNo++) |
2027 |
30 Sep 13 |
nicklas |
854 |
{ |
2027 |
30 Sep 13 |
nicklas |
var lib = libs[libNo]; |
2140 |
18 Nov 13 |
nicklas |
856 |
|
2140 |
18 Nov 13 |
nicklas |
var volume = lib.actualVolume; |
2140 |
18 Nov 13 |
nicklas |
var eb = lib.actualEb; |
2140 |
18 Nov 13 |
nicklas |
859 |
|
2140 |
18 Nov 13 |
nicklas |
libVolume += volume; |
2140 |
18 Nov 13 |
nicklas |
ebVolumeFromLibs += eb; |
2140 |
18 Nov 13 |
nicklas |
libAmount += volume * lib.molarity; |
2027 |
30 Sep 13 |
nicklas |
863 |
} |
2027 |
30 Sep 13 |
nicklas |
864 |
|
2140 |
18 Nov 13 |
nicklas |
var info = {}; |
2140 |
18 Nov 13 |
nicklas |
info.libVolume = libVolume; |
2140 |
18 Nov 13 |
nicklas |
info.libAmount = libAmount; |
2140 |
18 Nov 13 |
nicklas |
info.ebVolumeFromLibs = ebVolumeFromLibs; |
2140 |
18 Nov 13 |
nicklas |
869 |
|
2140 |
18 Nov 13 |
nicklas |
// Calculate extra EB and total pool volume |
2140 |
18 Nov 13 |
nicklas |
if (mixingStrategy == 'dynamic') |
2040 |
03 Oct 13 |
nicklas |
872 |
{ |
2140 |
18 Nov 13 |
nicklas |
// Use the target molarity to calculate the total volume |
2140 |
18 Nov 13 |
nicklas |
var targetVolume = pm.round(libAmount / targetMolarity); |
2140 |
18 Nov 13 |
nicklas |
info.ebVolumeExtra = pm.round(targetVolume - info.libVolume - info.ebVolumeFromLibs); |
2140 |
18 Nov 13 |
nicklas |
if (info.ebVolumeExtra < 0) |
2140 |
18 Nov 13 |
nicklas |
877 |
{ |
2140 |
18 Nov 13 |
nicklas |
info.totalVolume = info.libVolume + info.ebVolumeFromLibs; |
2140 |
18 Nov 13 |
nicklas |
879 |
} |
2140 |
18 Nov 13 |
nicklas |
else |
2140 |
18 Nov 13 |
nicklas |
881 |
{ |
2140 |
18 Nov 13 |
nicklas |
info.totalVolume = targetVolume; |
2140 |
18 Nov 13 |
nicklas |
883 |
} |
2040 |
03 Oct 13 |
nicklas |
884 |
} |
2040 |
03 Oct 13 |
nicklas |
else |
2040 |
03 Oct 13 |
nicklas |
886 |
{ |
2140 |
18 Nov 13 |
nicklas |
// No extra EB |
2140 |
18 Nov 13 |
nicklas |
info.ebVolumeExtra = 0; |
2140 |
18 Nov 13 |
nicklas |
info.totalVolume = info.libVolume + info.ebVolumeFromLibs; |
2040 |
03 Oct 13 |
nicklas |
890 |
} |
2140 |
18 Nov 13 |
nicklas |
// Calcualate the final molarity (which may be different that target due to rounding) |
2140 |
18 Nov 13 |
nicklas |
info.molarity = info.libAmount / info.totalVolume; |
2140 |
18 Nov 13 |
nicklas |
893 |
|
2027 |
30 Sep 13 |
nicklas |
return info; |
2027 |
30 Sep 13 |
nicklas |
895 |
} |
2027 |
30 Sep 13 |
nicklas |
896 |
|
2027 |
30 Sep 13 |
nicklas |
return pm; |
2027 |
30 Sep 13 |
nicklas |
898 |
}(); |