@datagrok/bio 2.15.13 → 2.16.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/detectors.js +16 -11
  3. package/dist/455.js.map +1 -1
  4. package/dist/980.js +1 -1
  5. package/dist/980.js.map +1 -1
  6. package/dist/package-test.js +6 -6
  7. package/dist/package-test.js.map +1 -1
  8. package/dist/package.js +3 -3
  9. package/dist/package.js.map +1 -1
  10. package/package.json +14 -14
  11. package/src/analysis/sequence-activity-cliffs.ts +9 -8
  12. package/src/analysis/sequence-diversity-viewer.ts +6 -4
  13. package/src/analysis/sequence-similarity-viewer.ts +9 -6
  14. package/src/analysis/sequence-space.ts +3 -2
  15. package/src/calculations/monomerLevelMols.ts +4 -5
  16. package/src/demo/bio01-similarity-diversity.ts +4 -1
  17. package/src/package-test.ts +1 -1
  18. package/src/package-types.ts +34 -2
  19. package/src/package.ts +60 -76
  20. package/src/substructure-search/substructure-search.ts +15 -9
  21. package/src/tests/WebLogo-layout-tests.ts +1 -1
  22. package/src/tests/WebLogo-positions-test.ts +11 -5
  23. package/src/tests/WebLogo-project-tests.ts +1 -1
  24. package/src/tests/activity-cliffs-utils.ts +11 -14
  25. package/src/tests/bio-tests.ts +85 -79
  26. package/src/tests/checkInputColumn-tests.ts +15 -10
  27. package/src/tests/converters-test.ts +12 -5
  28. package/src/tests/detectors-benchmark-tests.ts +5 -2
  29. package/src/tests/detectors-tests.ts +51 -44
  30. package/src/tests/detectors-weak-and-likely-tests.ts +12 -5
  31. package/src/tests/fasta-export-tests.ts +13 -5
  32. package/src/tests/helm-tests.ts +85 -0
  33. package/src/tests/mm-distance-tests.ts +14 -7
  34. package/src/tests/monomer-libraries-tests.ts +1 -1
  35. package/src/tests/msa-tests.ts +33 -24
  36. package/src/tests/renderers-monomer-placer-tests.ts +2 -5
  37. package/src/tests/renderers-test.ts +15 -9
  38. package/src/tests/scoring.ts +9 -6
  39. package/src/tests/seq-handler-get-helm-tests.ts +7 -5
  40. package/src/tests/seq-handler-get-region-tests.ts +9 -3
  41. package/src/tests/seq-handler-splitted-tests.ts +11 -5
  42. package/src/tests/seq-handler-tests.ts +17 -10
  43. package/src/tests/sequence-space-utils.ts +9 -4
  44. package/src/tests/splitters-test.ts +5 -4
  45. package/src/tests/substructure-filters-tests.ts +22 -23
  46. package/src/tests/to-atomic-level-tests.ts +5 -3
  47. package/src/tests/to-atomic-level-ui-tests.ts +4 -1
  48. package/src/tests/utils/detectors-utils.ts +4 -4
  49. package/src/utils/calculate-scores.ts +11 -9
  50. package/src/utils/cell-renderer-custom.ts +27 -17
  51. package/src/utils/cell-renderer.ts +14 -8
  52. package/src/utils/check-input-column.ts +13 -9
  53. package/src/utils/context-menu.ts +4 -4
  54. package/src/utils/convert.ts +21 -14
  55. package/src/utils/get-region-func-editor.ts +8 -5
  56. package/src/utils/get-region.ts +4 -5
  57. package/src/utils/helm-to-molfile/converter/helm.ts +4 -4
  58. package/src/utils/helm-to-molfile/utils.ts +5 -6
  59. package/src/utils/macromolecule-column-widget.ts +6 -7
  60. package/src/utils/monomer-cell-renderer-base.ts +8 -1
  61. package/src/utils/monomer-lib/lib-manager.ts +3 -2
  62. package/src/utils/monomer-lib/monomer-colors.ts +10 -10
  63. package/src/utils/monomer-lib/monomer-lib-base.ts +6 -1
  64. package/src/utils/monomer-lib/monomer-lib.ts +15 -9
  65. package/src/utils/multiple-sequence-alignment-ui.ts +30 -30
  66. package/src/utils/save-as-fasta.ts +19 -12
  67. package/src/utils/seq-helper/seq-handler.ts +836 -0
  68. package/src/utils/seq-helper/seq-helper.ts +43 -19
  69. package/src/utils/sequence-to-mol.ts +7 -8
  70. package/src/utils/split-to-monomers.ts +7 -2
  71. package/src/utils/types.ts +8 -7
  72. package/src/utils/ui-utils.ts +2 -2
  73. package/src/viewers/web-logo-viewer.ts +18 -16
  74. package/src/widgets/bio-substructure-filter-helm.ts +5 -2
  75. package/src/widgets/bio-substructure-filter.ts +14 -24
  76. package/src/widgets/composition-analysis-widget.ts +6 -6
  77. package/src/widgets/representations.ts +7 -4
  78. package/src/tests/detectors-custom-notation-tests.ts +0 -37
  79. package/src/utils/cyclized.ts +0 -89
  80. package/src/utils/dimerized.ts +0 -10
