@datagrok/bio 2.21.2 → 2.21.4

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.21.2",
8
+ "version": "2.21.4",
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",
@@ -73,6 +73,8 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
73
73
  let prevTimer: any = null;
74
74
  const _ = resDf.onCurrentRowChanged.subscribe((_: any) => {
75
75
  prevTimer && clearTimeout(prevTimer);
76
+ if ((resDf.currentRowIdx ?? -1) < 0)
77
+ return;
76
78
  this.dataFrame.currentRowIdx = resDf.col('indexes')!.get(resDf.currentRowIdx);
77
79
  prevTimer = setTimeout(() => { this.createPropertyPanel(resDf); }, 300);
78
80
  this.gridSelect = true;
@@ -96,7 +96,7 @@ export class SubstructureSearchDialog {
96
96
  ]))
97
97
  .onOK(async () => {
98
98
  let substructure = this.units === NOTATION.HELM ? df.get(SUBSTR_HELM_COL_NAME, 0) : this.substructureInput.value;
99
- if (this.units === NOTATION.SEPARATOR && this.separatorInput.value !== this.separator && this.separatorInput.value !== '')
99
+ if (this.units === NOTATION.SEPARATOR && this.separatorInput.value !== this.separator && !!this.separatorInput.value)
100
100
  substructure = substructure.replaceAll(this.separatorInput.value, this.separator);
101
101
  let matches: DG.BitSet;
102
102
  if (this.units === NOTATION.HELM)
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-len */
1
2
  import * as DG from 'datagrok-api/dg';
2
3
  import {GridCell} from 'datagrok-api/dg';
3
4
  import * as ui from 'datagrok-api/ui';
@@ -25,8 +26,8 @@ export class MonomerCellRendererBack extends CellRendererWithMonomerLibBackBase
25
26
  ): void {
26
27
  g.save();
27
28
  try {
28
- if (gridCell.gridRow < 0) return;
29
- const applyToBackground = gridCell.cell?.column && gridCell.cell.column.getTag(MONOMER_RENDERER_TAGS.applyToBackground) === 'true';
29
+ if (!gridCell.isTableCell) return;
30
+ const applyToBackground = gridCell.cell?.column && gridCell.cell.column?.dart && gridCell.cell.column.getTag(MONOMER_RENDERER_TAGS.applyToBackground) === 'true';
30
31
 
31
32
  g.font = `12px monospace`;
32
33
  g.textBaseline = 'middle';
@@ -44,9 +45,8 @@ export class MonomerCellRendererBack extends CellRendererWithMonomerLibBackBase
44
45
  const colors = this.monomerLib.getMonomerColors(biotype, symbol);
45
46
  textcolor = colors?.textcolor ?? textcolor;
46
47
  backgroundcolor = colors?.backgroundcolor ?? backgroundcolor;
47
- } else {
48
+ } else
48
49
  textcolor = this.monomerLib.getMonomerTextColor(biotype, symbol);
49
- }
50
50
  }
51
51
 
52
52
  //cell width of monomer should dictate how many characters can be displayed
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-lines */
1
2
  /**
2
3
  * Macromolecules substructure filter that uses Datagrok's collaborative filtering.
3
4
  * 1. On onRowsFiltering event, only FILTER OUT rows that do not satisfy this filter's criteria
@@ -9,23 +10,21 @@ import * as DG from 'datagrok-api/dg';
9
10
  import * as grok from 'datagrok-api/grok';
10
11
 
11
12
  import wu from 'wu';
12
- import $ from 'cash-dom';
13
- import {fromEvent, Observable, Subject, Unsubscribable} from 'rxjs';
13
+
14
+ import {Observable, Subject, Unsubscribable} from 'rxjs';
14
15
 
15
16
  import {TAGS as bioTAGS, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
16
- import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
17
17
  import {delay, testEvent} from '@datagrok-libraries/utils/src/test';
18
- import {getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
19
18
  import {IRenderer} from '@datagrok-libraries/bio/src/types/renderer';
20
19
  import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
21
20
  import {PromiseSyncer} from '@datagrok-libraries/bio/src/utils/syncer';
22
21
  import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
23
22
 
24
- import {helmSubstructureSearch, linearSubstructureSearch} from '../substructure-search/substructure-search';
25
- import {updateDivInnerHTML} from '../utils/ui-utils';
26
- import {BioFilterBase, BioFilterProps, IBioFilter, IFilterProps} from '@datagrok-libraries/bio/src/substructure-filter/bio-substructure-filter-types';
23
+ import {linearSubstructureSearch} from '../substructure-search/substructure-search';
24
+ import {BioFilterBase, BioFilterProps, IBioFilter, IFilterProps}
25
+ from '@datagrok-libraries/bio/src/substructure-filter/bio-substructure-filter-types';
27
26
  import {HelmBioFilter} from './bio-substructure-filter-helm';
28
- import { _package } from '../package';
27
+ import {_package} from '../package';
29
28
 
30
29
  const FILTER_SYNC_EVENT: string = 'bio-substructure-filter';
31
30
 
@@ -334,14 +333,18 @@ export class SeparatorBioFilter extends BioFilterBase<SeparatorFilterProps> {
334
333
  this.substructureInput = ui.input.string('', {
335
334
  value: '', onValueChanged: (value) => {
336
335
  this.props = new SeparatorFilterProps(value, this.props.separator, _package.logger);
337
- if (!this._propsChanging) this.onChanged.next();
336
+ setTimeout(() => {
337
+ if (!this._propsChanging) this.onChanged.next();
338
+ });
338
339
  }, placeholder: 'Substructure'
339
340
  });
340
341
  this.separatorInput = ui.input.string('', {
341
342
  value: this.colSeparator = colSeparator, onValueChanged: (value) => {
342
- const separator: string | undefined = !!value ? value : undefined;
343
+ const separator: string | undefined = !!value ? value : '';
343
344
  this.props = new SeparatorFilterProps(this.props.substructure, separator, _package.logger);
344
- if (!this._propsChanging) this.onChanged.next();
345
+ setTimeout(() => {
346
+ if (!this._propsChanging) this.onChanged.next();
347
+ });
345
348
  }, placeholder: 'Separator'
346
349
  });
347
350
  }
@@ -356,7 +359,7 @@ export class SeparatorBioFilter extends BioFilterBase<SeparatorFilterProps> {
356
359
  }
357
360
 
358
361
  get filterSummary(): string {
359
- const sep: string = this.props.separator ? this.props.separator : this.colSeparator;
362
+ const _sep: string = this.props.separator ? this.props.separator : this.colSeparator;
360
363
  return `${this.props.substructure}, {sep}`;
361
364
  };
362
365