@datagrok/bio 2.6.0 → 2.6.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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "Leonid Stolbov",
6
6
  "email": "lstolbov@datagrok.ai"
7
7
  },
8
- "version": "2.6.0",
8
+ "version": "2.6.1",
9
9
  "description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.",
10
10
  "repository": {
11
11
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "@biowasm/aioli": "^3.1.0",
25
- "@datagrok-libraries/bio": "^5.33.0",
25
+ "@datagrok-libraries/bio": "^5.33.2",
26
26
  "@datagrok-libraries/chem-meta": "^1.0.1",
27
27
  "@datagrok-libraries/ml": "^6.3.39",
28
28
  "@datagrok-libraries/tutorials": "^1.3.2",
@@ -88,11 +88,16 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
88
88
  if (left !== null && left < seqMonList.length) {
89
89
  const monomerSymbol: string = seqMonList[left];
90
90
  const tooltipElements: HTMLElement[] = [ui.div(monomerSymbol)];
91
- const monomer = seqColTemp.getMonomer(monomerSymbol);
92
- if (monomer) {
93
- const options = {autoCrop: true, autoCropMargin: 0, suppressChiralText: true};
94
- const monomerSVG = grok.chem.svgMol(monomer.smiles, undefined, undefined, options);
95
- tooltipElements.push(monomerSVG);
91
+ if (seqColTemp._monomerStructureMap[monomerSymbol]) {
92
+ tooltipElements.push(seqColTemp._monomerStructureMap[monomerSymbol]);
93
+ } else {
94
+ const monomer = seqColTemp.getMonomer(monomerSymbol);
95
+ if (monomer) {
96
+ const options = {autoCrop: true, autoCropMargin: 0, suppressChiralText: true};
97
+ const monomerSVG = grok.chem.svgMol(monomer.smiles, undefined, undefined, options);
98
+ tooltipElements.push(monomerSVG);
99
+ seqColTemp._monomerStructureMap[monomerSymbol] = monomerSVG;
100
+ }
96
101
  }
97
102
  ui.tooltip.show(ui.divV(tooltipElements), e.x + 16, e.y + 16);
98
103
  } else {
@@ -122,7 +127,7 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
122
127
 
123
128
  // TODO: Store temp data to GridColumn
124
129
  // Now the renderer requires data frame table Column underlying GridColumn
125
- const view = gridCell.grid.view;
130
+ const grid = gridCell.grid;
126
131
  const tableCol: DG.Column = gridCell.cell.column;
127
132
  const tableColTemp: TempType = tableCol.temp;
128
133
 
@@ -135,7 +140,7 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
135
140
 
136
141
  let seqColTemp: MonomerPlacer = tableCol.temp[tempTAGS.bioSeqCol];
137
142
  if (!seqColTemp) {
138
- seqColTemp = new MonomerPlacer(view, tableCol,
143
+ seqColTemp = new MonomerPlacer(grid, tableCol,
139
144
  () => {
140
145
  const uh = UnitsHandler.getOrCreate(tableCol);
141
146
  return {
@@ -236,7 +241,7 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
236
241
  /*x1 = */
237
242
  printLeftOrCentered(x + this.padding, y, w, h,
238
243
  g, amino, color, 0, true, 1.0, separator, last, drawStyle,
239
- maxLengthWordsSum, index, gridCell, referenceSequence, maxLengthOfMonomer);
244
+ maxLengthWordsSum, index, gridCell, referenceSequence, maxLengthOfMonomer, seqColTemp._monomerLengthMap);
240
245
  if (minDistanceRenderer > w) break;
241
246
  }
242
247
  } catch (err: any) {