@@ -1,89 +0,0 @@
1
- import * as grok from 'datagrok-api/grok';
2
- import * as ui from 'datagrok-api/ui';
3
- import * as DG from 'datagrok-api/dg';
4
-
5
- import wu from 'wu';
6
-
7
- import {INotationProvider, ISeqSplitted, SeqSplittedBase, SplitterFunc}
8
- from '@datagrok-libraries/bio/src/utils/macromolecule/types';
9
- import {getSplitterWithSeparator, StringListSeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/utils';
10
- import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
11
- import {CellRendererBackBase} from '@datagrok-libraries/bio/src/utils/cell-renderer-back-base';
12
- import {GAP_SYMBOL, GapOriginals} from '@datagrok-libraries/bio/src/utils/macromolecule/consts';
13
- import {MonomerPlacer} from '@datagrok-libraries/bio/src/utils/cell-renderer-monomer-placer';
14
- import {SeqHandler} from '@datagrok-libraries/bio/src/utils/seq-handler';
15
-
16
- import {monomerToShortFunction} from './cell-renderer';
17
-
18
- import {_package} from '../package';
19
-
20
- export class CyclizedNotationProvider implements INotationProvider {
21
- private readonly separatorSplitter: SplitterFunc;
22
- public readonly splitter: SplitterFunc;
23
-
24
- constructor(
25
- public readonly separator: string
26
- ) {
27
- this.separatorSplitter = getSplitterWithSeparator(this.separator);
28
- this.splitter = this._splitter.bind(this);
29
- }
30
-
31
- private _splitter(seq: string): ISeqSplitted {
32
- const baseSS: ISeqSplitted = this.separatorSplitter(seq);
33
- return new CyclizedSeqSplitted(
34
- wu.count(0).take(baseSS.length).map((p) => baseSS.getOriginal(p)).toArray(),
35
- GapOriginals[NOTATION.SEPARATOR]);
36
- }
37
-
38
- public async getHelm(seqCol: DG.Column<string>, options?: any): Promise<DG.Column<string>> {
39
- const polyToolPackageName: string = 'SequenceTranslator';
40
-
41
- const funcList = DG.Func.find({package: polyToolPackageName, name: 'polyToolConvert2'});
42
- if (funcList.length == 0)
43
- throw new Error(`Package '${polyToolPackageName}' must be installed for Cyclized notation provider.`);
44
- const func = funcList[0];
45
-
46
- const ptConvertCall = await func.prepare({table: seqCol.dataFrame, seqCol: seqCol, ...options});
47
-
48
- const editorFunc = DG.Func.find({package: polyToolPackageName, name: 'getPolyToolConvertEditor'})[0];
49
- const resHelmCol = (await editorFunc.prepare({call: ptConvertCall}).call()).getOutputParamValue() as DG.Column<string>;
50
- return resHelmCol;
51
- }
52
-
53
- public createCellRendererBack(gridCol: DG.GridColumn | null, tableCol: DG.Column<string>): CellRendererBackBase<string> {
54
- let maxLengthOfMonomer: number = (_package.properties ? _package.properties.maxMonomerLength : 4) ?? 50;
55
- return new MonomerPlacer(gridCol, tableCol, _package.logger, maxLengthOfMonomer,
56
- () => {
57
- const sh = SeqHandler.forColumn(tableCol);
58
- return {
59
- seqHandler: sh,
60
- monomerCharWidth: 7,
61
- separatorWidth: 11,
62
- monomerToShort: monomerToShortFunction,
63
- };
64
- });
65
- }
66
- }
67
-
68
- /** Gets canonical monomers for original ones with cyclization marks */
69
- export class CyclizedSeqSplitted extends StringListSeqSplitted {
70
- private readonly seqCList: (string | null)[];
71
-
72
- override getCanonical(posIdx: number): string {
73
- if (this.isGap(posIdx)) return GAP_SYMBOL;
74
-
75
- let cmRes: string | null = this.seqCList[posIdx];
76
- if (cmRes === null) {
77
- const om = this.getOriginal(posIdx);
78
- cmRes = om;
79
- if (om[om.length - 1] === ')')
80
- cmRes = this.seqCList[posIdx] = om.replace(/\(\d+\)$/, '');
81
- }
82
- return cmRes;
83
- }
84
-
85
- constructor(seqOList: SeqSplittedBase, gapOriginalMonomer: string) {
86
- super(seqOList, gapOriginalMonomer);
87
- this.seqCList = new Array<string | null>(this.length).fill(null);
88
- }
89
- }
@@ -1,10 +0,0 @@
1
- import * as grok from 'datagrok-api/grok';
2
- import * as ui from 'datagrok-api/ui';
3
- import * as DG from 'datagrok-api/dg';
4
-
5
- import {CyclizedNotationProvider} from './cyclized';
6
-
7
-
8
- export class DimerizedNotationProvider extends CyclizedNotationProvider {
9
-
10
- }