@datagrok/bio 2.18.1 → 2.18.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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "Leonid Stolbov",
6
6
  "email": "lstolbov@datagrok.ai"
7
7
  },
8
- "version": "2.18.1",
8
+ "version": "2.18.2",
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",
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "dependencies": {
46
46
  "@biowasm/aioli": "^3.1.0",
47
- "@datagrok-libraries/bio": "^5.47.1",
47
+ "@datagrok-libraries/bio": "^5.48.1",
48
48
  "@datagrok-libraries/chem-meta": "^1.2.7",
49
49
  "@datagrok-libraries/math": "^1.2.4",
50
50
  "@datagrok-libraries/ml": "^6.7.6",
@@ -65,7 +65,7 @@ category('renderers', () => {
65
65
 
66
66
  test('scatterPlotTooltip', async () => {
67
67
  await _testScatterPlotTooltip();
68
- });
68
+ }, {skipReason: 'GROK-17450'});
69
69
 
70
70
  async function _rendererMacromoleculeFasta() {
71
71
  const csv: string = await grok.dapi.files.readAsText('System:AppData/Bio/samples/FASTA.csv');
@@ -15,8 +15,6 @@ const Tags = new class {
15
15
  tooltipHandlerTemp = 'tooltip-handler.Monomer';
16
16
  }();
17
17
 
18
- const svgMolOptions = {autoCrop: true, autoCropMargin: 0, suppressChiralText: true};
19
-
20
18
  export class MonomerCellRendererBack extends CellRendererWithMonomerLibBackBase {
21
19
  constructor(gridCol: DG.GridColumn | null, tableCol: DG.Column) {
22
20
  super(gridCol, tableCol);
@@ -25,6 +25,12 @@ const monomerRe = /[\w()]+/;
25
25
  //** Do not mess with monomer symbol with parenthesis enclosed in square brackets */
26
26
  const ambMonomerRe = RegExp(String.raw`\(${monomerRe}(,${monomerRe})+\)`);
27
27
 
28
+ const drawMoleculeCall = (s: string) => {
29
+ const canvas = ui.canvas(250, 250);
30
+ grok.chem.canvasMol(0, 0, 250, 250, canvas, s);
31
+ return canvas;
32
+ };
33
+
28
34
  export type MonomerLibDataType = { [polymerType: string]: { [monomerSymbol: string]: Monomer } };
29
35
 
30
36
  const whiteColorV = new Vector([255.0, 255.0, 255.0]);
@@ -189,10 +195,10 @@ export class MonomerLibBase implements IMonomerLibBase {
189
195
  const chemOptions = {autoCrop: true, autoCropMargin: 0, suppressChiralText: true};
190
196
  let structureEl: HTMLElement;
191
197
  if (monomer.molfile)
192
- structureEl = grok.chem.svgMol(monomer.molfile, undefined, undefined, chemOptions);
198
+ structureEl = drawMoleculeCall(monomer.molfile);
193
199
  else if (monomer.smiles) {
194
200
  structureEl = ui.divV([
195
- grok.chem.svgMol(monomer.smiles, undefined, undefined, chemOptions),
201
+ drawMoleculeCall(monomer.smiles),
196
202
  ui.divText('from smiles', {style: {fontSize: 'smaller'}}),
197
203
  ]);
198
204
  } else {
@@ -271,13 +277,12 @@ export class MonomerLibBase implements IMonomerLibBase {
271
277
  }
272
278
 
273
279
  const naSymbol: string | undefined = monomer[OPT.NATURAL_ANALOG];
274
- if (!res && naSymbol) {
280
+ if (!res && naSymbol)
275
281
  return this.getMonomerColors(biotype, naSymbol);
276
- }
277
282
  }
278
283
 
279
284
  if (!res)
280
- res = {textColor: "#202020", lineColor: "#202020", backgroundColor: "#A0A0A0"};
285
+ res = {textColor: '#202020', lineColor: '#202020', backgroundColor: '#A0A0A0'};
281
286
 
282
287
  return {
283
288
  textcolor: res.text ?? res.textColor,