@datagrok/curves 1.10.1 → 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.
@@ -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
- const wellLevelForm = createWellTableForm();
9546
- const parentTableForm = createParentTableForm();
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 = parentData && ((_a = parentData.table) === null || _a === void 0 ? void 0 : _a.col(compoundIDCol.name)) && parentData.table.col(assayCol.name) && parentData.table.col(targetEntityCol.name) &&
9690
- parentData.table.col(runIDCol.name) ? (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)}`; } :
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 < ((_c = (_b = parentData.table) === null || _b === void 0 ? void 0 : _b.rowCount) !== null && _c !== void 0 ? _c : 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: (_f = (_d = parentData.fitParamColumns) === null || _d === void 0 ? void 0 : _d.map((c) => c.get(i))) !== null && _f !== void 0 ? _f : [],
9701
- fitFunction: (_g = parentData.fitFunction) !== null && _g !== void 0 ? _g : _datagrok_libraries_statistics_src_fit_fit_curve__WEBPACK_IMPORTED_MODULE_0__.FIT_FUNCTION_4PL_DOSE_RESPONSE,
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 = (_h = getRunID(i)) !== null && _h !== void 0 ? _h : '';
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 < ((_k = (_j = parentData.fitParamColumns) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 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
  }
@@ -9812,7 +9890,7 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
9812
9890
  grouppedValues[groupKey] = { maxYs: [], reportedIC50s: [], qualifiedIC50s: [] };
9813
9891
  grouppedValues[groupKey].maxYs.push(Math.max(...curve.y.filter((_, i) => !curve.outliers[i])));
9814
9892
  if (parentData && parentObj[curveKey]) {
9815
- if ((_l = parentObj[curveKey].reportedQualifiedIC50) !== null && _l !== void 0 ? _l : '' != '') {
9893
+ if ((_p = parentObj[curveKey].reportedQualifiedIC50) !== null && _p !== void 0 ? _p : '' != '') {
9816
9894
  grouppedValues[groupKey].qualifiedIC50s.push(parentObj[curveKey].reportedQualifiedIC50);
9817
9895
  let ic50 = getNumericValue(parentData.reportedQualifiedIC50Column ? parentObj[curveKey].reportedQualifiedIC50 : parentObj[curveKey].reportedIC50);
9818
9896
  if (ic50 == undefined) {
@@ -9830,11 +9908,11 @@ function convertDataToCurves(df, concentrationCol, readoutCol, batchIDCol, assay
9830
9908
  const grouppedAggregations = {};
9831
9909
  for (const groupKey in grouppedValues) {
9832
9910
  const values = grouppedValues[groupKey];
9833
- grouppedAggregations[groupKey] = Object.assign({ 'Max Percent Inhibition': values.maxYs.length ? (_m = Math.max(...values.maxYs)) === null || _m === void 0 ? void 0 : _m.toString() : null }, (parentData && parentData.table ? {
9834
- 'Number of total results': (_o = values.qualifiedIC50s.length) === null || _o === void 0 ? void 0 : _o.toString(),
9835
- 'Number of reported results': (_p = values.reportedIC50s.length) === null || _p === void 0 ? void 0 : _p.toString(),
9836
- 'Geomean IC50': values.reportedIC50s.length ? (_q = (Math.exp(values.reportedIC50s.reduce((a, b) => a + Math.log(b), 0) / values.reportedIC50s.length) || null)) === null || _q === void 0 ? void 0 : _q.toString() : null, // log based, better for small values
9837
- 'Standard Deviation': values.reportedIC50s.length > 1 ? (_r = 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 || _r === void 0 ? void 0 : _r.toString() : null,
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,
9838
9916
  'All Results': values.qualifiedIC50s.join(', ')
9839
9917
  } : {}));
9840
9918
  }
@@ -11876,12 +11954,12 @@ var queries;
11876
11954
  })(queries || (queries = {}));
11877
11955
  var funcs;
11878
11956
  (function (funcs) {
11879
- function platesAppTreeBrowser(treeNode, browseView) {
11957
+ function platesAppTreeBrowserTempDisabled(treeNode, browseView) {
11880
11958
  return __awaiter(this, void 0, void 0, function* () {
11881
- return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:PlatesAppTreeBrowser', { treeNode, browseView });
11959
+ return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:PlatesAppTreeBrowserTempDisabled', { treeNode, browseView });
11882
11960
  });
11883
11961
  }
11884
- funcs.platesAppTreeBrowser = platesAppTreeBrowser;
11962
+ funcs.platesAppTreeBrowserTempDisabled = platesAppTreeBrowserTempDisabled;
11885
11963
  function fitChartCellRenderer() {
11886
11964
  return __awaiter(this, void 0, void 0, function* () {
11887
11965
  return yield datagrok_api_grok__WEBPACK_IMPORTED_MODULE_0__.functions.call('Curves:FitChartCellRenderer', {});
@@ -12048,7 +12126,6 @@ __webpack_require__.r(__webpack_exports__);
12048
12126
  /* harmony export */ getPlateByBarcode: () => (/* binding */ getPlateByBarcode),
12049
12127
  /* harmony export */ importPlate: () => (/* binding */ importPlate),
12050
12128
  /* harmony export */ importPlateXlsx: () => (/* binding */ importPlateXlsx),
12051
- /* harmony export */ platesApp: () => (/* binding */ platesApp),
12052
12129
  /* harmony export */ platesFolderPreview: () => (/* binding */ platesFolderPreview),
12053
12130
  /* harmony export */ previewPlate: () => (/* binding */ previewPlate),
12054
12131
  /* harmony export */ previewPlateXlsx: () => (/* binding */ previewPlateXlsx)
@@ -12128,10 +12205,12 @@ function _initCurves() {
12128
12205
  //input: string experimentIDColumn { nullable: true }
12129
12206
  //input: string qualifierColumn { nullable: true }
12130
12207
  //input: list<string> additionalColumns { nullable: true }
12208
+ //input: string wellLevelJoinCol { nullable: true }
12209
+ //input: string parentLevelJoinCol { nullable: true }
12131
12210
  //output: dataframe result
12132
- 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) {
12133
12212
  return __awaiter(this, void 0, void 0, function* () {
12134
- 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);
12135
12214
  });
12136
12215
  }
12137
12216
  //name: dataToCurvesTopMenu
@@ -12229,13 +12308,6 @@ function checkExcelIsPlate(content) {
12229
12308
  function checkFileIsPlate(content) {
12230
12309
  return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.checkFileIsPlate(content);
12231
12310
  }
12232
- //name: Browse
12233
- //tags: app
12234
- //output: view result
12235
- //meta.browsePath: Plates
12236
- function platesApp() {
12237
- return _package__WEBPACK_IMPORTED_MODULE_2__.PackageFunctions.platesApp();
12238
- }
12239
12311
  //name: getPlateByBarcode
12240
12312
  //input: string barcode
12241
12313
  //output: dynamic result
@@ -12297,8 +12369,7 @@ __webpack_require__.r(__webpack_exports__);
12297
12369
  /* harmony export */ getPlateByBarcode: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.getPlateByBarcode),
12298
12370
  /* harmony export */ importPlate: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.importPlate),
12299
12371
  /* harmony export */ importPlateXlsx: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.importPlateXlsx),
12300
- /* harmony export */ platesApp: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.platesApp),
12301
- /* harmony export */ platesAppTreeBrowser: () => (/* binding */ platesAppTreeBrowser),
12372
+ /* harmony export */ platesAppTreeBrowserTempDisabled: () => (/* binding */ platesAppTreeBrowserTempDisabled),
12302
12373
  /* harmony export */ platesFolderPreview: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.platesFolderPreview),
12303
12374
  /* harmony export */ previewPlate: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.previewPlate),
12304
12375
  /* harmony export */ previewPlateXlsx: () => (/* reexport safe */ _package_g__WEBPACK_IMPORTED_MODULE_0__.previewPlateXlsx)
@@ -12405,10 +12476,14 @@ class PackageFunctions {
12405
12476
  datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.ObjectHandler.register(new _plate_plate_cell_renderer__WEBPACK_IMPORTED_MODULE_8__.PlateCellHandler());
12406
12477
  datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.ObjectHandler.register(new _plates_objects_plate_template_handler__WEBPACK_IMPORTED_MODULE_17__.PlateTemplateHandler());
12407
12478
  }
12408
- 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) {
12409
12480
  return __awaiter(this, void 0, void 0, function* () {
12410
12481
  var _a, _b, _c, _d;
12411
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;
12412
12487
  // this needs to work with datasync so we use wide format
12413
12488
  return (0,_fit_data_to_curves__WEBPACK_IMPORTED_MODULE_19__.convertDataToCurves)(df, concentrationCol, readoutCol, batchIDCol, assayCol, runIDCol, compoundIDCol, targetEntityCol, excludeOutliersCol, {
12414
12489
  table: pt,
@@ -12418,7 +12493,7 @@ class PackageFunctions {
12418
12493
  experimentIDColumn: experimentIDColumn ? (_c = pt === null || pt === void 0 ? void 0 : pt.col(experimentIDColumn)) !== null && _c !== void 0 ? _c : undefined : undefined,
12419
12494
  qualifierColumn: qualifierColumn ? (_d = pt === null || pt === void 0 ? void 0 : pt.col(qualifierColumn)) !== null && _d !== void 0 ? _d : undefined : undefined,
12420
12495
  additionalColumns: (additionalColumns !== null && additionalColumns !== void 0 ? additionalColumns : []).map((c) => pt === null || pt === void 0 ? void 0 : pt.col(c)).filter((c) => c != null),
12421
- });
12496
+ }, joinInfo);
12422
12497
  });
12423
12498
  }
12424
12499
  static dataToCurvesTopMenu() {
@@ -12564,6 +12639,7 @@ class PackageFunctions {
12564
12639
  return false;
12565
12640
  return _plate_plate_reader__WEBPACK_IMPORTED_MODULE_11__.PlateReader.getReader(content) != null;
12566
12641
  }
12642
+ // @grok.decorators.app({name: 'Browse', browsePath: 'Plates'})
12567
12643
  static platesApp() {
12568
12644
  return (0,_plates_plates_app__WEBPACK_IMPORTED_MODULE_12__.platesAppView)();
12569
12645
  }
@@ -12617,8 +12693,10 @@ __decorate([
12617
12693
  __param(13, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
12618
12694
  __param(14, datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.param({ options: { nullable: true } })),
12619
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 } })),
12620
12698
  __metadata("design:type", Function),
12621
- __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]),
12622
12700
  __metadata("design:returntype", Promise)
12623
12701
  ], PackageFunctions, "dataToCurves", null);
12624
12702
  __decorate([
@@ -12682,12 +12760,6 @@ __decorate([
12682
12760
  __metadata("design:paramtypes", [String]),
12683
12761
  __metadata("design:returntype", Boolean)
12684
12762
  ], PackageFunctions, "checkFileIsPlate", null);
12685
- __decorate([
12686
- datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.app({ name: 'Browse', browsePath: 'Plates' }),
12687
- __metadata("design:type", Function),
12688
- __metadata("design:paramtypes", []),
12689
- __metadata("design:returntype", datagrok_api_dg__WEBPACK_IMPORTED_MODULE_1__.View)
12690
- ], PackageFunctions, "platesApp", null);
12691
12763
  __decorate([
12692
12764
  datagrok_api_grok__WEBPACK_IMPORTED_MODULE_2__.decorators.func({}),
12693
12765
  __metadata("design:type", Function),
@@ -12700,10 +12772,10 @@ __decorate([
12700
12772
  __metadata("design:paramtypes", []),
12701
12773
  __metadata("design:returntype", Promise)
12702
12774
  ], PackageFunctions, "createDummyPlateData", null);
12703
- //name: platesAppTreeBrowser
12775
+ //name: platesAppTreeBrowserTempDisabled
12704
12776
  //input: dynamic treeNode
12705
12777
  //input: view browseView
12706
- function platesAppTreeBrowser(treeNode, browseView) {
12778
+ function platesAppTreeBrowserTempDisabled(treeNode, browseView) {
12707
12779
  return __awaiter(this, void 0, void 0, function* () {
12708
12780
  yield (0,_plates_plates_app__WEBPACK_IMPORTED_MODULE_12__.initPlatesAppTree)(treeNode);
12709
12781
  });