@datagrok/bio 2.27.0 → 2.27.1

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.
@@ -181,12 +181,14 @@ export function createDifferencesWithPositions(
181
181
  }
182
182
 
183
183
  export function createLinesGrid(df: DG.DataFrame, colNames: string[]): DG.Grid {
184
- const seqDiffCol = DG.Column.string('seq_diff', df.rowCount)
185
- .init((i) => `${df.get(colNames[0], i)}#${df.get(colNames[1], i)}`);
186
- seqDiffCol.semType = 'MacromoleculeDifference';
187
- seqDiffCol.meta.units = df.col(colNames[0])!.meta.units;
188
- seqDiffCol.setTag(bioTAGS.separator, df.col(colNames[0])!.getTag(bioTAGS.separator));
189
- df.columns.add(seqDiffCol);
184
+ if (!df.col('seq_diff')) {
185
+ const seqDiffCol = DG.Column.string('seq_diff', df.rowCount)
186
+ .init((i) => `${df.get(colNames[0], i)}#${df.get(colNames[1], i)}`);
187
+ seqDiffCol.semType = 'MacromoleculeDifference';
188
+ seqDiffCol.meta.units = df.col(colNames[0])!.meta.units;
189
+ seqDiffCol.setTag(bioTAGS.separator, df.col(colNames[0])!.getTag(bioTAGS.separator));
190
+ df.columns.add(seqDiffCol);
191
+ }
190
192
  const grid = df.plot.grid();
191
193
  grid.col(colNames[0])!.visible = false;
192
194
  grid.col(colNames[1])!.visible = false;
@@ -15,8 +15,8 @@ export namespace scripts {
15
15
  /**
16
16
  Converts molecules to HELM notation based on monomer library
17
17
  */
18
- export async function molToHelmConverterPy(moleculesDataframe: DG.DataFrame , moleculesColumn: DG.Column , libraryJSON: string ): Promise<DG.DataFrame> {
19
- return await grok.functions.call('Bio:MolToHelmConverterPy', { moleculesDataframe, moleculesColumn, libraryJSON });
18
+ export async function molToHelmConverterPy(moleculesDataframe: DG.DataFrame , moleculesColumn: DG.Column , libraryFile: DG.FileInfo ): Promise<DG.DataFrame> {
19
+ return await grok.functions.call('Bio:MolToHelmConverterPy', { moleculesDataframe, moleculesColumn, libraryFile });
20
20
  }
21
21
 
22
22
  /**
package/src/package.ts CHANGED
@@ -810,7 +810,8 @@ export class PackageFunctions {
810
810
  // collect current monomer library
811
811
  const monomerLib = _package.monomerLib;
812
812
  const libJSON = JSON.stringify(monomerLib.toJSON());
813
- await api.scripts.molToHelmConverterPy(table, molecules, libJSON);
813
+ const fileInfo = DG.FileInfo.fromString('monomerLib.json', libJSON);
814
+ await api.scripts.molToHelmConverterPy(table, molecules, fileInfo);
814
815
 
815
816
  // semtype is not automatically set, so we set it manually
816
817
  const newCol = table.columns.toList().find((c) => c.name.toLowerCase().includes('regenerated sequence') && c.semType !== DG.SEMTYPE.MACROMOLECULE);
@@ -63,7 +63,7 @@ export function showAnnotationManagerDialog(): void {
63
63
  setColumnAnnotations(selectedCol, updated);
64
64
  df.fireValuesChanged();
65
65
  refreshList();
66
- });
66
+ }, 'Delete');
67
67
  removeBtn.style.cursor = 'pointer';
68
68
  removeBtn.style.color = '#999';
69
69
  removeBtn.style.marginLeft = '8px';
@@ -198,7 +198,7 @@ class LibraryControlsManager {
198
198
  updateLibrarySelectionStatus(libInput.value, libFileName);
199
199
  }});
200
200
  ui.tooltip.bind(libInput.root, `Include monomers from ${libFileName}`);
201
- const deleteIcon = ui.iconFA('trash-alt', () => this.promptForLibraryDeletion(libFileName));
201
+ const deleteIcon = ui.iconFA('trash-alt', () => this.promptForLibraryDeletion(libFileName), 'Delete');
202
202
  const editIcon = ui.icons.edit(async () => {
203
203
  grok.shell.v = await (await MonomerManager.getInstance()).getViewRoot(libFileName);
204
204
  }, 'Edit monomer library');
@@ -486,7 +486,7 @@ export class MonomerManager implements IMonomerManager {
486
486
  }
487
487
  const monomer = await monomerFromDfRow(this.tv!.dataFrame.rows.get(currentRowIdx));
488
488
  await this._newMonomerForm.removeMonomers([monomer], this.libInput.value!);
489
- });
489
+ }, 'Delete');
490
490
 
491
491
  ui.tooltip.bind(deleteButton, () =>
492
492
  `${(this.tv?.dataFrame?.selection?.trueCount ?? 0) > 0 ? 'Delete selected monomers' : 'Delete monomer'}`);
@@ -93,7 +93,7 @@ export async function multipleSequenceAlignmentUI(
93
93
  });
94
94
  }, 'Adjust alignment parameters such as penalties for opening and extending gaps');
95
95
  kalignParamsButton.classList.add('msa-params-button');
96
- kalignParamsButton.prepend(ui.icons.settings(() => null));
96
+ kalignParamsButton.prepend(ui.icons.settings(() => null, 'Settings'));
97
97
 
98
98
  const kalignElements = [kalignParamsDiv, kalignParamsButton, kalignVersionDiv];
99
99
 
@@ -118,7 +118,7 @@ export async function multipleSequenceAlignmentUI(
118
118
  engineParamsDiv.hidden = !engineParamsDiv.hidden;
119
119
  }, 'Adjust engine-specific alignment parameters');
120
120
  engineParamsButton.classList.add('msa-params-button');
121
- engineParamsButton.prepend(ui.icons.settings(() => null));
121
+ engineParamsButton.prepend(ui.icons.settings(() => null, 'Settings'));
122
122
 
123
123
  // "Include HELM" checkbox: shown when column has a notation provider with fromHelm
124
124
  const includeHelmInput = ui.input.bool('Include HELM', {value: true});