@datagrok/curves 1.10.0 → 1.10.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/dist/package-test.js +125 -52
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +125 -52
- package/dist/package.js.map +1 -1
- package/package.json +1 -1
- package/src/fit/data-to-curves.ts +93 -13
- package/src/package-api.ts +2 -2
- package/src/package.g.ts +4 -10
- package/src/package.ts +13 -5
- package/test-console-output-1.log +22 -23
- package/test-record-1.mp4 +0 -0
package/dist/package-test.js
CHANGED
|
@@ -9404,7 +9404,7 @@ function createFitFunctionEditor(table) {
|
|
|
9404
9404
|
}
|
|
9405
9405
|
};
|
|
9406
9406
|
}
|
|
9407
|
-
function createParentTableForm() {
|
|
9407
|
+
function createParentTableForm(onTableChange) {
|
|
9408
9408
|
const tableInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.table('Parent Table', { value: undefined, nullable: true, tooltipText: 'Table with parent data' });
|
|
9409
9409
|
const form = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.form([]);
|
|
9410
9410
|
let fitFunctionEditor = null;
|
|
@@ -9416,6 +9416,7 @@ function createParentTableForm() {
|
|
|
9416
9416
|
const onChanged = () => {
|
|
9417
9417
|
datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.empty(form);
|
|
9418
9418
|
form.appendChild(tableInput.root);
|
|
9419
|
+
onTableChange(tableInput.value);
|
|
9419
9420
|
if (!tableInput.value) {
|
|
9420
9421
|
fitFunctionEditor = null;
|
|
9421
9422
|
return;
|
|
@@ -9478,7 +9479,7 @@ function createParentTableForm() {
|
|
|
9478
9479
|
}
|
|
9479
9480
|
};
|
|
9480
9481
|
}
|
|
9481
|
-
function createWellTableForm() {
|
|
9482
|
+
function createWellTableForm(onTableChange) {
|
|
9482
9483
|
const tableInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.table('Well Table', { value: datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.shell.tv.dataFrame, nullable: false, tooltipText: 'Table with well level data' });
|
|
9483
9484
|
let assayColInput;
|
|
9484
9485
|
let concentrationColInput;
|
|
@@ -9493,6 +9494,7 @@ function createWellTableForm() {
|
|
|
9493
9494
|
var _a, _b, _c, _d, _f, _g, _h, _j;
|
|
9494
9495
|
const df = tableInput.value;
|
|
9495
9496
|
datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.empty(form);
|
|
9497
|
+
onTableChange(tableInput.value);
|
|
9496
9498
|
assayColInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.column('Assay Name', { table: df, nullable: true, filter: (c) => c.isCategorical, tooltipText: 'Column with assay names' });
|
|
9497
9499
|
concentrationColInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.column('Concentration', { table: df, nullable: false, filter: (c) => c.isNumerical, tooltipText: 'Column with concentration values' });
|
|
9498
9500
|
readoutColInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.column('Readout', { table: df, nullable: false, filter: (c) => c.isNumerical, tooltipText: 'Column with readout values' });
|
|
@@ -9536,19 +9538,84 @@ function createWellTableForm() {
|
|
|
9536
9538
|
}
|
|
9537
9539
|
};
|
|
9538
9540
|
}
|
|
9541
|
+
function createJoinEditor() {
|
|
9542
|
+
const form = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.divH([], { style: { alignItems: 'center' } });
|
|
9543
|
+
let wellLevelColInput = null;
|
|
9544
|
+
let parentLevelColInput = null;
|
|
9545
|
+
let wellDataTable = null;
|
|
9546
|
+
let parentDataTable = null;
|
|
9547
|
+
const onTableChange = (wellLevelData, parentLevelData) => {
|
|
9548
|
+
datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.empty(form);
|
|
9549
|
+
if (!wellLevelData || !parentLevelData) {
|
|
9550
|
+
wellLevelColInput = null;
|
|
9551
|
+
parentLevelColInput = null;
|
|
9552
|
+
wellDataTable = null;
|
|
9553
|
+
parentDataTable = null;
|
|
9554
|
+
return;
|
|
9555
|
+
}
|
|
9556
|
+
wellDataTable = wellLevelData;
|
|
9557
|
+
parentDataTable = parentLevelData;
|
|
9558
|
+
wellLevelColInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.column('JOIN', { table: wellLevelData, nullable: true, tooltipText: 'Column to join on from the well level data' });
|
|
9559
|
+
parentLevelColInput = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.input.column('ON', { table: parentLevelData, nullable: true, tooltipText: 'Column to join on from the parent level data' });
|
|
9560
|
+
const potentialParentCol = wu__WEBPACK_IMPORTED_MODULE_4___default()(parentLevelData.columns.categorical).map((c) => {
|
|
9561
|
+
let score = c.categories.length;
|
|
9562
|
+
if (c.name.toLowerCase().includes('id'))
|
|
9563
|
+
score += 10;
|
|
9564
|
+
if (c.name.toLowerCase().includes('unique'))
|
|
9565
|
+
score += 15;
|
|
9566
|
+
return { col: c, score: score };
|
|
9567
|
+
}).toArray().sort((a, b) => b.score - a.score)[0];
|
|
9568
|
+
if ((potentialParentCol === null || potentialParentCol === void 0 ? void 0 : potentialParentCol.col) && potentialParentCol.score > 0) {
|
|
9569
|
+
parentLevelColInput.value = potentialParentCol.col;
|
|
9570
|
+
const n = potentialParentCol.col.name.toLowerCase();
|
|
9571
|
+
const potentialWellCol = wu__WEBPACK_IMPORTED_MODULE_4___default()(wellLevelData.columns.categorical).filter((c) => c.name.toLowerCase().includes(n)).toArray()[0];
|
|
9572
|
+
if (potentialWellCol)
|
|
9573
|
+
wellLevelColInput.value = potentialWellCol;
|
|
9574
|
+
}
|
|
9575
|
+
const infoIcon = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.icons.info(() => { }, 'Specify the columns that will be used to join the well level data with the parent level data. if not specified, combination of the compound ID, assay name, target entity and run ID will be used for joining.');
|
|
9576
|
+
datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.appendAll(form, [infoIcon, wellLevelColInput.root, parentLevelColInput.root]);
|
|
9577
|
+
};
|
|
9578
|
+
return {
|
|
9579
|
+
form,
|
|
9580
|
+
getValues: () => ((wellLevelColInput === null || wellLevelColInput === void 0 ? void 0 : wellLevelColInput.value) && (parentLevelColInput === null || parentLevelColInput === void 0 ? void 0 : parentLevelColInput.value)) ? ({
|
|
9581
|
+
wellLevelCol: wellLevelColInput === null || wellLevelColInput === void 0 ? void 0 : wellLevelColInput.value,
|
|
9582
|
+
parentLevelCol: parentLevelColInput === null || parentLevelColInput === void 0 ? void 0 : parentLevelColInput.value,
|
|
9583
|
+
}) : null,
|
|
9584
|
+
getHistory: () => {
|
|
9585
|
+
var _a, _b, _c, _d;
|
|
9586
|
+
return ((wellLevelColInput === null || wellLevelColInput === void 0 ? void 0 : wellLevelColInput.value) && (parentLevelColInput === null || parentLevelColInput === void 0 ? void 0 : parentLevelColInput.value)) ? ({
|
|
9587
|
+
wellLevelCol: (_b = (_a = wellLevelColInput === null || wellLevelColInput === void 0 ? void 0 : wellLevelColInput.value) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
|
|
9588
|
+
parentLevelCol: (_d = (_c = parentLevelColInput === null || parentLevelColInput === void 0 ? void 0 : parentLevelColInput.value) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : null,
|
|
9589
|
+
}) : null;
|
|
9590
|
+
},
|
|
9591
|
+
applyHistory: (history) => {
|
|
9592
|
+
if (!history.wellLevelCol || !history.parentLevelCol || !wellDataTable || !parentDataTable)
|
|
9593
|
+
return;
|
|
9594
|
+
if (wellLevelColInput && parentLevelColInput) {
|
|
9595
|
+
wellLevelColInput.value = wellDataTable.col(history.wellLevelCol);
|
|
9596
|
+
parentLevelColInput.value = parentDataTable.col(history.parentLevelCol);
|
|
9597
|
+
}
|
|
9598
|
+
},
|
|
9599
|
+
onTableChange: (wellLevelData, parentLevelData) => onTableChange(wellLevelData, parentLevelData),
|
|
9600
|
+
};
|
|
9601
|
+
}
|
|
9539
9602
|
function dataToCurvesUI() {
|
|
9540
9603
|
const tv = datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.shell.tv;
|
|
9541
9604
|
if (!tv || !tv.dataFrame) {
|
|
9542
9605
|
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.shell.warning('No open tableview');
|
|
9543
9606
|
return;
|
|
9544
9607
|
}
|
|
9545
|
-
|
|
9546
|
-
|
|
9608
|
+
let wellLevelForm = null;
|
|
9609
|
+
let parentTableForm = null;
|
|
9610
|
+
const joinEditor = createJoinEditor();
|
|
9611
|
+
wellLevelForm = createWellTableForm(() => { var _a, _b, _c; return joinEditor.onTableChange((_b = (_a = wellLevelForm === null || wellLevelForm === void 0 ? void 0 : wellLevelForm.getValues()) === null || _a === void 0 ? void 0 : _a.table) !== null && _b !== void 0 ? _b : null, (_c = parentTableForm === null || parentTableForm === void 0 ? void 0 : parentTableForm.getTable()) !== null && _c !== void 0 ? _c : null); });
|
|
9612
|
+
parentTableForm = createParentTableForm(() => { var _a, _b, _c; return joinEditor.onTableChange((_b = (_a = wellLevelForm === null || wellLevelForm === void 0 ? void 0 : wellLevelForm.getValues()) === null || _a === void 0 ? void 0 : _a.table) !== null && _b !== void 0 ? _b : null, (_c = parentTableForm === null || parentTableForm === void 0 ? void 0 : parentTableForm.getTable()) !== null && _c !== void 0 ? _c : null); });
|
|
9547
9613
|
const horzForm = datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.divH([wellLevelForm.form, parentTableForm.form], { style: { minWidth: '400px', gap: '20px' } });
|
|
9548
9614
|
datagrok_api_ui__WEBPACK_IMPORTED_MODULE_3__.dialog('Data to Curves')
|
|
9549
9615
|
.add(horzForm)
|
|
9616
|
+
.add(joinEditor.form)
|
|
9550
9617
|
.onOK(() => __awaiter(this, void 0, void 0, function* () {
|
|
9551
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k;
|
|
9618
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m;
|
|
9552
9619
|
const formRes = wellLevelForm.getValues();
|
|
9553
9620
|
let parentLevelData = undefined;
|
|
9554
9621
|
const parentTable = parentTableForm.getTable();
|
|
@@ -9566,6 +9633,7 @@ function dataToCurvesUI() {
|
|
|
9566
9633
|
additionalColumns: (_a = parentFormValues.additionalColumns) !== null && _a !== void 0 ? _a : [],
|
|
9567
9634
|
};
|
|
9568
9635
|
}
|
|
9636
|
+
const joinValues = joinEditor.getValues();
|
|
9569
9637
|
const { table, assayCol, batchIDCol, concentrationCol, readoutCol, compoundIDCol, excludeOutliersCol, runIDCol, targetEntityCol } = formRes;
|
|
9570
9638
|
const func = datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Func.find({ name: 'dataToCurves' })[0];
|
|
9571
9639
|
if (!func) {
|
|
@@ -9592,6 +9660,9 @@ function dataToCurvesUI() {
|
|
|
9592
9660
|
experimentIDColumn: (_g = parentLevelData === null || parentLevelData === void 0 ? void 0 : parentLevelData.experimentIDColumn) === null || _g === void 0 ? void 0 : _g.name,
|
|
9593
9661
|
qualifierColumn: (_h = parentLevelData === null || parentLevelData === void 0 ? void 0 : parentLevelData.qualifierColumn) === null || _h === void 0 ? void 0 : _h.name,
|
|
9594
9662
|
additionalColumns: (_k = (_j = parentLevelData === null || parentLevelData === void 0 ? void 0 : parentLevelData.additionalColumns) === null || _j === void 0 ? void 0 : _j.map((c) => c.name)) !== null && _k !== void 0 ? _k : [],
|
|
9663
|
+
// joinInfo
|
|
9664
|
+
wellLevelJoinCol: (_l = joinValues === null || joinValues === void 0 ? void 0 : joinValues.wellLevelCol) === null || _l === void 0 ? void 0 : _l.name,
|
|
9665
|
+
parentLevelJoinCol: (_m = joinValues === null || joinValues === void 0 ? void 0 : joinValues.parentLevelCol) === null || _m === void 0 ? void 0 : _m.name,
|
|
9595
9666
|
});
|
|
9596
9667
|
console.log(fc.toString());
|
|
9597
9668
|
const needsCreationScript = table.tags[datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Tags.CreationScript] && (!(parentLevelData === null || parentLevelData === void 0 ? void 0 : parentLevelData.table) || parentLevelData.table.tags[datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Tags.CreationScript]);
|
|
@@ -9619,7 +9690,7 @@ function dataToCurvesUI() {
|
|
|
9619
9690
|
}))
|
|
9620
9691
|
.show()
|
|
9621
9692
|
.history(() => {
|
|
9622
|
-
var _a, _b;
|
|
9693
|
+
var _a, _b, _c;
|
|
9623
9694
|
const formRes = wellLevelForm.getValues();
|
|
9624
9695
|
const { assayCol, batchIDCol, concentrationCol, readoutCol, compoundIDCol, excludeOutliersCol, runIDCol, targetEntityCol } = formRes;
|
|
9625
9696
|
const obj = {
|
|
@@ -9632,18 +9703,20 @@ function dataToCurvesUI() {
|
|
|
9632
9703
|
runIDCol: runIDCol === null || runIDCol === void 0 ? void 0 : runIDCol.name,
|
|
9633
9704
|
targetEntityCol: targetEntityCol === null || targetEntityCol === void 0 ? void 0 : targetEntityCol.name,
|
|
9634
9705
|
};
|
|
9635
|
-
return { wells: JSON.stringify((_a = Object.fromEntries(Object.entries(obj).filter(([_, v]) => !!v))) !== null && _a !== void 0 ? _a : {}), parent: JSON.stringify((_b = parentTableForm.getHistory()) !== null && _b !== void 0 ? _b : {}) };
|
|
9706
|
+
return { wells: JSON.stringify((_a = Object.fromEntries(Object.entries(obj).filter(([_, v]) => !!v))) !== null && _a !== void 0 ? _a : {}), parent: JSON.stringify((_b = parentTableForm.getHistory()) !== null && _b !== void 0 ? _b : {}), join: JSON.stringify((_c = joinEditor.getHistory()) !== null && _c !== void 0 ? _c : {}) };
|
|
9636
9707
|
}, (v) => {
|
|
9637
|
-
var _a, _b;
|
|
9708
|
+
var _a, _b, _c;
|
|
9638
9709
|
const wells = JSON.parse((_a = v === null || v === void 0 ? void 0 : v.wells) !== null && _a !== void 0 ? _a : '{}');
|
|
9639
9710
|
const parent = JSON.parse((_b = v === null || v === void 0 ? void 0 : v.parent) !== null && _b !== void 0 ? _b : '{}');
|
|
9640
9711
|
wellLevelForm.applyHistory(wells);
|
|
9641
9712
|
parentTableForm.applyHistory(parent);
|
|
9713
|
+
const joinHistory = JSON.parse((_c = v === null || v === void 0 ? void 0 : v.join) !== null && _c !== void 0 ? _c : '{}');
|
|
9714
|
+
joinEditor.applyHistory(joinHistory);
|
|
9642
9715
|
});
|
|
9643
9716
|
}
|
|
9644
|
-
function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentData) {
|
|
9717
|
+
function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentData, joinInfo) {
|
|
9645
9718
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9646
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
9719
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
9647
9720
|
if (!concentrationCol || !readoutCol || !batchIDCol) {
|
|
9648
9721
|
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.shell.warning('Please fill all required fields');
|
|
9649
9722
|
throw new Error('Please fill all required fields');
|
|
@@ -9684,21 +9757,26 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9684
9757
|
return markerType;
|
|
9685
9758
|
}
|
|
9686
9759
|
};
|
|
9760
|
+
const hasJoinInfo = !!((joinInfo === null || joinInfo === void 0 ? void 0 : joinInfo.parentLevelCol) && (joinInfo === null || joinInfo === void 0 ? void 0 : joinInfo.wellLevelCol));
|
|
9761
|
+
const parentCompoundIDCol = (_a = parentData === null || parentData === void 0 ? void 0 : parentData.table) === null || _a === void 0 ? void 0 : _a.col(compoundIDCol.name);
|
|
9762
|
+
const parentAssayCol = (_b = parentData === null || parentData === void 0 ? void 0 : parentData.table) === null || _b === void 0 ? void 0 : _b.col(assayCol.name);
|
|
9763
|
+
const parentTargetEntityCol = (_c = parentData === null || parentData === void 0 ? void 0 : parentData.table) === null || _c === void 0 ? void 0 : _c.col(targetEntityCol.name);
|
|
9764
|
+
const parentRunIDCol = (_d = parentData === null || parentData === void 0 ? void 0 : parentData.table) === null || _d === void 0 ? void 0 : _d.col(runIDCol.name);
|
|
9765
|
+
const hasParentGrouppingCols = parentCompoundIDCol && parentAssayCol && parentTargetEntityCol && parentRunIDCol;
|
|
9687
9766
|
const getGroupKey = (row) => `${getCompoundID(row)}||${getAssay(row)}||${getTargetEntity(row)}`;
|
|
9688
|
-
const getCurveKey = (row) => `${getGroupKey(row)}||${getRunID(row)}
|
|
9689
|
-
const getParentDataCurveKey =
|
|
9690
|
-
|
|
9691
|
-
(_row) => null;
|
|
9767
|
+
const getCurveKey = !hasJoinInfo ? ((row) => `${getGroupKey(row)}||${getRunID(row)}`) : ((row) => `${joinInfo.wellLevelCol.get(row)}`);
|
|
9768
|
+
const getParentDataCurveKey = !hasJoinInfo ? (hasParentGrouppingCols ? ((row) => { var _a, _b, _c, _d; return `${(_a = parentData.table) === null || _a === void 0 ? void 0 : _a.col(compoundIDCol.name).get(row)}||${(_b = parentData.table) === null || _b === void 0 ? void 0 : _b.col(assayCol.name).get(row)}||${(_c = parentData.table) === null || _c === void 0 ? void 0 : _c.col(targetEntityCol.name).get(row)}||${(_d = parentData.table) === null || _d === void 0 ? void 0 : _d.col(runIDCol.name).get(row)}`; }) :
|
|
9769
|
+
((_row) => null)) : ((row) => `${joinInfo.parentLevelCol.get(row)}`);
|
|
9692
9770
|
// put the parent data into the parentObj
|
|
9693
9771
|
const parentObj = {};
|
|
9694
9772
|
if (parentData) {
|
|
9695
|
-
for (let i = 0; i < ((
|
|
9773
|
+
for (let i = 0; i < ((_g = (_f = parentData.table) === null || _f === void 0 ? void 0 : _f.rowCount) !== null && _g !== void 0 ? _g : 0); i++) {
|
|
9696
9774
|
const curveKey = getParentDataCurveKey ? getParentDataCurveKey(i) : null;
|
|
9697
9775
|
if (!curveKey || parentObj[curveKey])
|
|
9698
9776
|
continue;
|
|
9699
9777
|
parentObj[curveKey] = {
|
|
9700
|
-
fitParams: (
|
|
9701
|
-
fitFunction: (
|
|
9778
|
+
fitParams: (_j = (_h = parentData.fitParamColumns) === null || _h === void 0 ? void 0 : _h.map((c) => c.get(i))) !== null && _j !== void 0 ? _j : [],
|
|
9779
|
+
fitFunction: (_k = parentData.fitFunction) !== null && _k !== void 0 ? _k : _datagrok_libraries_statistics_src_fit_fit_curve__WEBPACK_IMPORTED_MODULE_0__.FIT_FUNCTION_4PL_DOSE_RESPONSE,
|
|
9702
9780
|
reportedIC50: parentData.reportedIC50Column ? parentData.reportedIC50Column.get(i) : undefined,
|
|
9703
9781
|
reportedQualifiedIC50: parentData.reportedQualifiedIC50Column ? parentData.reportedQualifiedIC50Column.get(i) : undefined,
|
|
9704
9782
|
experimentID: parentData.experimentIDColumn ? parentData.experimentIDColumn.get(i) : undefined,
|
|
@@ -9715,7 +9793,7 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9715
9793
|
const outlier = isOutlier(i);
|
|
9716
9794
|
const compoundID = getCompoundID(i);
|
|
9717
9795
|
const targetEntity = getTargetEntity(i);
|
|
9718
|
-
const runID = (
|
|
9796
|
+
const runID = (_l = getRunID(i)) !== null && _l !== void 0 ? _l : '';
|
|
9719
9797
|
const groupKey = getGroupKey(i);
|
|
9720
9798
|
const curveKey = getCurveKey(i);
|
|
9721
9799
|
if (!curvesObj[curveKey]) {
|
|
@@ -9734,7 +9812,7 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9734
9812
|
if (parentObj[curveKey].additionalColumns)
|
|
9735
9813
|
Object.assign(curvesObj[curveKey].info, parentObj[curveKey].additionalColumns);
|
|
9736
9814
|
if (parentObj[curveKey].fitParams && parentObj[curveKey].fitParams.length > 0) {
|
|
9737
|
-
for (let j = 0; j < ((
|
|
9815
|
+
for (let j = 0; j < ((_o = (_m = parentData.fitParamColumns) === null || _m === void 0 ? void 0 : _m.length) !== null && _o !== void 0 ? _o : 0); j++) {
|
|
9738
9816
|
const paramName = parentData.fitParamColumns[j].name;
|
|
9739
9817
|
curvesObj[curveKey].info[paramName] = parentObj[curveKey].fitParams[j];
|
|
9740
9818
|
}
|
|
@@ -9791,7 +9869,8 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9791
9869
|
curvesCol.setTag('cell.renderer', 'fit');
|
|
9792
9870
|
// add group column
|
|
9793
9871
|
tableColList.push(datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column.fromStrings(groupColumnName, curvesObjsArray.map((c) => c[1].groupKey)));
|
|
9794
|
-
const otherColumns = Object.keys(
|
|
9872
|
+
const otherColumns = curvesObjsArray.reduce((acc, c) => { Object.keys(c[1].info).forEach((k) => acc.add(k)); return acc; }, new Set());
|
|
9873
|
+
//Object.keys(curvesObjsArray[0][1].info);
|
|
9795
9874
|
for (const colName of otherColumns) {
|
|
9796
9875
|
const col = datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column.fromStrings(colName, curvesObjsArray.map((c) => { var _a, _b, _c; return (_c = (_b = (_a = c[1].info[colName]) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : ''; }));
|
|
9797
9876
|
tableColList.push(col);
|
|
@@ -9811,7 +9890,7 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9811
9890
|
grouppedValues[groupKey] = { maxYs: [], reportedIC50s: [], qualifiedIC50s: [] };
|
|
9812
9891
|
grouppedValues[groupKey].maxYs.push(Math.max(...curve.y.filter((_, i) => !curve.outliers[i])));
|
|
9813
9892
|
if (parentData && parentObj[curveKey]) {
|
|
9814
|
-
if ((
|
|
9893
|
+
if ((_p = parentObj[curveKey].reportedQualifiedIC50) !== null && _p !== void 0 ? _p : '' != '') {
|
|
9815
9894
|
grouppedValues[groupKey].qualifiedIC50s.push(parentObj[curveKey].reportedQualifiedIC50);
|
|
9816
9895
|
let ic50 = getNumericValue(parentData.reportedQualifiedIC50Column ? parentObj[curveKey].reportedQualifiedIC50 : parentObj[curveKey].reportedIC50);
|
|
9817
9896
|
if (ic50 == undefined) {
|
|
@@ -9829,11 +9908,11 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
|
|
|
9829
9908
|
const grouppedAggregations = {};
|
|
9830
9909
|
for (const groupKey in grouppedValues) {
|
|
9831
9910
|
const values = grouppedValues[groupKey];
|
|
9832
|
-
grouppedAggregations[groupKey] = Object.assign({ 'Max Percent Inhibition': values.maxYs.length ? (
|
|
9833
|
-
'Number of total results': (
|
|
9834
|
-
'Number of reported results': (
|
|
9835
|
-
'Geomean IC50': values.reportedIC50s.length ? (
|
|
9836
|
-
'Standard Deviation': values.reportedIC50s.length > 1 ? (
|
|
9911
|
+
grouppedAggregations[groupKey] = Object.assign({ 'Max Percent Inhibition': values.maxYs.length ? (_q = Math.max(...values.maxYs)) === null || _q === void 0 ? void 0 : _q.toString() : null }, (parentData && parentData.table ? {
|
|
9912
|
+
'Number of total results': (_r = values.qualifiedIC50s.length) === null || _r === void 0 ? void 0 : _r.toString(),
|
|
9913
|
+
'Number of reported results': (_s = values.reportedIC50s.length) === null || _s === void 0 ? void 0 : _s.toString(),
|
|
9914
|
+
'Geomean IC50': values.reportedIC50s.length ? (_t = (Math.exp(values.reportedIC50s.reduce((a, b) => a + Math.log(b), 0) / values.reportedIC50s.length) || null)) === null || _t === void 0 ? void 0 : _t.toString() : null, // log based, better for small values
|
|
9915
|
+
'Standard Deviation': values.reportedIC50s.length > 1 ? (_u = Math.sqrt(values.reportedIC50s.reduce((a, b) => a + Math.pow((b - values.reportedIC50s.reduce((c, d) => c + d, 0) / values.reportedIC50s.length), 2), 0) / (values.reportedIC50s.length - 1))) === null || _u === void 0 ? void 0 : _u.toString() : null,
|
|
9837
9916
|
'All Results': values.qualifiedIC50s.join(', ')
|
|
9838
9917
|
} : {}));
|
|
9839
9918
|
}
|
|
@@ -11875,12 +11954,12 @@ var queries;
|
|
|
11875
11954
|
})(queries || (queries = {}));
|
|
11876
11955
|
var funcs;
|
|
11877
11956
|
(function (funcs) {
|
|
11878
|
-
function
|
|
11957
|
+
function platesAppTreeBrowserTempDisabled(treeNode, browseView) {
|
|
11879
11958
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11880
|
-
return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:
|
|
11959
|
+
return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:PlatesAppTreeBrowserTempDisabled', { treeNode, browseView });
|
|
11881
11960
|
});
|
|
11882
11961
|
}
|
|
11883
|
-
funcs.
|
|
11962
|
+
funcs.platesAppTreeBrowserTempDisabled = platesAppTreeBrowserTempDisabled;
|
|
11884
11963
|
function fitChartCellRenderer() {
|
|
11885
11964
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11886
11965
|
return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:FitChartCellRenderer', {});
|
|
@@ -12047,7 +12126,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12047
12126
|
/* harmony export */ getPlateByBarcode: () => (/* binding */ getPlateByBarcode),
|
|
12048
12127
|
/* harmony export */ importPlate: () => (/* binding */ importPlate),
|
|
12049
12128
|
/* harmony export */ importPlateXlsx: () => (/* binding */ importPlateXlsx),
|
|
12050
|
-
/* harmony export */ platesApp: () => (/* binding */ platesApp),
|
|
12051
12129
|
/* harmony export */ platesFolderPreview: () => (/* binding */ platesFolderPreview),
|
|
12052
12130
|
/* harmony export */ previewPlate: () => (/* binding */ previewPlate),
|
|
12053
12131
|
/* harmony export */ previewPlateXlsx: () => (/* binding */ previewPlateXlsx)
|
|
@@ -12127,10 +12205,12 @@ function _initCurves() {
|
|
|
12127
12205
|
//input: string experimentIDColumn { nullable: true }
|
|
12128
12206
|
//input: string qualifierColumn { nullable: true }
|
|
12129
12207
|
//input: list<string> additionalColumns { nullable: true }
|
|
12208
|
+
//input: string wellLevelJoinCol { nullable: true }
|
|
12209
|
+
//input: string parentLevelJoinCol { nullable: true }
|
|
12130
12210
|
//output: dataframe result
|
|
12131
|
-
function dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns) {
|
|
12211
|
+
function dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns, wellLevelJoinCol, parentLevelJoinCol) {
|
|
12132
12212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12133
|
-
return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns);
|
|
12213
|
+
return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns, wellLevelJoinCol, parentLevelJoinCol);
|
|
12134
12214
|
});
|
|
12135
12215
|
}
|
|
12136
12216
|
//name: dataToCurvesTopMenu
|
|
@@ -12228,13 +12308,6 @@ function checkExcelIsPlate(content) {
|
|
|
12228
12308
|
function checkFileIsPlate(content) {
|
|
12229
12309
|
return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.checkFileIsPlate(content);
|
|
12230
12310
|
}
|
|
12231
|
-
//name: Browse
|
|
12232
|
-
//tags: app
|
|
12233
|
-
//output: view result
|
|
12234
|
-
//meta.browsePath: Plates
|
|
12235
|
-
function platesApp() {
|
|
12236
|
-
return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.platesApp();
|
|
12237
|
-
}
|
|
12238
12311
|
//name: getPlateByBarcode
|
|
12239
12312
|
//input: string barcode
|
|
12240
12313
|
//output: dynamic result
|
|
@@ -12296,8 +12369,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12296
12369
|
/* harmony export */ getPlateByBarcode: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.getPlateByBarcode),
|
|
12297
12370
|
/* harmony export */ importPlate: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.importPlate),
|
|
12298
12371
|
/* harmony export */ importPlateXlsx: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.importPlateXlsx),
|
|
12299
|
-
/* harmony export */
|
|
12300
|
-
/* harmony export */ platesAppTreeBrowser: () => (/* binding */ platesAppTreeBrowser),
|
|
12372
|
+
/* harmony export */ platesAppTreeBrowserTempDisabled: () => (/* binding */ platesAppTreeBrowserTempDisabled),
|
|
12301
12373
|
/* harmony export */ platesFolderPreview: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.platesFolderPreview),
|
|
12302
12374
|
/* harmony export */ previewPlate: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.previewPlate),
|
|
12303
12375
|
/* harmony export */ previewPlateXlsx: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.previewPlateXlsx)
|
|
@@ -12404,10 +12476,14 @@ class PackageFunctions {
|
|
|
12404
12476
|
datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.ObjectHandler.register(new _plate_plate_cell_renderer__WEBPACK_IMPORTED_MODULE_8__.PlateCellHandler());
|
|
12405
12477
|
datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.ObjectHandler.register(new _plates_objects_plate_template_handler__WEBPACK_IMPORTED_MODULE_17__.PlateTemplateHandler());
|
|
12406
12478
|
}
|
|
12407
|
-
static dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns) {
|
|
12479
|
+
static dataToCurves(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, parentTable, fitParamColumns, reportedIC50Column, reportedQualifiedIC50Column, experimentIDColumn, qualifierColumn, additionalColumns, wellLevelJoinCol, parentLevelJoinCol) {
|
|
12408
12480
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12409
12481
|
var _a, _b, _c, _d;
|
|
12410
12482
|
const pt = parentTable;
|
|
12483
|
+
const joinInfo = pt && wellLevelJoinCol && parentLevelJoinCol && df.col(wellLevelJoinCol) && pt.col(parentLevelJoinCol) ? {
|
|
12484
|
+
wellLevelCol: df.col(wellLevelJoinCol),
|
|
12485
|
+
parentLevelCol: pt.col(parentLevelJoinCol),
|
|
12486
|
+
} : undefined;
|
|
12411
12487
|
// this needs to work with datasync so we use wide format
|
|
12412
12488
|
return (0,_fit_data_to_curves__WEBPACK_IMPORTED_MODULE_19__.convertDataToCurves)(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, {
|
|
12413
12489
|
table: pt,
|
|
@@ -12417,7 +12493,7 @@ class PackageFunctions {
|
|
|
12417
12493
|
experimentIDColumn: experimentIDColumn ? (_c = pt === null || pt === void 0 ? void 0 : pt.col(experimentIDColumn)) !== null && _c !== void 0 ? _c : undefined : undefined,
|
|
12418
12494
|
qualifierColumn: qualifierColumn ? (_d = pt === null || pt === void 0 ? void 0 : pt.col(qualifierColumn)) !== null && _d !== void 0 ? _d : undefined : undefined,
|
|
12419
12495
|
additionalColumns: (additionalColumns !== null && additionalColumns !== void 0 ? additionalColumns : []).map((c) => pt === null || pt === void 0 ? void 0 : pt.col(c)).filter((c) => c != null),
|
|
12420
|
-
});
|
|
12496
|
+
}, joinInfo);
|
|
12421
12497
|
});
|
|
12422
12498
|
}
|
|
12423
12499
|
static dataToCurvesTopMenu() {
|
|
@@ -12563,6 +12639,7 @@ class PackageFunctions {
|
|
|
12563
12639
|
return false;
|
|
12564
12640
|
return _plate_plate_reader__WEBPACK_IMPORTED_MODULE_11__.PlateReader.getReader(content) != null;
|
|
12565
12641
|
}
|
|
12642
|
+
// @grok.decorators.app({name: 'Browse', browsePath: 'Plates'})
|
|
12566
12643
|
static platesApp() {
|
|
12567
12644
|
return (0,_plates_plates_app__WEBPACK_IMPORTED_MODULE_12__.platesAppView)();
|
|
12568
12645
|
}
|
|
@@ -12616,8 +12693,10 @@ __decorate([
|
|
|
12616
12693
|
__param(13, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
12617
12694
|
__param(14, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
12618
12695
|
__param(15, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
12696
|
+
__param(16, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
12697
|
+
__param(17, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
|
|
12619
12698
|
__metadata("design:type", Function),
|
|
12620
|
-
__metadata("design:paramtypes", [datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, Array, String, String, String, String, Array]),
|
|
12699
|
+
__metadata("design:paramtypes", [datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.Column, datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.DataFrame, Array, String, String, String, String, Array, String, String]),
|
|
12621
12700
|
__metadata("design:returntype", Promise)
|
|
12622
12701
|
], PackageFunctions, "dataToCurves", null);
|
|
12623
12702
|
__decorate([
|
|
@@ -12681,12 +12760,6 @@ __decorate([
|
|
|
12681
12760
|
__metadata("design:paramtypes", [String]),
|
|
12682
12761
|
__metadata("design:returntype", Boolean)
|
|
12683
12762
|
], PackageFunctions, "checkFileIsPlate", null);
|
|
12684
|
-
__decorate([
|
|
12685
|
-
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.app({ name: 'Browse', browsePath: 'Plates' }),
|
|
12686
|
-
__metadata("design:type", Function),
|
|
12687
|
-
__metadata("design:paramtypes", []),
|
|
12688
|
-
__metadata("design:returntype", datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.View)
|
|
12689
|
-
], PackageFunctions, "platesApp", null);
|
|
12690
12763
|
__decorate([
|
|
12691
12764
|
datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({}),
|
|
12692
12765
|
__metadata("design:type", Function),
|
|
@@ -12699,10 +12772,10 @@ __decorate([
|
|
|
12699
12772
|
__metadata("design:paramtypes", []),
|
|
12700
12773
|
__metadata("design:returntype", Promise)
|
|
12701
12774
|
], PackageFunctions, "createDummyPlateData", null);
|
|
12702
|
-
//name:
|
|
12775
|
+
//name: platesAppTreeBrowserTempDisabled
|
|
12703
12776
|
//input: dynamic treeNode
|
|
12704
12777
|
//input: view browseView
|
|
12705
|
-
function
|
|
12778
|
+
function platesAppTreeBrowserTempDisabled(treeNode, browseView) {
|
|
12706
12779
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12707
12780
|
yield (0,_plates_plates_app__WEBPACK_IMPORTED_MODULE_12__.initPlatesAppTree)(treeNode);
|
|
12708
12781
|
});
|