@datagrok/curves 1.6.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.eslintrc.json +39 -0
  2. package/.vscode/launch.json +10 -9
  3. package/.vscode/tasks.json +14 -0
  4. package/CHANGELOG.md +33 -0
  5. package/README.md +36 -8
  6. package/databases/plates/0000_init.sql +167 -0
  7. package/detectors.js +2 -2
  8. package/dist/package-test.js +15930 -1
  9. package/dist/package-test.js.map +1 -1
  10. package/dist/package.js +13750 -1
  11. package/dist/package.js.map +1 -1
  12. package/img/plate-dose-response-series.gif +0 -0
  13. package/img/plate-readers.gif +0 -0
  14. package/package.json +17 -11
  15. package/queries/plates-crud.sql +148 -0
  16. package/src/fit/const.ts +60 -59
  17. package/src/fit/data-to-curves.ts +220 -0
  18. package/src/fit/fit-demo.ts +6 -6
  19. package/src/fit/fit-grid-cell-handler.ts +94 -85
  20. package/src/fit/fit-renderer.ts +162 -98
  21. package/src/fit/multi-curve-viewer.ts +69 -28
  22. package/src/fit/render-utils.ts +346 -288
  23. package/src/package-api.ts +167 -0
  24. package/src/package-test.ts +7 -1
  25. package/src/package.g.ts +140 -2
  26. package/src/package.ts +221 -79
  27. package/src/plate/excel-plates.ts +112 -0
  28. package/src/plate/plate-cell-renderer.ts +48 -0
  29. package/src/plate/plate-drc-analysis.ts +262 -0
  30. package/src/plate/plate-reader.ts +28 -0
  31. package/src/plate/plate-well-validators.ts +41 -0
  32. package/src/plate/plate-widget.ts +242 -0
  33. package/src/plate/plate.ts +557 -0
  34. package/src/plate/plates-folder-preview.ts +63 -0
  35. package/src/plate/readers/bmg-pherastar-96.ts +42 -0
  36. package/src/plate/readers/delfia-envision-96-max-rlu.ts +16 -0
  37. package/src/plate/readers/delfia-envision-by-row.ts +18 -0
  38. package/src/plate/readers/spectramax.ts +42 -0
  39. package/src/plate/utils.ts +141 -0
  40. package/src/plates/numeric_matcher.ts +191 -0
  41. package/src/plates/objects/plate-template-handler.ts +48 -0
  42. package/src/plates/plates-app.ts +64 -0
  43. package/src/plates/plates-crud.ts +502 -0
  44. package/src/plates/plates-demo.ts +107 -0
  45. package/src/plates/plates.sql +169 -0
  46. package/src/plates/views/plates-create-view.ts +123 -0
  47. package/src/plates/views/plates-schema-view.ts +58 -0
  48. package/src/plates/views/plates-search-view.ts +137 -0
  49. package/src/plates/views/plates-templates-view.ts +38 -0
  50. package/src/tests/curves-cell-renderer-tests.ts +95 -75
  51. package/src/tests/detector-tests.ts +3 -2
  52. package/src/tests/fit-tests.ts +199 -163
  53. package/src/tests/plate-tests.ts +153 -0
  54. package/src/tests/transform-tests.ts +6 -6
  55. package/test-console-output-1.log +435 -0
  56. package/test-record-1.mp4 +0 -0
  57. package/tsconfig.json +1 -1
  58. package/src/fit/cell-render-viewer.ts +0 -54
@@ -1,26 +1,27 @@
1
+ /* eslint-disable max-len */
1
2
  import {
2
- getSeriesFitFunction,
3
- getCurve,
4
- fitSeries,
5
- getSeriesConfidenceInterval,
6
- getSeriesStatistics,
7
- getPointsArrays,
3
+ getSeriesFitFunction,
4
+ getCurve,
5
+ fitSeries,
6
+ getSeriesConfidenceInterval,
7
+ getSeriesStatistics,
8
+ getPointsArrays,
8
9
  } from '@datagrok-libraries/statistics/src/fit/fit-data';
9
10
  import {
10
- sigmoid,
11
- FIT_FUNCTION_SIGMOID,
12
- IFitSeries,
13
- FIT_FUNCTION_LINEAR, FIT_FUNCTION_LOG_LINEAR, FIT_FUNCTION_EXPONENTIAL, linear, logLinear, exponential
11
+ sigmoid,
12
+ FIT_FUNCTION_SIGMOID,
13
+ IFitSeries,
14
+ FIT_FUNCTION_LINEAR, FIT_FUNCTION_LOG_LINEAR, FIT_FUNCTION_EXPONENTIAL, linear, logLinear, exponential
14
15
  } from '@datagrok-libraries/statistics/src/fit/fit-curve';
15
16
  import {calculateBoxPlotStatistics} from '@datagrok-libraries/statistics/src/box-plot-statistics';
16
17
  import {category, test, expect, expectArray} from '@datagrok-libraries/utils/src/test';
17
18
 
18
19
 
