@datagrok/curves 1.12.0 → 1.12.2
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.
- package/CHANGELOG.md +15 -0
- package/CLAUDE.md +0 -12
- package/CREDITS.md +79 -0
- package/agents/package-knowledge.yaml +29 -0
- package/dist/package-test.js +109 -23
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +104 -23
- package/dist/package.js.map +1 -1
- package/files/demo/Assay_Curves.csv +44 -0
- package/files/demo/Assay_Curves.layout +981 -0
- package/package.json +4 -3
- package/src/fit/curve-converter.ts +8 -1
- package/src/fit/fit-demo.ts +13 -0
- package/src/package-api.ts +19 -12
- package/src/package.g.ts +29 -15
- package/src/package.ts +46 -10
- package/src/tests/converter-tests.ts +6 -0
- package/test-console-output-1.log +109 -50
- package/test-record-1.mp4 +0 -0
package/dist/package.js
CHANGED
|
@@ -7872,7 +7872,15 @@ function parseCellValue(cellValue, column) {
|
|
|
7872
7872
|
if (!cellValue || cellValue === '')
|
|
7873
7873
|
return { series: [] };
|
|
7874
7874
|
const jsonStr = column ? convertCellValue(cellValue, column) : cellValue;
|
|
7875
|
-
|
|
7875
|
+
try {
|
|
7876
|
+
return (_a = JSON.parse(jsonStr !== null && jsonStr !== void 0 ? jsonStr : '{}')) !== null && _a !== void 0 ? _a : {};
|
|
7877
|
+
}
|
|
7878
|
+
catch (_e) {
|
|
7879
|
+
// Cell value is not valid fit JSON (e.g. a column mis-detected as 'fit' via a substring match).
|
|
7880
|
+
// Degrade to an empty chart so the renderer hits the existing 'No series to show' path and draws the
|
|
7881
|
+
// incorrect-fit marker, instead of throwing a SyntaxError on every grid redraw.
|
|
7882
|
+
return { series: [] };
|
|
7883
|
+
}
|
|
7876
7884
|
}
|
|
7877
7885
|
/** Returns true if the column uses a non-native format (has a converter). */
|
|
7878
7886
|
function hasConverter(column) {
|
|
@@ -8574,6 +8582,7 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
8574
8582
|
"use strict";
|
|
8575
8583
|
__webpack_require__.r(__webpack_exports__);
|
|
8576
8584
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8585
|
+
/* harmony export */ assayCurvesDemo: () => (/* binding */ assayCurvesDemo),
|
|
8577
8586
|
/* harmony export */ createDemoDataFrame: () => (/* binding */ createDemoDataFrame),
|
|
8578
8587
|
/* harmony export */ createSigmoidPoints: () => (/* binding */ createSigmoidPoints),
|
|
8579
8588
|
/* harmony export */ curveDemo: () => (/* binding */ curveDemo)
|
|
@@ -8690,6 +8699,20 @@ function curveDemo() {
|
|
|
8690
8699
|
// tableView.addViewer('MultiCurveViewer');
|
|
8691
8700
|
});
|
|
8692
8701
|
}
|
|
8702
|
+
function assayCurvesDemo() {
|
|
8703
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8704
|
+
const df = yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_1__.data.loadTable(`${_package__WEBPACK_IMPORTED_MODULE_2__._package.webRoot}files/demo/Assay_Curves.csv`);
|
|
8705
|
+
yield df.meta.detectSemanticTypes();
|
|
8706
|
+
const layoutTXT = yield _package__WEBPACK_IMPORTED_MODULE_2__._package.files.readAsText('demo/Assay_Curves.layout');
|
|
8707
|
+
const layout = datagrok_api_dg__WEBPACK_IMPORTED_MODULE_0__.ViewLayout.fromJson(layoutTXT);
|
|
8708
|
+
df.selection.set(13, true);
|
|
8709
|
+
df.selection.set(14, true); // two curves for multicurve viewer
|
|
8710
|
+
const tv = datagrok_api_grok__WEBPACK_IMPORTED_MODULE_1__.shell.addTableView(df);
|
|
8711
|
+
yield datagrok_api_dg__WEBPACK_IMPORTED_MODULE_0__.delay(100);
|
|
8712
|
+
tv.loadLayout(layout, true);
|
|
8713
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_1__.shell.info('Select cells in Trellis plot to see corresponding curves in Multi Curve Viewer.', { timeout: 10 });
|
|
8714
|
+
});
|
|
8715
|
+
}
|
|
8693
8716
|
|
|
8694
8717
|
|
|
8695
8718
|
/***/ },
|
|
@@ -10673,6 +10696,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10673
10696
|
/* harmony export */ _initCurves: () => (/* binding */ _initCurves),
|
|
10674
10697
|
/* harmony export */ addAggrStatisticsColumn: () => (/* binding */ addAggrStatisticsColumn),
|
|
10675
10698
|
/* harmony export */ addStatisticsColumn: () => (/* binding */ addStatisticsColumn),
|
|
10699
|
+
/* harmony export */ assayCurveFitDemo: () => (/* binding */ assayCurveFitDemo),
|
|
10676
10700
|
/* harmony export */ convertCompactDrToJsonFunc: () => (/* binding */ convertCompactDrToJsonFunc),
|
|
10677
10701
|
/* harmony export */ convertPzfxToJsonFunc: () => (/* binding */ convertPzfxToJsonFunc),
|
|
10678
10702
|
/* harmony export */ convertXmlCurveToJsonFunc: () => (/* binding */ convertXmlCurveToJsonFunc),
|
|
@@ -10723,21 +10747,31 @@ function curveFitDemo() {
|
|
|
10723
10747
|
yield _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions.curveFitDemo();
|
|
10724
10748
|
});
|
|
10725
10749
|
}
|
|
10750
|
+
//name: Assay Curves
|
|
10751
|
+
//description: Dashboard with curves for multiple compounds, assays and targets
|
|
10752
|
+
//meta.demoPath: Curves | Assay Curves
|
|
10753
|
+
function assayCurveFitDemo() {
|
|
10754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10755
|
+
yield _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions.assayCurveFitDemo();
|
|
10756
|
+
});
|
|
10757
|
+
}
|
|
10726
10758
|
//meta.role: init
|
|
10727
10759
|
function _initCurves() {
|
|
10728
10760
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10729
10761
|
yield _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions._initCurves();
|
|
10730
10762
|
});
|
|
10731
10763
|
}
|
|
10764
|
+
//name: Fit Dose-Response Curves
|
|
10765
|
+
//description: Group well-level assay data by compound, assay, target, and run, then fit a dose-response curve per group.
|
|
10732
10766
|
//input: dataframe df
|
|
10733
|
-
//input: column concentrationCol
|
|
10734
|
-
//input: column readoutCol
|
|
10735
|
-
//input: column batchIDCol
|
|
10736
|
-
//input: column assayCol
|
|
10737
|
-
//input: column runIDCol
|
|
10738
|
-
//input: column compoundIDCol
|
|
10739
|
-
//input: column targetEntityCol
|
|
10740
|
-
//input: column excludeOutliersCol { nullable: true }
|
|
10767
|
+
//input: column concentrationCol { description: Concentration (dose) column }
|
|
10768
|
+
//input: column readoutCol { description: Readout (response) column }
|
|
10769
|
+
//input: column batchIDCol { description: Batch identifier column }
|
|
10770
|
+
//input: column assayCol { description: Assay name column }
|
|
10771
|
+
//input: column runIDCol { description: Run identifier column }
|
|
10772
|
+
//input: column compoundIDCol { description: Compound identifier column }
|
|
10773
|
+
//input: column targetEntityCol { description: Target entity column }
|
|
10774
|
+
//input: column excludeOutliersCol { nullable: true; description: Boolean column marking points to exclude as outliers }
|
|
10741
10775
|
//input: dataframe parentTable { nullable: true }
|
|
10742
10776
|
//input: list<string> fitParamColumns { nullable: true }
|
|
10743
10777
|
//input: string reportedIC50Column { nullable: true }
|
|
@@ -10761,20 +10795,24 @@ function dataToCurvesTopMenu() {
|
|
|
10761
10795
|
return yield _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions.dataToCurvesTopMenu();
|
|
10762
10796
|
});
|
|
10763
10797
|
}
|
|
10798
|
+
//name: Add Curve Statistic Column
|
|
10799
|
+
//description: Extract a fit statistic (e.g. IC50, AUC, R²) from a specific curve series into a new column.
|
|
10764
10800
|
//input: dataframe table
|
|
10765
|
-
//input: string colName
|
|
10766
|
-
//input: string propName
|
|
10767
|
-
//input: int seriesNumber
|
|
10801
|
+
//input: string colName { description: Name of the curve column to read }
|
|
10802
|
+
//input: string propName { description: Fit statistic to extract (e.g. IC50, AUC, R²) }
|
|
10803
|
+
//input: int seriesNumber { description: Zero-based index of the curve series }
|
|
10768
10804
|
//output: column result
|
|
10769
10805
|
//meta.vectorFunc: true
|
|
10770
10806
|
//meta.role: transform
|
|
10771
10807
|
function addStatisticsColumn(table, colName, propName, seriesNumber) {
|
|
10772
10808
|
return _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions.addStatisticsColumn(table, colName, propName, seriesNumber);
|
|
10773
10809
|
}
|
|
10810
|
+
//name: Add Aggregated Curve Statistic Column
|
|
10811
|
+
//description: Aggregate a fit statistic across all series of a curve into a new column.
|
|
10774
10812
|
//input: dataframe table
|
|
10775
|
-
//input: string colName
|
|
10776
|
-
//input: string propName
|
|
10777
|
-
//input: string aggrType
|
|
10813
|
+
//input: string colName { description: Name of the curve column to read }
|
|
10814
|
+
//input: string propName { description: Fit statistic to aggregate (e.g. IC50, AUC, R²) }
|
|
10815
|
+
//input: string aggrType { description: Aggregation type applied across series (e.g. avg, min, max) }
|
|
10778
10816
|
//output: column result
|
|
10779
10817
|
//meta.vectorFunc: true
|
|
10780
10818
|
//meta.role: transform
|
|
@@ -10811,7 +10849,8 @@ function previewPzfx(file) {
|
|
|
10811
10849
|
return yield _package__WEBPACK_IMPORTED_MODULE_0__.PackageFunctions.previewPzfx(file);
|
|
10812
10850
|
});
|
|
10813
10851
|
}
|
|
10814
|
-
//
|
|
10852
|
+
//description: Open a GraphPad Prism (.pzfx) file as data tables, fitting XY curve tables.
|
|
10853
|
+
//input: list bytes { description: Raw bytes of the .pzfx file }
|
|
10815
10854
|
//output: list<dataframe> result
|
|
10816
10855
|
//meta.role: fileHandler
|
|
10817
10856
|
//meta.ext: pzfx
|
|
@@ -10839,6 +10878,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10839
10878
|
/* harmony export */ _package: () => (/* binding */ _package),
|
|
10840
10879
|
/* harmony export */ addAggrStatisticsColumn: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.addAggrStatisticsColumn),
|
|
10841
10880
|
/* harmony export */ addStatisticsColumn: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.addStatisticsColumn),
|
|
10881
|
+
/* harmony export */ assayCurveFitDemo: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.assayCurveFitDemo),
|
|
10842
10882
|
/* harmony export */ convertCompactDrToJsonFunc: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.convertCompactDrToJsonFunc),
|
|
10843
10883
|
/* harmony export */ convertPzfxToJsonFunc: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.convertPzfxToJsonFunc),
|
|
10844
10884
|
/* harmony export */ convertXmlCurveToJsonFunc: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.convertXmlCurveToJsonFunc),
|
|
@@ -10923,6 +10963,11 @@ class PackageFunctions {
|
|
|
10923
10963
|
yield (0,_fit_fit_demo__WEBPACK_IMPORTED_MODULE_5__.curveDemo)();
|
|
10924
10964
|
});
|
|
10925
10965
|
}
|
|
10966
|
+
static assayCurveFitDemo() {
|
|
10967
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10968
|
+
yield (0,_fit_fit_demo__WEBPACK_IMPORTED_MODULE_5__.assayCurvesDemo)();
|
|
10969
|
+
});
|
|
10970
|
+
}
|
|
10926
10971
|
// @grok.decorators.func({
|
|
10927
10972
|
// name: 'Assay Plates',
|
|
10928
10973
|
// description: 'Assasy plates with concentration, layout and readout data',
|
|
@@ -11078,6 +11123,16 @@ __decorate([
|
|
|
11078
11123
|
__metadata("design:paramtypes", []),
|
|
11079
11124
|
__metadata("design:returntype", Promise)
|
|
11080
11125
|
], PackageFunctions, "curveFitDemo", null);
|
|
11126
|
+
__decorate([
|
|
11127
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.demo({
|
|
11128
|
+
name: 'Assay Curves',
|
|
11129
|
+
description: 'Dashboard with curves for multiple compounds, assays and targets',
|
|
11130
|
+
meta: { demoPath: 'Curves | Assay Curves' },
|
|
11131
|
+
}),
|
|
11132
|
+
__metadata("design:type", Function),
|
|
11133
|
+
__metadata("design:paramtypes", []),
|
|
11134
|
+
__metadata("design:returntype", Promise)
|
|
11135
|
+
], PackageFunctions, "assayCurveFitDemo", null);
|
|
11081
11136
|
__decorate([
|
|
11082
11137
|
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.init(),
|
|
11083
11138
|
__metadata("design:type", Function),
|
|
@@ -11085,8 +11140,18 @@ __decorate([
|
|
|
11085
11140
|
__metadata("design:returntype", Promise)
|
|
11086
11141
|
], PackageFunctions, "_initCurves", null);
|
|
11087
11142
|
__decorate([
|
|
11088
|
-
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func(
|
|
11089
|
-
|
|
11143
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({
|
|
11144
|
+
name: 'Fit Dose-Response Curves',
|
|
11145
|
+
description: 'Group well-level assay data by compound, assay, target, and run, then fit a dose-response curve per group.',
|
|
11146
|
+
}),
|
|
11147
|
+
__param(1, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Concentration (dose) column' } })),
|
|
11148
|
+
__param(2, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Readout (response) column' } })),
|
|
11149
|
+
__param(3, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Batch identifier column' } })),
|
|
11150
|
+
__param(4, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Assay name column' } })),
|
|
11151
|
+
__param(5, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Run identifier column' } })),
|
|
11152
|
+
__param(6, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Compound identifier column' } })),
|
|
11153
|
+
__param(7, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Target entity column' } })),
|
|
11154
|
+
__param(8, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true, description: 'Boolean column marking points to exclude as outliers' } })),
|
|
11090
11155
|
__param(9, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
11091
11156
|
__param(10, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
11092
11157
|
__param(11, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
@@ -11108,14 +11173,27 @@ __decorate([
|
|
|
11108
11173
|
__metadata("design:returntype", Promise)
|
|
11109
11174
|
], PackageFunctions, "dataToCurvesTopMenu", null);
|
|
11110
11175
|
__decorate([
|
|
11111
|
-
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({
|
|
11112
|
-
|
|
11176
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({
|
|
11177
|
+
name: 'Add Curve Statistic Column',
|
|
11178
|
+
description: 'Extract a fit statistic (e.g. IC50, AUC, R²) from a specific curve series into a new column.',
|
|
11179
|
+
meta: { vectorFunc: 'true', role: 'transform' },
|
|
11180
|
+
}),
|
|
11181
|
+
__param(1, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Name of the curve column to read' } })),
|
|
11182
|
+
__param(2, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Fit statistic to extract (e.g. IC50, AUC, R²)' } })),
|
|
11183
|
+
__param(3, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ type: 'int', options: { description: 'Zero-based index of the curve series' } })),
|
|
11113
11184
|
__metadata("design:type", Function),
|
|
11114
11185
|
__metadata("design:paramtypes", [datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, String, String, Number]),
|
|
11115
11186
|
__metadata("design:returntype", datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column)
|
|
11116
11187
|
], PackageFunctions, "addStatisticsColumn", null);
|
|
11117
11188
|
__decorate([
|
|
11118
|
-
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({
|
|
11189
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({
|
|
11190
|
+
name: 'Add Aggregated Curve Statistic Column',
|
|
11191
|
+
description: 'Aggregate a fit statistic across all series of a curve into a new column.',
|
|
11192
|
+
meta: { vectorFunc: 'true', role: 'transform' },
|
|
11193
|
+
}),
|
|
11194
|
+
__param(1, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Name of the curve column to read' } })),
|
|
11195
|
+
__param(2, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Fit statistic to aggregate (e.g. IC50, AUC, R²)' } })),
|
|
11196
|
+
__param(3, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { description: 'Aggregation type applied across series (e.g. avg, min, max)' } })),
|
|
11119
11197
|
__metadata("design:type", Function),
|
|
11120
11198
|
__metadata("design:paramtypes", [datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, String, String, String]),
|
|
11121
11199
|
__metadata("design:returntype", datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column)
|
|
@@ -11145,8 +11223,11 @@ __decorate([
|
|
|
11145
11223
|
__metadata("design:returntype", Promise)
|
|
11146
11224
|
], PackageFunctions, "previewPzfx", null);
|
|
11147
11225
|
__decorate([
|
|
11148
|
-
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.fileHandler({
|
|
11149
|
-
|
|
11226
|
+
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.fileHandler({
|
|
11227
|
+
ext: 'pzfx',
|
|
11228
|
+
description: 'Open a GraphPad Prism (.pzfx) file as data tables, fitting XY curve tables.',
|
|
11229
|
+
}),
|
|
11230
|
+
__param(0, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ type: 'list', options: { description: 'Raw bytes of the .pzfx file' } })),
|
|
11150
11231
|
__metadata("design:type", Function),
|
|
11151
11232
|
__metadata("design:paramtypes", [Uint8Array]),
|
|
11152
11233
|
__metadata("design:returntype", Array)
|