19
- const sigmoidSeries: IFitSeries = {"fitLineColor": "#1f77b4", "pointColor": "#1f77b4", "showCurveConfidenceInterval": false, "points": [{"x": 0.10000000149011612, "y": 1.7412786483764648}, {"x": 0.6000000238418579, "y": 1.8561450242996216}, {"x": 1.100000023841858, "y": 1.6065685749053955}, {"x": 1.600000023841858,"y": 1.70476496219635}, {"x": 2.0999999046325684, "y": 1.5737264156341553}, {"x": 2.5999999046325684, "y": 1.6007002592086792}, {"x": 3.0999999046325684, "y": 1.6796687841415405}, {"x": 3.5999999046325684, "y": 1.656104326248169}, {"x": 4.099999904632568, "y": 1.782997488975525}, {"x": 4.599999904632568, "y": 1.530208945274353}, {"x": 5.099999904632568, "y": 1.1572397947311401}, {"x": 5.599999904632568, "y": 0.8691964745521545}, {"x": 6.099999904632568, "y": 0.3228665590286255}, {"x": 6.599999904632568,"y": 0.2990703880786896}, {"x": 7.099999904632568, "y": 0.23361243307590485}], "fitFunction": "sigmoid", "clickToToggle": false, "showFitLine": true, "showPoints": "points", "parameters": [1.6914372095641517, 1.1536998642628853, 5.410173358224149, 0.2089689354045083]};
20
- const linearSeries: IFitSeries = {"fitLineColor": "#1f77b4", "pointColor": "#1f77b4", "showCurveConfidenceInterval": false, "points": [{"x": 0.10000000149011612, "y": 1.5412786483764648}, {"x": 0.6000000238418579, "y": 1.9261450242996216}, {"x": 1.100000023841858, "y": 1.6065685749053955}, {"x": 1.600000023841858,"y": 1.70476496219635}, {"x": 2.0999999046325684, "y": 1.5737264156341553}, {"x": 2.5999999046325684, "y": 1.6007002592086792}, {"x": 3.0999999046325684, "y": 1.6796687841415405}, {"x": 3.5999999046325684, "y": 1.656104326248169}, {"x": 4.099999904632568, "y": 1.782997488975525}, {"x": 4.599999904632568, "y": 1.530208945274353}, {"x": 5.099999904632568, "y": 1.1572397947311401}, {"x": 5.599999904632568, "y": 0.8691964745521545}, {"x": 6.099999904632568, "y": 0.3228665590286255}, {"x": 6.599999904632568,"y": 0.2990703880786896}, {"x": 7.099999904632568, "y": 0.23361243307590485}], "fitFunction": "linear", "clickToToggle": false, "showFitLine": true, "showPoints": "points", "parameters": [-5.45641324, 10.456486765]};
21
- const logLinearSeries: IFitSeries = {"fitLineColor": "#1f77b4", "pointColor": "#1f77b4", "showCurveConfidenceInterval": false, "points": [{"x": 0.10000000149011612, "y": 1.789712786483764648}, {"x": 0.6000000238418579, "y": 1.210161450242996216}, {"x": 1.100000023841858, "y": 1.7895685749053955}, {"x": 1.600000023841858,"y": 1.82476496219635}, {"x": 2.0999999046325684, "y": 1.5737264156341553}, {"x": 2.5999999046325684, "y": 1.6007002592086792}, {"x": 3.0999999046325684, "y": 1.6796687841415405}, {"x": 3.5999999046325684, "y": 1.656104326248169}, {"x": 4.099999904632568, "y": 1.782997488975525}, {"x": 4.599999904632568, "y": 1.530208945274353}, {"x": 5.099999904632568, "y": 1.1572397947311401}, {"x": 5.599999904632568, "y": 0.8691964745521545}, {"x": 6.099999904632568, "y": 0.3228665590286255}, {"x": 6.599999904632568,"y": 0.2990703880786896}, {"x": 7.099999904632568, "y": 0.23361243307590485}], "fitFunction": "log-linear", "clickToToggle": false, "showFitLine": true, "showPoints": "points", "parameters": [-8.45641324, 90.4456456486765]};
22
- const exponentialSeries: IFitSeries = {"fitLineColor": "#1f77b4", "pointColor": "#1f77b4", "showCurveConfidenceInterval": false, "points": [{"x": 0.10000000149011612, "y": 1.789712786483764648}, {"x": 0.6000000238418579, "y": 1.210161450242996216}, {"x": 1.100000023841858, "y": 1.7895685749053955}, {"x": 1.600000023841858,"y": 1.82476496219635}, {"x": 2.0999999046325684, "y": 1.5737264156341553}, {"x": 2.5999999046325684, "y": 1.6007002592086792}, {"x": 3.0999999046325684, "y": 1.6796687841415405}, {"x": 3.5999999046325684, "y": 1.656104326248169}, {"x": 4.099999904632568, "y": 1.782997488975525}, {"x": 4.599999904632568, "y": 1.530208945274353}, {"x": 5.099999904632568, "y": 1.1572397947311401}, {"x": 5.599999904632568, "y": 0.8691964745521545}, {"x": 6.099999904632568, "y": 0.3228665590286255}, {"x": 6.599999904632568,"y": 0.2990703880786896}, {"x": 7.099999904632568, "y": 0.23361243307590485}], "fitFunction": "exponential", "clickToToggle": false, "showFitLine": true, "showPoints": "points", "parameters": [88.45641324, -10.4456456486765]};
23
- const polynomialSeries: IFitSeries = {"fitLineColor": "#2ca02c", "pointColor": "#2ca02c", "showCurveConfidenceInterval": true, "fitFunction": {"name": "Polynomial", "function": "([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4", "getInitialParameters": "(xs, ys) => [0.1, -1, 4, 4]", "parameterNames": ["Slope", "Intercept", "Parameter3", "Parameter4"]}, "points": [{"x": 0.10000000149011612, "y": 7.365033149719238}, {"x": 0.6000000238418579, "y": 6.595034599304199}, {"x": 1.100000023841858, "y": 7.05179500579834}, {"x": 1.600000023841858, "y": 7.251461982727051}, {"x": 2.0999999046325684, "y": 7.775498867034912}, {"x": 2.5999999046325684, "y": 7.748039722442627}, {"x": 3.0999999046325684, "y": 6.8391804695129395}, {"x": 3.5999999046325684, "y": 7.570991516113281}, {"x": 4.099999904632568, "y": 6.387666702270508}, {"x": 4.599999904632568, "y": 6.464827537536621}, {"x": 5.099999904632568, "y": 3.932436227798462}, {"x": 5.599999904632568, "y": 1.4741199016571045}, {"x": 6.099999904632568, "y": 0.47604307532310486}, {"x": 6.599999904632568, "y": 0.5836760401725769}, {"x": 7.099999904632568, "y": 1.0317600965499878}], "clickToToggle": false, "showFitLine": true, "showPoints": "points", "parameters": [0.07070206940832963, -1.138666933634074, 3.947509109407932, 3.9947960440506685]};
20
+ const sigmoidSeries: IFitSeries = {'fitLineColor': '#1f77b4', 'pointColor': '#1f77b4', 'showCurveConfidenceInterval': false, 'points': [{'x': 0.10000000149011612, 'y': 1.7412786483764648}, {'x': 0.6000000238418579, 'y': 1.8561450242996216}, {'x': 1.100000023841858, 'y': 1.6065685749053955}, {'x': 1.600000023841858, 'y': 1.70476496219635}, {'x': 2.0999999046325684, 'y': 1.5737264156341553}, {'x': 2.5999999046325684, 'y': 1.6007002592086792}, {'x': 3.0999999046325684, 'y': 1.6796687841415405}, {'x': 3.5999999046325684, 'y': 1.656104326248169}, {'x': 4.099999904632568, 'y': 1.782997488975525}, {'x': 4.599999904632568, 'y': 1.530208945274353}, {'x': 5.099999904632568, 'y': 1.1572397947311401}, {'x': 5.599999904632568, 'y': 0.8691964745521545}, {'x': 6.099999904632568, 'y': 0.3228665590286255}, {'x': 6.599999904632568, 'y': 0.2990703880786896}, {'x': 7.099999904632568, 'y': 0.23361243307590485}], 'fitFunction': 'sigmoid', 'clickToToggle': false, 'showFitLine': true, 'showPoints': 'points', 'parameters': [1.6914372095641517, 1.1536998642628853, 5.410173358224149, 0.2089689354045083]};
21
+ const linearSeries: IFitSeries = {'fitLineColor': '#1f77b4', 'pointColor': '#1f77b4', 'showCurveConfidenceInterval': false, 'points': [{'x': 0.10000000149011612, 'y': 1.5412786483764648}, {'x': 0.6000000238418579, 'y': 1.9261450242996216}, {'x': 1.100000023841858, 'y': 1.6065685749053955}, {'x': 1.600000023841858, 'y': 1.70476496219635}, {'x': 2.0999999046325684, 'y': 1.5737264156341553}, {'x': 2.5999999046325684, 'y': 1.6007002592086792}, {'x': 3.0999999046325684, 'y': 1.6796687841415405}, {'x': 3.5999999046325684, 'y': 1.656104326248169}, {'x': 4.099999904632568, 'y': 1.782997488975525}, {'x': 4.599999904632568, 'y': 1.530208945274353}, {'x': 5.099999904632568, 'y': 1.1572397947311401}, {'x': 5.599999904632568, 'y': 0.8691964745521545}, {'x': 6.099999904632568, 'y': 0.3228665590286255}, {'x': 6.599999904632568, 'y': 0.2990703880786896}, {'x': 7.099999904632568, 'y': 0.23361243307590485}], 'fitFunction': 'linear', 'clickToToggle': false, 'showFitLine': true, 'showPoints': 'points', 'parameters': [-5.45641324, 10.456486765]};
22
+ const logLinearSeries: IFitSeries = {'fitLineColor': '#1f77b4', 'pointColor': '#1f77b4', 'showCurveConfidenceInterval': false, 'points': [{'x': 0.10000000149011612, 'y': 1.789712786483764648}, {'x': 0.6000000238418579, 'y': 1.210161450242996216}, {'x': 1.100000023841858, 'y': 1.7895685749053955}, {'x': 1.600000023841858, 'y': 1.82476496219635}, {'x': 2.0999999046325684, 'y': 1.5737264156341553}, {'x': 2.5999999046325684, 'y': 1.6007002592086792}, {'x': 3.0999999046325684, 'y': 1.6796687841415405}, {'x': 3.5999999046325684, 'y': 1.656104326248169}, {'x': 4.099999904632568, 'y': 1.782997488975525}, {'x': 4.599999904632568, 'y': 1.530208945274353}, {'x': 5.099999904632568, 'y': 1.1572397947311401}, {'x': 5.599999904632568, 'y': 0.8691964745521545}, {'x': 6.099999904632568, 'y': 0.3228665590286255}, {'x': 6.599999904632568, 'y': 0.2990703880786896}, {'x': 7.099999904632568, 'y': 0.23361243307590485}], 'fitFunction': 'log-linear', 'clickToToggle': false, 'showFitLine': true, 'showPoints': 'points', 'parameters': [-8.45641324, 90.4456456486765]};
23
+ const exponentialSeries: IFitSeries = {'fitLineColor': '#1f77b4', 'pointColor': '#1f77b4', 'showCurveConfidenceInterval': false, 'points': [{'x': 0.10000000149011612, 'y': 1.789712786483764648}, {'x': 0.6000000238418579, 'y': 1.210161450242996216}, {'x': 1.100000023841858, 'y': 1.7895685749053955}, {'x': 1.600000023841858, 'y': 1.82476496219635}, {'x': 2.0999999046325684, 'y': 1.5737264156341553}, {'x': 2.5999999046325684, 'y': 1.6007002592086792}, {'x': 3.0999999046325684, 'y': 1.6796687841415405}, {'x': 3.5999999046325684, 'y': 1.656104326248169}, {'x': 4.099999904632568, 'y': 1.782997488975525}, {'x': 4.599999904632568, 'y': 1.530208945274353}, {'x': 5.099999904632568, 'y': 1.1572397947311401}, {'x': 5.599999904632568, 'y': 0.8691964745521545}, {'x': 6.099999904632568, 'y': 0.3228665590286255}, {'x': 6.599999904632568, 'y': 0.2990703880786896}, {'x': 7.099999904632568, 'y': 0.23361243307590485}], 'fitFunction': 'exponential', 'clickToToggle': false, 'showFitLine': true, 'showPoints': 'points', 'parameters': [88.45641324, -10.4456456486765]};
24
+ const polynomialSeries: IFitSeries = {'fitLineColor': '#2ca02c', 'pointColor': '#2ca02c', 'showCurveConfidenceInterval': true, 'fitFunction': {'name': 'Polynomial', 'function': '([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4', 'getInitialParameters': '(xs, ys) => [0.1, -1, 4, 4]', 'parameterNames': ['Slope', 'Intercept', 'Parameter3', 'Parameter4']}, 'points': [{'x': 0.10000000149011612, 'y': 7.365033149719238}, {'x': 0.6000000238418579, 'y': 6.595034599304199}, {'x': 1.100000023841858, 'y': 7.05179500579834}, {'x': 1.600000023841858, 'y': 7.251461982727051}, {'x': 2.0999999046325684, 'y': 7.775498867034912}, {'x': 2.5999999046325684, 'y': 7.748039722442627}, {'x': 3.0999999046325684, 'y': 6.8391804695129395}, {'x': 3.5999999046325684, 'y': 7.570991516113281}, {'x': 4.099999904632568, 'y': 6.387666702270508}, {'x': 4.599999904632568, 'y': 6.464827537536621}, {'x': 5.099999904632568, 'y': 3.932436227798462}, {'x': 5.599999904632568, 'y': 1.4741199016571045}, {'x': 6.099999904632568, 'y': 0.47604307532310486}, {'x': 6.599999904632568, 'y': 0.5836760401725769}, {'x': 7.099999904632568, 'y': 1.0317600965499878}], 'clickToToggle': false, 'showFitLine': true, 'showPoints': 'points', 'parameters': [0.07070206940832963, -1.138666933634074, 3.947509109407932, 3.9947960440506685]};
24
25
  const sigmoidFitFunc = getSeriesFitFunction(sigmoidSeries);
25
26
  const linearFitFunc = getSeriesFitFunction(linearSeries);
26
27
  const logLinearFitFunc = getSeriesFitFunction(logLinearSeries);
@@ -29,152 +30,187 @@ const polynomialFitFunc = getSeriesFitFunction(polynomialSeries);
29
30
 
30
31
 
31
32
  category('fit', () => {
32
- test('getSeriesFitFunction', async () => {
33
- const {xs: sigmoidXs, ys: sigmoidYs} = getPointsArrays(sigmoidSeries.points);
34
- const {xs: linearXs, ys: linearYs} = getPointsArrays(linearSeries.points);
35
- const {xs: logLinearXs, ys: logLinearYs} = getPointsArrays(logLinearSeries.points);
36
- const {xs: exponentialXs, ys: exponentialYs} = getPointsArrays(exponentialSeries.points);
37
- const {xs: polynomialXs, ys: polynomialYs} = getPointsArrays(polynomialSeries.points);
38
-
39
- expect(sigmoidFitFunc.name, FIT_FUNCTION_SIGMOID);
40
- expect(linearFitFunc.name, FIT_FUNCTION_LINEAR);
41
- expect(logLinearFitFunc.name, FIT_FUNCTION_LOG_LINEAR);
42
- expect(exponentialFitFunc.name, FIT_FUNCTION_EXPONENTIAL);
43
- expect(polynomialFitFunc.name, 'Polynomial');
44
- expectArray(sigmoidFitFunc.parameterNames, ['Top', 'Bottom', 'Slope', 'IC50']);
45
- expectArray(linearFitFunc.parameterNames, ['Slope', 'Intercept']);
46
- expectArray(logLinearFitFunc.parameterNames, ['Slope', 'Intercept']);
47
- expectArray(exponentialFitFunc.parameterNames, ['Mantissa', 'Power']);
48
- expectArray(polynomialFitFunc.parameterNames, ['Slope', 'Intercept', 'Parameter3', 'Parameter4']);
49
- expectArray(sigmoidFitFunc.getInitialParameters(sigmoidXs, sigmoidYs), [1.8561450242996216, 1, 5.099999904632568, 0.23361243307590485]);
50
- expectArray(linearFitFunc.getInitialParameters(linearXs, linearYs), [-0.1868094652891159, 1.5599596500396729]);
51
- expectArray(logLinearFitFunc.getInitialParameters(logLinearXs, logLinearYs), [-5, 100]);
52
- expectArray(exponentialFitFunc.getInitialParameters(exponentialXs, exponentialYs), [100, -2]);
53
- expectArray(polynomialFitFunc.getInitialParameters(polynomialXs, polynomialYs), [0.1, -1, 4, 4]);
54
- const params = new Float32Array(sigmoidSeries.parameters?.length!);
55
- params.set(sigmoidSeries.parameters!);
56
- expect(sigmoidFitFunc.y(params, 1.1), 1.6914214561555851);
57
- expect(linearFitFunc.y(linearFitFunc.getInitialParameters(linearXs, linearYs), 1.1), 1.3544692382216454);
58
- expect(logLinearFitFunc.y(logLinearFitFunc.getInitialParameters(logLinearXs, logLinearYs), 1.1), 96.29031327635312);
59
- expect(exponentialFitFunc.y(exponentialFitFunc.getInitialParameters(exponentialXs, exponentialYs), 1.1), 11.080315836233387);
60
- expect(polynomialFitFunc.y(polynomialFitFunc.getInitialParameters(polynomialXs, polynomialYs), 1.1), 7.3231);
61
- });
62
-
63
- test('getCurve', async () => {
64
- const sigmoidCurve = getCurve(sigmoidSeries, sigmoidFitFunc);
65
- const linearCurve = getCurve(linearSeries, linearFitFunc);
66
- const logLinearCurve = getCurve(logLinearSeries, logLinearFitFunc);
67
- const exponentialCurve = getCurve(exponentialSeries, exponentialFitFunc);
68
- const polynomialCurve = getCurve(polynomialSeries, polynomialFitFunc);
69
-
70
- expect(sigmoidCurve(2.5), 1.690786623428712);
71
- expect(sigmoidCurve(5.8858), 0.5356638447565519);
72
- expect(linearCurve(2.5), -3.18454647064209);
73
- expect(linearCurve(5.8858), -21.658870516967774);
74
- expect(logLinearCurve(2.5), 79.85176680360948);
75
- expect(logLinearCurve(5.8858), 74.12932588432805);
76
- expect(exponentialCurve(0.01), 79.68277758636006);
77
- expect(exponentialCurve(0.00001345), 88.4439865528934);
78
- expect(polynomialCurve(1.56), 7.650264639782428);
79
- expect(polynomialCurve(3.99876), 6.093284856699922);
80
- });
81
-
82
- test('fitSeries', async () => {
83
- const start = Date.now();
84
- const sigmoidFitSeries = fitSeries(sigmoidSeries, sigmoidFitFunc);
85
- const linearFitSeries = fitSeries(linearSeries, linearFitFunc);
86
- const logLinearFitSeries = fitSeries(logLinearSeries, logLinearFitFunc);
87
- const exponentialFitSeries = fitSeries(exponentialSeries, exponentialFitFunc);
88
- const polynomialFitSeries = fitSeries(polynomialSeries, polynomialFitFunc);
89
- const stop = Date.now();
90
-
91
- expect(sigmoidFitSeries.fittedCurve(2.5), 1.7048618582775712);
92
- expect(linearFitSeries.fittedCurve(2.5), 1.5337481647729874);
93
- expect(logLinearFitSeries.fittedCurve(2.5), 1.4879121793209378);
94
- expect(exponentialFitSeries.fittedCurve(0.00001345), 2.739771889293024);
95
- expect(polynomialFitSeries.fittedCurve(3.99876), 6.449473383870631);
96
- expectArray(sigmoidFitSeries.parameters, [1.7049071788787842, 1.569833517074585, 5.36868143081665, 0.2605934143066406]);
97
- expectArray(linearFitSeries.parameters, [-0.21358928084373474, 2.067721366882324]);
98
- expectArray(logLinearFitSeries.parameters, [-1.1107122898101807, 2.879371404647827]);
99
- expectArray(exponentialFitSeries.parameters, [2.739849090576172, -2.0949888229370117]);
100
- expectArray(polynomialFitSeries.parameters, [0.05000000074505806, -0.887523889541626, 2.861894130706787, 6]);
101
- return `${stop.valueOf() - start.valueOf()} ms`;
102
- });
103
-
104
- test('getSeriesConfidenceInterval', async () => {
105
- const sigmoidSeriesConfidenceIntervals = getSeriesConfidenceInterval(sigmoidSeries, sigmoidFitFunc, true);
106
- const linearSeriesConfidenceIntervals = getSeriesConfidenceInterval(linearSeries, linearFitFunc, true);
107
- const logLinearSeriesConfidenceIntervals = getSeriesConfidenceInterval(logLinearSeries, logLinearFitFunc, true);
108
- const exponentialSeriesConfidenceIntervals = getSeriesConfidenceInterval(exponentialSeries, exponentialFitFunc, true);
109
- const polynomialSeriesConfidenceIntervals = getSeriesConfidenceInterval(polynomialSeries, polynomialFitFunc, true);
110
-
111
- expect(sigmoidSeriesConfidenceIntervals.confidenceTop(2.578), 1.8540855269320198);
112
- expect(linearSeriesConfidenceIntervals.confidenceTop(2.578), 26.645777275332037);
113
- expect(logLinearSeriesConfidenceIntervals.confidenceTop(2.578), 231.75768109324696);
114
- expect(exponentialSeriesConfidenceIntervals.confidenceTop(0.00001345), 103.51168317113999);
115
- expect(polynomialSeriesConfidenceIntervals.confidenceTop(2.3342), 10.03522960294218);
116
- expect(sigmoidSeriesConfidenceIntervals.confidenceBottom(3.987), 1.4949306416468298);
117
- expect(linearSeriesConfidenceIntervals.confidenceBottom(3.987), -41.55415698266847);
118
- expect(logLinearSeriesConfidenceIntervals.confidenceBottom(3.987), -75.23471085303483);
119
- expect(exponentialSeriesConfidenceIntervals.confidenceBottom(0.01), 64.61508096811347);
120
- expect(polynomialSeriesConfidenceIntervals.confidenceBottom(3.8796), 4.1686506915250385);
121
- });
122
-
123
- test('getSeriesStatistics', async () => {
124
- const sigmoidSeriesStatistics = getSeriesStatistics(sigmoidSeries, sigmoidFitFunc);
125
- // TODO: statistics tests on linear, log linear and exponential series
126
- const polynomialSeriesStatistics = getSeriesStatistics(polynomialSeries, polynomialFitFunc);
127
-
128
- expect(sigmoidSeriesStatistics.auc, 9.335422628533761);
129
- expect(polynomialSeriesStatistics.auc, 36.525538394763096);
130
- expect(sigmoidSeriesStatistics.rSquared, 0.9781915962461156);
131
- expect(polynomialSeriesStatistics.rSquared, 0.846055768956569);
132
- });
133
-
134
- test('calculateBoxPlotStatistics', async () => {
135
- const values = [0.7654603719711304, 0.8199243545532227, 0.8257747292518616, 0.9558155536651611, 0.9596694707870483];
136
- const boxPlotStats = calculateBoxPlotStatistics(values);
137
-
138
- expect(boxPlotStats.q1, 0.8199243545532227);
139
- expect(boxPlotStats.q2, 0.8257747292518616);
140
- expect(boxPlotStats.q3, 0.9558155536651611);
141
- expect(boxPlotStats.lowerAdjacentValue, 0.7654603719711304);
142
- expect(boxPlotStats.upperAdjacentValue, 0.9558155536651611);
143
- });
144
-
145
- test('sigmoid', async () => {
146
- const parameters = [2.612687371569039, -1.421800778574126, 5.16688669906018, 0.341788492203575];
147
- const params = new Float32Array(4);
148
- params.set(parameters);
149
- expect(sigmoid(params, 0.5), 0.341789026340178);
150
- expect(sigmoid(params, 2.5), 0.34215523020636207);
151
- expect(sigmoid(params, 5.678976), 2.2548815999597016);
152
- });
153
-
154
- test('linear', async () => {
155
- const parameters = [-5.12346546, 6.24654654];
156
- const params = new Float32Array(2);
157
- params.set(parameters);
158
- expect(linear(params, 0.5), 3.684813976287842);
159
- expect(linear(params, 2.5), -6.562117099761963);
160
- expect(linear(params, 5.678976), -22.849491081970214);
161
- });
162
-
163
- test('log-linear', async () => {
164
- const parameters = [-5.12346546, 91.5465454654];
165
- const params = new Float32Array(2);
166
- params.set(parameters);
167
- expect(logLinear(params, 0.5), 89.46916042777144);
168
- expect(logLinear(params, 2.5), 85.12805903963536);
169
- expect(logLinear(params, 5.678976), 81.81726682791052);
170
- });
171
-
172
- test('exponential', async () => {
173
- const parameters = [95.12346546, -11.5465454654];
174
- const params = new Float32Array(2);
175
- params.set(parameters);
176
- expect(exponential(params, 0.0005), 94.57587501550823);
177
- expect(exponential(params, 0.5), 0.2957925783034655);
178
- expect(exponential(params, 0.98746), 0.0010630898492656174);
179
- });
33
+ test('getSeriesFitFunction', async () => {
34
+ const {xs: sigmoidXs, ys: sigmoidYs} = getPointsArrays(sigmoidSeries.points);
35
+ const {xs: linearXs, ys: linearYs} = getPointsArrays(linearSeries.points);
36
+ const {xs: logLinearXs, ys: logLinearYs} = getPointsArrays(logLinearSeries.points);
37
+ const {xs: exponentialXs, ys: exponentialYs} = getPointsArrays(exponentialSeries.points);
38
+ const {xs: polynomialXs, ys: polynomialYs} = getPointsArrays(polynomialSeries.points);
39
+
40
+ expect(sigmoidFitFunc.name, FIT_FUNCTION_SIGMOID);
41
+ expect(linearFitFunc.name, FIT_FUNCTION_LINEAR);
42
+ expect(logLinearFitFunc.name, FIT_FUNCTION_LOG_LINEAR);
43
+ expect(exponentialFitFunc.name, FIT_FUNCTION_EXPONENTIAL);
44
+ expect(polynomialFitFunc.name, 'Polynomial');
45
+ expectArray(sigmoidFitFunc.parameterNames, ['Top', 'Slope', 'IC50', 'Bottom']);
46
+ expectArray(linearFitFunc.parameterNames, ['Slope', 'Intercept']);
47
+ expectArray(logLinearFitFunc.parameterNames, ['Slope', 'Intercept']);
48
+ expectArray(exponentialFitFunc.parameterNames, ['Mantissa', 'Power']);
49
+ expectArray(polynomialFitFunc.parameterNames, ['Slope', 'Intercept', 'Parameter3', 'Parameter4']);
50
+ expectArray(sigmoidFitFunc.getInitialParameters(sigmoidXs, sigmoidYs), [1.8561450242996216, 1, 5.099999904632568, 0.23361243307590485]);
51
+ expectArray(linearFitFunc.getInitialParameters(linearXs, linearYs), [-0.1868094652891159, 1.5599596500396729]);
52
+ expectArray(logLinearFitFunc.getInitialParameters(logLinearXs, logLinearYs), [-5, 100]);
53
+ expectArray(exponentialFitFunc.getInitialParameters(exponentialXs, exponentialYs), [100, -2]);
54
+ expectArray(polynomialFitFunc.getInitialParameters(polynomialXs, polynomialYs), [0.1, -1, 4, 4]);
55
+ const params = new Float32Array(sigmoidSeries.parameters?.length!);
56
+ params.set(sigmoidSeries.parameters!);
57
+ expect(sigmoidFitFunc.y(params, 1.1), 1.6914214561555851);
58
+ expect(linearFitFunc.y(linearFitFunc.getInitialParameters(linearXs, linearYs), 1.1), 1.3544692382216454);
59
+ expect(logLinearFitFunc.y(logLinearFitFunc.getInitialParameters(logLinearXs, logLinearYs), 1.1), 96.29031327635312);
60
+ expect(exponentialFitFunc.y(exponentialFitFunc.getInitialParameters(exponentialXs, exponentialYs), 1.1), 11.080315836233387);
61
+ expect(polynomialFitFunc.y(polynomialFitFunc.getInitialParameters(polynomialXs, polynomialYs), 1.1), 7.3231);
62
+ });
63
+
64
+ test('getCurve', async () => {
65
+ const sigmoidCurve = getCurve(sigmoidSeries, sigmoidFitFunc);
66
+ const linearCurve = getCurve(linearSeries, linearFitFunc);
67
+ const logLinearCurve = getCurve(logLinearSeries, logLinearFitFunc);
68
+ const exponentialCurve = getCurve(exponentialSeries, exponentialFitFunc);
69
+ const polynomialCurve = getCurve(polynomialSeries, polynomialFitFunc);
70
+
71
+ expect(sigmoidCurve(2.5), 1.690786623428712);
72
+ expect(sigmoidCurve(5.8858), 0.5356638447565519);
73
+ expect(linearCurve(2.5), -3.18454647064209);
74
+ expect(linearCurve(5.8858), -21.658870516967774);
75
+ expect(logLinearCurve(2.5), 79.85176680360948);
76
+ expect(logLinearCurve(5.8858), 74.12932588432805);
77
+ expect(exponentialCurve(0.01), 79.68277758636006);
78
+ expect(exponentialCurve(0.00001345), 88.4439865528934);
79
+ expect(polynomialCurve(1.56), 7.650264639782428);
80
+ expect(polynomialCurve(3.99876), 6.093284856699922);
81
+ });
82
+
83
+ test('fitSeries', async () => {
84
+ const start = Date.now();
85
+ const sigmoidFitSeries = fitSeries(sigmoidSeries, sigmoidFitFunc);
86
+ const linearFitSeries = fitSeries(linearSeries, linearFitFunc);
87
+ const logLinearFitSeries = fitSeries(logLinearSeries, logLinearFitFunc);
88
+ const exponentialFitSeries = fitSeries(exponentialSeries, exponentialFitFunc);
89
+ const polynomialFitSeries = fitSeries(polynomialSeries, polynomialFitFunc);
90
+ const stop = Date.now();
91
+
92
+ expect(sigmoidFitSeries.fittedCurve(2.5), 1.6903875076701773);
93
+ expect(linearFitSeries.fittedCurve(2.5), 1.5348530188202858);
94
+ expect(logLinearFitSeries.fittedCurve(2.5), 1.3696734183366701);
95
+ expect(exponentialFitSeries.fittedCurve(0.00001345), 2.005337264075174);
96
+ expect(polynomialFitSeries.fittedCurve(3.99876), 5.911350894323636);
97
+ expectArray(sigmoidFitSeries.parameters, [1.690911054611206, 1.1880898475646973, 5.402130603790283, 0.22163867950439453]);
98
+ expectArray(linearFitSeries.parameters, [-0.21431826055049896, 2.070648670196533]);
99
+ expectArray(logLinearFitSeries.parameters, [-0.6303421854972839, 2.1593427658081055]);
100
+ expectArray(exponentialFitSeries.parameters, [2.005340814590454, -0.13163800537586212]);
101
+ expectArray(polynomialFitSeries.parameters, [0.06199381500482559, -0.9554166793823242, 2.872941017150879, 5.736424446105957]);
102
+ return `${stop.valueOf() - start.valueOf()} ms`;
103
+ });
104
+
105
+ test('fitSeries sigmoid benchmark', async () => {
106
+ const start = Date.now();
107
+ fitSeries(sigmoidSeries, sigmoidFitFunc);
108
+ const stop = Date.now();
109
+ return `${stop.valueOf() - start.valueOf()} ms`;
110
+ }, {benchmark: true});
111
+
112
+ test('fitSeries linear benchmark', async () => {
113
+ const start = Date.now();
114
+ fitSeries(linearSeries, linearFitFunc);
115
+ const stop = Date.now();
116
+ return `${stop.valueOf() - start.valueOf()} ms`;
117
+ }, {benchmark: true});
118
+
119
+ test('fitSeries log-linear benchmark', async () => {
120
+ const start = Date.now();
121
+ fitSeries(logLinearSeries, logLinearFitFunc);
122
+ const stop = Date.now();
123
+ return `${stop.valueOf() - start.valueOf()} ms`;
124
+ }, {benchmark: true});
125
+
126
+ test('fitSeries exponential benchmark', async () => {
127
+ const start = Date.now();
128
+ fitSeries(exponentialSeries, exponentialFitFunc);
129
+ const stop = Date.now();
130
+ return `${stop.valueOf() - start.valueOf()} ms`;
131
+ }, {benchmark: true});
132
+
133
+ test('fitSeries polynomial benchmark', async () => {
134
+ const start = Date.now();
135
+ fitSeries(polynomialSeries, polynomialFitFunc);
136
+ const stop = Date.now();
137
+ return `${stop.valueOf() - start.valueOf()} ms`;
138
+ }, {benchmark: true});
139
+
140
+ test('getSeriesConfidenceInterval', async () => {
141
+ const sigmoidSeriesConfidenceIntervals = getSeriesConfidenceInterval(sigmoidSeries, sigmoidFitFunc, true);
142
+ const linearSeriesConfidenceIntervals = getSeriesConfidenceInterval(linearSeries, linearFitFunc, true);
143
+ const logLinearSeriesConfidenceIntervals = getSeriesConfidenceInterval(logLinearSeries, logLinearFitFunc, true);
144
+ const exponentialSeriesConfidenceIntervals = getSeriesConfidenceInterval(exponentialSeries, exponentialFitFunc, true);
145
+ const polynomialSeriesConfidenceIntervals = getSeriesConfidenceInterval(polynomialSeries, polynomialFitFunc, true);
146
+
147
+ expect(sigmoidSeriesConfidenceIntervals.confidenceTop(2.578), 1.8540855269320198);
148
+ expect(linearSeriesConfidenceIntervals.confidenceTop(2.578), 26.645777275332037);
149
+ expect(logLinearSeriesConfidenceIntervals.confidenceTop(2.578), 231.75768109324696);
150
+ expect(exponentialSeriesConfidenceIntervals.confidenceTop(0.00001345), 103.51168317113999);
151
+ expect(polynomialSeriesConfidenceIntervals.confidenceTop(2.3342), 10.03522960294218);
152
+ expect(sigmoidSeriesConfidenceIntervals.confidenceBottom(3.987), 1.4949306416468298);
153
+ expect(linearSeriesConfidenceIntervals.confidenceBottom(3.987), -41.55415698266847);
154
+ expect(logLinearSeriesConfidenceIntervals.confidenceBottom(3.987), -75.23471085303483);
155
+ expect(exponentialSeriesConfidenceIntervals.confidenceBottom(0.01), 64.61508096811347);
156
+ expect(polynomialSeriesConfidenceIntervals.confidenceBottom(3.8796), 4.1686506915250385);
157
+ });
158
+
159
+ test('getSeriesStatistics', async () => {
160
+ const sigmoidSeriesStatistics = getSeriesStatistics(sigmoidSeries, sigmoidFitFunc);
161
+ // TODO: statistics tests on linear, log linear and exponential series
162
+ const polynomialSeriesStatistics = getSeriesStatistics(polynomialSeries, polynomialFitFunc);
163
+
164
+ expect(sigmoidSeriesStatistics.auc, 9.335422628533761);
165
+ expect(polynomialSeriesStatistics.auc, 36.525538394763096);
166
+ expect(sigmoidSeriesStatistics.rSquared, 0.9781915962461156);
167
+ expect(polynomialSeriesStatistics.rSquared, 0.846055768956569);
168
+ });
169
+
170
+ test('calculateBoxPlotStatistics', async () => {
171
+ const values = [0.7654603719711304, 0.8199243545532227, 0.8257747292518616, 0.9558155536651611, 0.9596694707870483];
172
+ const boxPlotStats = calculateBoxPlotStatistics(values);
173
+
174
+ expect(boxPlotStats.q1, 0.8199243545532227);
175
+ expect(boxPlotStats.q2, 0.8257747292518616);
176
+ expect(boxPlotStats.q3, 0.9558155536651611);
177
+ expect(boxPlotStats.lowerAdjacentValue, 0.7654603719711304);
178
+ expect(boxPlotStats.upperAdjacentValue, 0.9558155536651611);
179
+ });
180
+
181
+ test('sigmoid', async () => {
182
+ const parameters = [2.612687371569039, -1.421800778574126, 5.16688669906018, 0.341788492203575];
183
+ const params = new Float32Array(4);
184
+ params.set(parameters);
185
+ expect(sigmoid(params, 0.5), 0.341789026340178);
186
+ expect(sigmoid(params, 2.5), 0.34215523020636207);
187
+ expect(sigmoid(params, 5.678976), 2.2548815999597016);
188
+ });
189
+
190
+ test('linear', async () => {
191
+ const parameters = [-5.12346546, 6.24654654];
192
+ const params = new Float32Array(2);
193
+ params.set(parameters);
194
+ expect(linear(params, 0.5), 3.684813976287842);
195
+ expect(linear(params, 2.5), -6.562117099761963);
196
+ expect(linear(params, 5.678976), -22.849491081970214);
197
+ });
198
+
199
+ test('log-linear', async () => {
200
+ const parameters = [-5.12346546, 91.5465454654];
201
+ const params = new Float32Array(2);
202
+ params.set(parameters);
203
+ expect(logLinear(params, 0.5), 89.46916042777144);
204
+ expect(logLinear(params, 2.5), 85.12805903963536);
205
+ expect(logLinear(params, 5.678976), 81.81726682791052);
206
+ });
207
+
208
+ test('exponential', async () => {
209
+ const parameters = [95.12346546, -11.5465454654];
210
+ const params = new Float32Array(2);
211
+ params.set(parameters);
212
+ expect(exponential(params, 0.0005), 94.57587501550823);
213
+ expect(exponential(params, 0.5), 0.2957925783034655);
214
+ expect(exponential(params, 0.98746), 0.0010630898492656174);
215
+ });
180
216
  });
@@ -0,0 +1,153 @@
1
+ /* eslint-disable max-len */
2
+ import * as DG from 'datagrok-api/dg';
3
+ import * as ui from 'datagrok-api/ui';
4
+
5
+ import {category, expect, test} from '@datagrok-libraries/utils/src/test';
6
+ import {Plate} from '../plate/plate';
7
+
8
+ // @ts-ignore
9
+ import * as jStat from 'jstat';
10
+ import {excelToNum, numToExcel} from '../plate/utils';
11
+ import {PlateWidget} from '../plate/plate-widget';
12
+
13
+
14
+ function getPlate(): Plate {
15
+ const concentration = Plate.fromCsvTable(concentrationCsv, 'concentration');
16
+ const layout = Plate.fromCsvTable(layoutCsv, 'role');
17
+ const readout = Plate.fromCsvTable(readoutCsv, 'readout');
18
+
19
+ return Plate.fromPlates([concentration, layout, readout]);
20
+ }
21
+
22
+ category('plates', () => {
23
+ test('fromCsvPlate', async () => {
24
+ const plate = Plate.fromCsv(concentrationCsv, {field: 'concentration'});
25
+ plate.print();
26
+ expect(plate.rows, 16);
27
+ expect(plate.cols, 24);
28
+ });
29
+
30
+ test('mergePlates', async () => {
31
+ const concentration = Plate.fromCsvTable(concentrationCsv, 'concentration');
32
+ const layout = Plate.fromCsvTable(layoutCsv, 'role');
33
+ const readout = Plate.fromCsvTable(readoutCsv, 'value');
34
+
35
+ readout.merge(layout).merge(concentration).print();
36
+ });
37
+
38
+ test('fromFile', async () => {
39
+ const concentration = await Plate.fromCsvTableFile('System:DemoFiles/hts/plate/concentration.csv', 'concentration');
40
+ const layout = await Plate.fromCsvTableFile('System:DemoFiles/hts/plate/layout.csv', 'role');
41
+ const readout = await Plate.fromCsvTableFile('System:DemoFiles/hts/plate/readout.csv', 'value');
42
+
43
+ Plate.fromPlates([concentration, layout, readout]).print();
44
+ });
45
+
46
+ test('fromExcel', async () => {
47
+ const plate = await Plate.fromExcelPath('System:DemoFiles/hts/xlsx_plates/plate1.xlsx');
48
+ ui.dialog({title: 'Inspect plate'})
49
+ .add(PlateWidget.detailedView(plate).root)
50
+ .show({width: 500, height: 500});
51
+ await DG.delay(10000);
52
+ });
53
+
54
+ test('normalization', async () => {
55
+ const plate = getPlate();
56
+
57
+ const hcMean = jStat.mean(plate.fieldValues('readout', {match: {'layout': 'High Control'}}));
58
+ const lcMean = jStat.mean(plate.fieldValues('readout', {match: {'layout': 'Low Control'}}));
59
+ plate.normalize('readout', (value) => (hcMean - value) / (hcMean - lcMean));
60
+ });
61
+
62
+ test('use case', async () => {
63
+ const plate = getPlate();
64
+
65
+ const hcMean = jStat.mean(plate.fieldValues('readout', {match: {'layout': 'High Control'}}));
66
+ const lcMean = jStat.mean(plate.fieldValues('readout', {match: {'layout': 'Low Control'}}));
67
+ plate.normalize('readout', (value) => (hcMean - value) / (hcMean - lcMean));
68
+
69
+ const drc = plate.doseResponseSeries({concentration: 'concentration', value: 'readout'}); // if we get
70
+ Plate.inspectSeries(drc['Compound 1'], '4pl-regression');
71
+ });
72
+
73
+ test('render', async () => {
74
+ const plate = getPlate();
75
+ ui.dialog({title: 'Inspect plate'})
76
+ .add(PlateWidget.detailedView(plate).root)
77
+ .show({width: 500, height: 500});
78
+ await DG.delay(10000);
79
+ });
80
+
81
+ test('numToExcel', async () => {
82
+ expect(numToExcel(0), 'A');
83
+ expect(numToExcel(1), 'B');
84
+ expect(numToExcel(26), 'AA');
85
+ expect(numToExcel(52), 'BA');
86
+ });
87
+
88
+ test('excelToNum', async () => {
89
+ expect(excelToNum('A'), 0);
90
+ expect(excelToNum('B'), 1);
91
+ expect(excelToNum('Z'), 25);
92
+
93
+ expect(excelToNum('AA'), 26);
94
+ expect(excelToNum('BA'), 52);
95
+ });
96
+ });
97
+
98
+
99
+ const concentrationCsv = `col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
100
+ A,,,,,,,,,,,,,,,,,,,,,,,,
101
+ B,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
102
+ C,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
103
+ D,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
104
+ E,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
105
+ F,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
106
+ G,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
107
+ H,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
108
+ I,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
109
+ J,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
110
+ K,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
111
+ L,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
112
+ M,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
113
+ N,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,
114
+ O,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,
115
+ P,,,,,,,,,,,,,,,,,,,,,,,,`;
116
+
117
+
118
+ const layoutCsv = `col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
119
+ A,,,,,,,,,,,,,,,,,,,,,,,,
120
+ B,,Low Control,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Low Control,
121
+ C,,High Control,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,High Control,
122
+ D,,Low Control,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Low Control,
123
+ E,,High Control,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,High Control,
124
+ F,,Low Control,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Low Control,
125
+ G,,High Control,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,High Control,
126
+ H,,Low Control,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Low Control,
127
+ I,,High Control,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,High Control,
128
+ J,,Low Control,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Low Control,
129
+ K,,High Control,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,High Control,
130
+ L,,Low Control,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Low Control,
131
+ M,,High Control,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,High Control,
132
+ N,,Low Control,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Low Control,
133
+ O,,High Control,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,High Control,
134
+ P,,,,,,,,,,,,,,,,,,,,,,,,`;
135
+
136
+
137
+ const readoutCsv = `col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
138
+ A,,,,,,,,,,,,,,,,,,,,,,,,
139
+ B,,0.07219099668,0.06947737465,0.07019976172,0.07263956168,0.07334269904,0.07654089128,0.07628940202,0.08834969214,0.13557287840,0.1486864679,0.1503697113,0.15200083420,0.15061775480,0.15309907440,0.15286653780,0.15379914010,0.15155727890,0.15232794460,0.15298766400,0.1538730651,0.1542393465,0.15071555580,
140
+ C,,0.14996855360,0.07212290660,0.06957076093,0.07069321642,0.07227733865,0.07664359412,0.07918610560,0.07808503586,0.12496495030,0.1378908893,0.1465698921,0.15578283900,0.15186884230,0.15151635070,0.15141401530,0.15052587190,0.15486747600,0.15294037650,0.15241116130,0.1546532344,0.1537365814,0.07231605295,
141
+ D,,0.07023863668,0.07030474895,0.07086594623,0.07378772619,0.07813099195,0.08443275691,0.10024937710,0.11821695280,0.14031173800,0.1505845411,0.1505987702,0.07099481653,0.07322787956,0.07588648236,0.08377558210,0.09888790085,0.11395358370,0.12947949180,0.14055841590,0.1493699333,0.1540055735,0.15226875140,
142
+ E,,0.14929130930,0.06932695867,0.07157716491,0.07214187679,0.07721194315,0.08504549754,0.10174360480,0.11748417490,0.13321393730,0.1456650512,0.1483001297,0.07167267085,0.07383087952,0.07670410142,0.08204578635,0.09386326869,0.11296832520,0.30900000000,0.13807843210,0.1487301787,0.1519785410,0.07219836243,
143
+ F,,0.07063914398,0.07039007372,0.07078597316,0.07132027961,0.07222210814,0.07442561862,0.08135627908,0.09196745273,0.11146019360,0.1364485205,0.1450632971,0.08126099235,0.09318398047,0.10961914380,0.12860206080,0.14110717340,0.14655533300,0.15212245890,0.15233422070,0.1521740437,0.1539843278,0.15514745160,
144
+ G,,0.15147635060,0.07238581078,0.06968522213,0.07128524617,0.07252406181,0.07567350355,0.07943235275,0.09117074615,0.10537654310,0.1344820888,0.1400224330,0.08242500433,0.09563371204,0.10936069820,0.12848949680,0.14108995770,0.14405660970,0.15031406210,0.15131600980,0.1522018720,0.1534152011,0.07219962790,
145
+ H,,0.07201551934,0.14139074650,0.10970399700,0.14927003800,0.15153471030,0.15239784500,0.15275285200,0.15300022370,0.15204696770,0.1499048651,0.1522479639,0.08013306126,0.08511773454,0.09873312909,0.11965236570,0.13423325770,0.14790643020,0.14787378410,0.15121033310,0.1516832849,0.1546688514,0.15391338010,
146
+ I,,0.15106747120,0.14298828240,0.14478508750,0.14400005770,0.12812788070,0.15020659840,0.15070640480,0.14981230230,0.15107167610,0.1525554191,0.1492535524,0.08018720930,0.08601155699,0.09880353225,0.11672648890,0.13325225690,0.14354164670,0.14463708830,0.15318329890,0.1521327032,0.1512182552,0.07244861048,
147
+ J,,0.07134151692,0.07106139536,0.07290563639,0.07320964199,0.07531163459,0.08077714646,0.08726929940,0.10068593880,0.11914215450,0.1418191958,0.1443463920,0.07247201272,0.06999750950,0.07076991276,0.07228675508,0.07237591892,0.07201251723,0.07741640477,0.08773368972,0.1219768071,0.1387552698,0.15192226570,
148
+ K,,0.15000436380,0.07156625599,0.07087075250,0.07123659002,0.07345421874,0.07832545577,0.08734304748,0.09985159477,0.11591447310,0.1397237122,0.1459823861,0.07214517236,0.07005683091,0.07016838344,0.07131776580,0.07200174821,0.07350492337,0.07785311421,0.08866229169,0.1234911377,0.1371697196,0.07064796366,
149
+ L,,0.07054096934,0.07004726921,0.07201825002,0.07179815990,0.07268889103,0.07379454514,0.07427085340,0.07982570255,0.08854676858,0.1198873673,0.1322562498,0.07034679393,0.07523627163,0.07582258339,0.08392782907,0.09669262374,0.11261560310,0.12874291890,0.14171585180,0.1491004443,0.1502214336,0.15198125010,
150
+ M,,0.15232172270,0.07166689716,0.07099964730,0.07172948942,0.07140356089,0.07359647053,0.07391627346,0.07872536050,0.08793247921,0.1177668597,0.1316288144,0.06733039177,0.07260462946,0.07516068933,0.08359475310,0.09611904399,0.11364151330,0.12772328380,0.14070692820,0.1486696188,0.1541842928,0.07174453270,
151
+ N,,0.07126884935,0.07332587669,0.07786873273,0.08482253378,0.10140499840,0.11854947500,0.13401382360,0.14613488070,0.15066237370,0.1545757395,0.1510962397,0.07286614211,0.07215169457,0.07227939024,0.07337505876,0.07530546981,0.08265249465,0.09167518260,0.11122719660,0.1391977320,0.1459690588,0.15291802550,
152
+ O,,0.15243482930,0.07280165939,0.07688708790,0.31500000000,0.09886803400,0.11454911710,0.12960429510,0.14047477320,0.14718270040,0.1509524590,0.1501338551,0.07212897291,0.07072700474,0.07059273173,0.07088234657,0.07421414395,0.08105493058,0.09094554089,0.10660934950,0.1358113503,0.1432621746,0.07009305748,
153
+ P,,,,,,,,,,,,,,,,,,,,,,,,`;