@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.
- package/CHANGELOG.md +25 -0
- package/detectors.js +16 -11
- package/dist/455.js.map +1 -1
- package/dist/980.js +1 -1
- package/dist/980.js.map +1 -1
- package/dist/package-test.js +6 -6
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/package.json +14 -14
- package/src/analysis/sequence-activity-cliffs.ts +9 -8
- package/src/analysis/sequence-diversity-viewer.ts +6 -4
- package/src/analysis/sequence-similarity-viewer.ts +9 -6
- package/src/analysis/sequence-space.ts +3 -2
- package/src/calculations/monomerLevelMols.ts +4 -5
- package/src/demo/bio01-similarity-diversity.ts +4 -1
- package/src/package-test.ts +1 -1
- package/src/package-types.ts +34 -2
- package/src/package.ts +60 -76
- package/src/substructure-search/substructure-search.ts +15 -9
- package/src/tests/WebLogo-layout-tests.ts +1 -1
- package/src/tests/WebLogo-positions-test.ts +11 -5
- package/src/tests/WebLogo-project-tests.ts +1 -1
- package/src/tests/activity-cliffs-utils.ts +11 -14
- package/src/tests/bio-tests.ts +85 -79
- package/src/tests/checkInputColumn-tests.ts +15 -10
- package/src/tests/converters-test.ts +12 -5
- package/src/tests/detectors-benchmark-tests.ts +5 -2
- package/src/tests/detectors-tests.ts +51 -44
- package/src/tests/detectors-weak-and-likely-tests.ts +12 -5
- package/src/tests/fasta-export-tests.ts +13 -5
- package/src/tests/helm-tests.ts +85 -0
- package/src/tests/mm-distance-tests.ts +14 -7
- package/src/tests/monomer-libraries-tests.ts +1 -1
- package/src/tests/msa-tests.ts +33 -24
- package/src/tests/renderers-monomer-placer-tests.ts +2 -5
- package/src/tests/renderers-test.ts +15 -9
- package/src/tests/scoring.ts +9 -6
- package/src/tests/seq-handler-get-helm-tests.ts +7 -5
- package/src/tests/seq-handler-get-region-tests.ts +9 -3
- package/src/tests/seq-handler-splitted-tests.ts +11 -5
- package/src/tests/seq-handler-tests.ts +17 -10
- package/src/tests/sequence-space-utils.ts +9 -4
- package/src/tests/splitters-test.ts +5 -4
- package/src/tests/substructure-filters-tests.ts +22 -23
- package/src/tests/to-atomic-level-tests.ts +5 -3
- package/src/tests/to-atomic-level-ui-tests.ts +4 -1
- package/src/tests/utils/detectors-utils.ts +4 -4
- package/src/utils/calculate-scores.ts +11 -9
- package/src/utils/cell-renderer-custom.ts +27 -17
- package/src/utils/cell-renderer.ts +14 -8
- package/src/utils/check-input-column.ts +13 -9
- package/src/utils/context-menu.ts +4 -4
- package/src/utils/convert.ts +21 -14
- package/src/utils/get-region-func-editor.ts +8 -5
- package/src/utils/get-region.ts +4 -5
- package/src/utils/helm-to-molfile/converter/helm.ts +4 -4
- package/src/utils/helm-to-molfile/utils.ts +5 -6
- package/src/utils/macromolecule-column-widget.ts +6 -7
- package/src/utils/monomer-cell-renderer-base.ts +8 -1
- package/src/utils/monomer-lib/lib-manager.ts +3 -2
- package/src/utils/monomer-lib/monomer-colors.ts +10 -10
- package/src/utils/monomer-lib/monomer-lib-base.ts +6 -1
- package/src/utils/monomer-lib/monomer-lib.ts +15 -9
- package/src/utils/multiple-sequence-alignment-ui.ts +30 -30
- package/src/utils/save-as-fasta.ts +19 -12
- package/src/utils/seq-helper/seq-handler.ts +836 -0
- package/src/utils/seq-helper/seq-helper.ts +43 -19
- package/src/utils/sequence-to-mol.ts +7 -8
- package/src/utils/split-to-monomers.ts +7 -2
- package/src/utils/types.ts +8 -7
- package/src/utils/ui-utils.ts +2 -2
- package/src/viewers/web-logo-viewer.ts +18 -16
- package/src/widgets/bio-substructure-filter-helm.ts +5 -2
- package/src/widgets/bio-substructure-filter.ts +14 -24
- package/src/widgets/composition-analysis-widget.ts +6 -6
- package/src/widgets/representations.ts +7 -4
- package/src/tests/detectors-custom-notation-tests.ts +0 -37
- package/src/utils/cyclized.ts +0 -89
- package/src/utils/dimerized.ts +0 -10
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Aleksandr Tanas",
|
|
6
6
|
"email": "atanas@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.16.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",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@biowasm/aioli": "^3.1.0",
|
|
40
|
-
"@datagrok-libraries/bio": "^5.
|
|
40
|
+
"@datagrok-libraries/bio": "^5.45.2",
|
|
41
41
|
"@datagrok-libraries/chem-meta": "^1.2.7",
|
|
42
42
|
"@datagrok-libraries/math": "^1.2.1",
|
|
43
|
-
"@datagrok-libraries/ml": "^6.7.
|
|
43
|
+
"@datagrok-libraries/ml": "^6.7.4",
|
|
44
44
|
"@datagrok-libraries/tutorials": "^1.4.3",
|
|
45
45
|
"@datagrok-libraries/utils": "^4.3.6",
|
|
46
46
|
"@webgpu/types": "^0.1.40",
|
|
@@ -55,27 +55,27 @@
|
|
|
55
55
|
"rxjs": "^6.5.5",
|
|
56
56
|
"style-loader": "^3.3.1",
|
|
57
57
|
"umap-js": "^1.3.3",
|
|
58
|
-
"wu": "
|
|
58
|
+
"wu": "^2.1.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@datagrok-libraries/helm-web-editor": "^1.1.
|
|
62
|
-
"@datagrok-libraries/js-draw-lite": "^0.0.
|
|
61
|
+
"@datagrok-libraries/helm-web-editor": "^1.1.12",
|
|
62
|
+
"@datagrok-libraries/js-draw-lite": "^0.0.9",
|
|
63
63
|
"@datagrok/chem": "^1.12.3",
|
|
64
64
|
"@datagrok/dendrogram": "^1.2.33",
|
|
65
65
|
"@datagrok/helm": "^2.5.3",
|
|
66
66
|
"@types/node": "^17.0.24",
|
|
67
|
-
"@types/wu": "
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "
|
|
69
|
-
"@typescript-eslint/parser": "
|
|
67
|
+
"@types/wu": "^2.1.44",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
69
|
+
"@typescript-eslint/parser": "^8.8.1",
|
|
70
70
|
"datagrok-tools": "latest",
|
|
71
|
-
"eslint": "
|
|
72
|
-
"eslint-config-google": "
|
|
73
|
-
"eslint-plugin-rxjs": "
|
|
74
|
-
"source-map-loader": "
|
|
71
|
+
"eslint": "^9.12.0",
|
|
72
|
+
"eslint-config-google": "^0.14.0",
|
|
73
|
+
"eslint-plugin-rxjs": "^5.0.3",
|
|
74
|
+
"source-map-loader": "^5.0.0",
|
|
75
75
|
"ts-loader": "^9.5.1",
|
|
76
76
|
"typescript": "^5.5.3",
|
|
77
77
|
"webpack": "^5.92.1",
|
|
78
|
-
"webpack-bundle-analyzer": "
|
|
78
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
79
79
|
"webpack-cli": "^5.1.4"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
@@ -6,15 +6,16 @@ import wu from 'wu';
|
|
|
6
6
|
|
|
7
7
|
import {ITooltipAndPanelParams} from '@datagrok-libraries/ml/src/viewers/activity-cliffs';
|
|
8
8
|
import {getSimilarityFromDistance} from '@datagrok-libraries/ml/src/distance-metrics-methods';
|
|
9
|
+
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
9
10
|
import {AvailableMetrics, DistanceMetricsSubjects, StringMetricsNames} from '@datagrok-libraries/ml/src/typed-metrics';
|
|
10
|
-
import {drawMoleculeDifferenceOnCanvas} from '../utils/cell-renderer';
|
|
11
|
-
import {invalidateMols, MONOMERIC_COL_TAGS} from '../substructure-search/substructure-search';
|
|
12
11
|
import {TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
13
|
-
import {SeqHandler} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
14
12
|
import {ISeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/types';
|
|
15
13
|
import {HelmType} from '@datagrok-libraries/bio/src/helm/types';
|
|
16
14
|
|
|
17
|
-
import {
|
|
15
|
+
import {drawMoleculeDifferenceOnCanvas} from '../utils/cell-renderer';
|
|
16
|
+
import {invalidateMols, MONOMERIC_COL_TAGS} from '../substructure-search/substructure-search';
|
|
17
|
+
|
|
18
|
+
import {_package} from '../package';
|
|
18
19
|
|
|
19
20
|
export async function getDistances(col: DG.Column, seq: string): Promise<Array<number>> {
|
|
20
21
|
const stringArray = col.toList();
|
|
@@ -47,11 +48,11 @@ export async function getSimilaritiesMatrix(
|
|
|
47
48
|
return simArr;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
export async function getChemSimilaritiesMatrix(dim: number, seqCol: DG.Column,
|
|
51
|
+
export async function getChemSimilaritiesMatrix(dim: number, seqCol: DG.Column, seqHelper: ISeqHelper,
|
|
51
52
|
df: DG.DataFrame, colName: string, simArr: (DG.Column | null)[])
|
|
52
53
|
: Promise<(DG.Column | null)[]> {
|
|
53
54
|
if (seqCol.version !== seqCol.temp[MONOMERIC_COL_TAGS.LAST_INVALIDATED_VERSION])
|
|
54
|
-
await invalidateMols(seqCol, false);
|
|
55
|
+
await invalidateMols(seqCol, seqHelper, false);
|
|
55
56
|
const fpDf = DG.DataFrame.create(seqCol.length);
|
|
56
57
|
fpDf.columns.addNewString(colName).init((i) => seqCol.temp[MONOMERIC_COL_TAGS.MONOMERIC_MOLS].get(i));
|
|
57
58
|
const res = await grok.functions.call('Chem:getChemSimilaritiesMatrix', {
|
|
@@ -108,7 +109,7 @@ export function createPropPanelElement(params: ITooltipAndPanelParams): HTMLDivE
|
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
const molDifferences: { [key: number]: HTMLCanvasElement } = {};
|
|
111
|
-
const sh =
|
|
112
|
+
const sh = _package.seqHelper.getSeqHandler(params.seqCol);
|
|
112
113
|
const biotype = sh.defaultBiotype;
|
|
113
114
|
const subParts1 = sh.getSplitted(params.points[0]);
|
|
114
115
|
const subParts2 = sh.getSplitted(params.points[1]);
|
|
@@ -138,7 +139,7 @@ export function createDifferenceCanvas(
|
|
|
138
139
|
const canvas = document.createElement('canvas');
|
|
139
140
|
const context = canvas.getContext('2d');
|
|
140
141
|
canvas.height = 30;
|
|
141
|
-
const monomerLib =
|
|
142
|
+
const monomerLib = _package.monomerLib;
|
|
142
143
|
drawMoleculeDifferenceOnCanvas(context!, 0, 0, 0, 30,
|
|
143
144
|
wu.count(0).take(subParts1.length).map((posIdx) => subParts1.getCanonical(posIdx)).toArray(),
|
|
144
145
|
wu.count(0).take(subParts2.length).map((posIdx) => subParts2.getCanonical(posIdx)).toArray(),
|
|
@@ -7,7 +7,7 @@ import {SequenceSearchBaseViewer} from './sequence-search-base-viewer';
|
|
|
7
7
|
import {getMonomericMols} from '../calculations/monomerLevelMols';
|
|
8
8
|
import {updateDivInnerHTML} from '../utils/ui-utils';
|
|
9
9
|
import {Subject} from 'rxjs';
|
|
10
|
-
import {
|
|
10
|
+
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
11
11
|
import {getEncodedSeqSpaceCol} from './sequence-space';
|
|
12
12
|
import {MmDistanceFunctionsNames} from '@datagrok-libraries/ml/src/macromolecule-distance-functions';
|
|
13
13
|
import {DistanceMatrixService, dmLinearIndex} from '@datagrok-libraries/ml/src/distance-matrix';
|
|
@@ -19,7 +19,9 @@ export class SequenceDiversityViewer extends SequenceSearchBaseViewer {
|
|
|
19
19
|
columnNames = [];
|
|
20
20
|
computeCompleted = new Subject<boolean>();
|
|
21
21
|
|
|
22
|
-
constructor(
|
|
22
|
+
constructor(
|
|
23
|
+
private readonly seqHelper: ISeqHelper,
|
|
24
|
+
) {
|
|
23
25
|
super('diversity');
|
|
24
26
|
this.diverseColumnLabel = this.string('diverseColumnLabel', null);
|
|
25
27
|
}
|
|
@@ -29,7 +31,7 @@ export class SequenceDiversityViewer extends SequenceSearchBaseViewer {
|
|
|
29
31
|
return;
|
|
30
32
|
if (this.dataFrame) {
|
|
31
33
|
if (computeData && this.moleculeColumn) {
|
|
32
|
-
const sh =
|
|
34
|
+
const sh = this.seqHelper.getSeqHandler(this.moleculeColumn);
|
|
33
35
|
await (sh.isFasta() ? this.computeByMM() : this.computeByChem());
|
|
34
36
|
|
|
35
37
|
const diverseColumnName: string = this.diverseColumnLabel != null ? this.diverseColumnLabel :
|
|
@@ -48,7 +50,7 @@ export class SequenceDiversityViewer extends SequenceSearchBaseViewer {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
private async computeByChem() {
|
|
51
|
-
const monomericMols = await getMonomericMols(this.moleculeColumn
|
|
53
|
+
const monomericMols = await getMonomericMols(this.moleculeColumn!, this.seqHelper);
|
|
52
54
|
//need to create df to calculate fingerprints
|
|
53
55
|
const _monomericMolsDf = DG.DataFrame.fromColumns([monomericMols]);
|
|
54
56
|
this.renderMolIds = await grok.functions.call('Chem:callChemDiversitySearch', {
|
|
@@ -7,7 +7,7 @@ import {getMonomericMols} from '../calculations/monomerLevelMols';
|
|
|
7
7
|
import {createDifferenceCanvas, createDifferencesWithPositions} from './sequence-activity-cliffs';
|
|
8
8
|
import {updateDivInnerHTML} from '../utils/ui-utils';
|
|
9
9
|
import {Subject} from 'rxjs';
|
|
10
|
-
import {
|
|
10
|
+
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
11
11
|
import {alignSequencePair} from '@datagrok-libraries/bio/src/utils/macromolecule/alignment';
|
|
12
12
|
import {KnnResult, SparseMatrixService} from '@datagrok-libraries/ml/src/distance-matrix/sparse-matrix-service';
|
|
13
13
|
import {getEncodedSeqSpaceCol} from './sequence-space';
|
|
@@ -32,7 +32,10 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
32
32
|
kPrevNeighbors: number = 0;
|
|
33
33
|
demo?: boolean;
|
|
34
34
|
|
|
35
|
-
constructor(
|
|
35
|
+
constructor(
|
|
36
|
+
private readonly seqHelper: ISeqHelper,
|
|
37
|
+
demo?: boolean,
|
|
38
|
+
) {
|
|
36
39
|
super('similarity');
|
|
37
40
|
this.cutoff = this.float('cutoff', 0.01, {min: 0, max: 1});
|
|
38
41
|
this.hotSearch = this.bool('hotSearch', true);
|
|
@@ -52,7 +55,7 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
52
55
|
this.curIdx = this.dataFrame!.currentRowIdx == -1 ? 0 : this.dataFrame!.currentRowIdx;
|
|
53
56
|
if (computeData && !this.gridSelect) {
|
|
54
57
|
this.targetMoleculeIdx = this.dataFrame!.currentRowIdx == -1 ? 0 : this.dataFrame!.currentRowIdx;
|
|
55
|
-
const sh =
|
|
58
|
+
const sh = this.seqHelper.getSeqHandler(this.moleculeColumn!);
|
|
56
59
|
|
|
57
60
|
await (!sh.isHelm() ? this.computeByMM() : this.computeByChem());
|
|
58
61
|
const similarColumnName: string = this.similarColumnLabel != null ? this.similarColumnLabel :
|
|
@@ -83,7 +86,7 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
private async computeByChem() {
|
|
86
|
-
const monomericMols = await getMonomericMols(this.moleculeColumn
|
|
89
|
+
const monomericMols = await getMonomericMols(this.moleculeColumn!, this.seqHelper);
|
|
87
90
|
//need to create df to calculate fingerprints
|
|
88
91
|
const _monomericMolsDf = DG.DataFrame.fromColumns([monomericMols]);
|
|
89
92
|
const df = await grok.functions.call('Chem:callChemSimilaritySearch', {
|
|
@@ -125,8 +128,8 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
125
128
|
const molDifferences: { [key: number]: HTMLCanvasElement } = {};
|
|
126
129
|
const molColName = this.molCol?.name!;
|
|
127
130
|
const resCol: DG.Column<string> = resDf.col(molColName)!;
|
|
128
|
-
const molColSh =
|
|
129
|
-
const resSh =
|
|
131
|
+
const molColSh = this.seqHelper.getSeqHandler(this.moleculeColumn!);
|
|
132
|
+
const resSh = this.seqHelper.getSeqHandler(resCol);
|
|
130
133
|
const subParts1 = molColSh.getSplitted(this.targetMoleculeIdx);
|
|
131
134
|
const subParts2 = resSh.getSplitted(resDf.currentRowIdx);
|
|
132
135
|
const alignment = alignSequencePair(subParts1, subParts2);
|
|
@@ -4,10 +4,11 @@ import * as grok from 'datagrok-api/grok';
|
|
|
4
4
|
|
|
5
5
|
import {BitArrayMetrics} from '@datagrok-libraries/ml/src/typed-metrics';
|
|
6
6
|
import {mmDistanceFunctionArgs} from '@datagrok-libraries/ml/src/macromolecule-distance-functions/types';
|
|
7
|
-
import {SeqHandler} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
8
7
|
import {getMonomerSubstitutionMatrix} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
|
|
9
8
|
import {MmDistanceFunctionsNames} from '@datagrok-libraries/ml/src/macromolecule-distance-functions';
|
|
10
9
|
|
|
10
|
+
import {_package} from '../package';
|
|
11
|
+
|
|
11
12
|
export interface ISequenceSpaceResult {
|
|
12
13
|
distance?: Float32Array;
|
|
13
14
|
coordinates: DG.ColumnList;
|
|
@@ -18,7 +19,7 @@ export async function getEncodedSeqSpaceCol(
|
|
|
18
19
|
): Promise<{ seqList: string[], options: { [_: string]: any } }> {
|
|
19
20
|
// encodes sequences using utf characters to also support multichar and non fasta sequences
|
|
20
21
|
const rowCount = seqCol.length;
|
|
21
|
-
const sh =
|
|
22
|
+
const sh = _package.seqHelper.getSeqHandler(seqCol);
|
|
22
23
|
const encList = Array<string>(rowCount);
|
|
23
24
|
let charCodeCounter = 1; // start at 1, 0 is reserved for null.
|
|
24
25
|
const charCodeMap = new Map<string, string>();
|
|
@@ -4,21 +4,20 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
|
|
5
5
|
import wu from 'wu';
|
|
6
6
|
|
|
7
|
-
import {getHelmMonomers} from '../package';
|
|
8
|
-
import {SeqHandler} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
9
7
|
import {ISeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/types';
|
|
10
8
|
import {GAP_SYMBOL} from '@datagrok-libraries/bio/src/utils/macromolecule/consts';
|
|
9
|
+
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
11
10
|
|
|
12
11
|
const V2000_ATOM_NAME_POS = 31;
|
|
13
12
|
|
|
14
13
|
export async function getMonomericMols(
|
|
15
|
-
mcol: DG.Column<string>, pattern: boolean = false, monomersDict?: Map<string, string>
|
|
14
|
+
mcol: DG.Column<string>, seqHelper: ISeqHelper, pattern: boolean = false, monomersDict?: Map<string, string>
|
|
16
15
|
): Promise<DG.Column> {
|
|
17
|
-
const sh =
|
|
16
|
+
const sh = seqHelper.getSeqHandler(mcol);
|
|
18
17
|
let molV3000Array;
|
|
19
18
|
monomersDict ??= new Map();
|
|
20
19
|
const monomers = sh.isHelm() ?
|
|
21
|
-
|
|
20
|
+
seqHelper.getSeqMonomers(mcol) : Object.keys(sh.stats.freq).filter((it) => it !== '');
|
|
22
21
|
|
|
23
22
|
for (let i = 0; i < monomers.length; i++) {
|
|
24
23
|
if (!monomersDict.has(monomers[i]))
|
|
@@ -7,10 +7,13 @@ import {DemoScript} from '@datagrok-libraries/tutorials/src/demo-script';
|
|
|
7
7
|
import {handleError} from './utils';
|
|
8
8
|
import {SequenceDiversityViewer} from '../analysis/sequence-diversity-viewer';
|
|
9
9
|
import {SequenceSimilarityViewer} from '../analysis/sequence-similarity-viewer';
|
|
10
|
+
import {getSeqHelper, ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
10
11
|
|
|
11
12
|
const dataFn: string = 'samples/FASTA_PT_activity.csv';
|
|
12
13
|
|
|
13
14
|
export async function demoBio01UI() {
|
|
15
|
+
let seqHelper: ISeqHelper = await getSeqHelper();
|
|
16
|
+
|
|
14
17
|
let view: DG.TableView;
|
|
15
18
|
let df: DG.DataFrame;
|
|
16
19
|
|
|
@@ -37,7 +40,7 @@ export async function demoBio01UI() {
|
|
|
37
40
|
delay: 2000,
|
|
38
41
|
})
|
|
39
42
|
.step('Find the most similar sequences to the current one', async () => {
|
|
40
|
-
const simViewer = new SequenceSimilarityViewer(true);
|
|
43
|
+
const simViewer = new SequenceSimilarityViewer(seqHelper, true);
|
|
41
44
|
view.addViewer(simViewer, {
|
|
42
45
|
moleculeColumnName: 'sequence',
|
|
43
46
|
similarColumnLabel: 'Similar to current',
|
package/src/package-test.ts
CHANGED
|
@@ -8,7 +8,6 @@ import './tests/_first-tests';
|
|
|
8
8
|
import './tests/Palettes-test';
|
|
9
9
|
import './tests/detectors-tests';
|
|
10
10
|
import './tests/detectors-weak-and-likely-tests';
|
|
11
|
-
import './tests/detectors-custom-notation-tests';
|
|
12
11
|
import './tests/detectors-benchmark-tests';
|
|
13
12
|
import './tests/msa-tests';
|
|
14
13
|
import './tests/splitters-test';
|
|
@@ -31,6 +30,7 @@ import './tests/seq-handler-tests';
|
|
|
31
30
|
import './tests/seq-handler-splitted-tests';
|
|
32
31
|
import './tests/seq-handler-get-region-tests';
|
|
33
32
|
import './tests/seq-handler-get-helm-tests';
|
|
33
|
+
import './tests/helm-tests';
|
|
34
34
|
import './tests/to-atomic-level-tests';
|
|
35
35
|
import './tests/to-atomic-level-ui-tests';
|
|
36
36
|
import './tests/mm-distance-tests';
|
package/src/package-types.ts
CHANGED
|
@@ -7,6 +7,8 @@ import {Observable, Subject} from 'rxjs';
|
|
|
7
7
|
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
8
8
|
import {LoggerWrapper} from '@datagrok-libraries/bio/src/utils/logger';
|
|
9
9
|
import {RDModule} from '@datagrok-libraries/chem-meta/src/rdkit-api';
|
|
10
|
+
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
11
|
+
import {IMonomerLib, IMonomerLibBase, IMonomerSet} from '@datagrok-libraries/bio/src/types';
|
|
10
12
|
|
|
11
13
|
/** Names of package properties/settings declared in properties section of {@link './package.json'} */
|
|
12
14
|
export const enum BioPackagePropertiesNames {
|
|
@@ -60,8 +62,33 @@ export class BioPackageProperties extends Map<string, any> {
|
|
|
60
62
|
export class BioPackage extends DG.Package {
|
|
61
63
|
private _properties: BioPackageProperties;
|
|
62
64
|
|
|
65
|
+
private _seqHelper: ISeqHelper;
|
|
66
|
+
public get seqHelper(): ISeqHelper {
|
|
67
|
+
if (!this._seqHelper)
|
|
68
|
+
throw new Error('Package Bio .seqHelper is not initialized.');
|
|
69
|
+
return this._seqHelper;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
private _monomerLib: IMonomerLib;
|
|
73
|
+
public get monomerLib(): IMonomerLib {
|
|
74
|
+
if (!this._monomerLib)
|
|
75
|
+
throw new Error('Package Bio .monomerLib is not initialized.');
|
|
76
|
+
return this._monomerLib;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
private _monomerSets: IMonomerSet;
|
|
80
|
+
public get monomerSets(): IMonomerSet {
|
|
81
|
+
if (!this._monomerSets)
|
|
82
|
+
throw new Error('Package Bio .monomerSets is not initialized.');
|
|
83
|
+
return this._monomerSets;
|
|
84
|
+
};
|
|
85
|
+
|
|
63
86
|
private _rdKitModule: RDModule;
|
|
64
|
-
public get rdKitModule(): RDModule {
|
|
87
|
+
public get rdKitModule(): RDModule {
|
|
88
|
+
if (!this._rdKitModule)
|
|
89
|
+
throw new Error('Package Bio .rdKitModule is not initialized.');
|
|
90
|
+
return this._rdKitModule;
|
|
91
|
+
};
|
|
65
92
|
|
|
66
93
|
/** Package properties/settings declared in properties section of {@link './package.json'} */
|
|
67
94
|
public get properties(): BioPackageProperties { return this._properties; };
|
|
@@ -78,7 +105,12 @@ export class BioPackage extends DG.Package {
|
|
|
78
105
|
super._logger = new LoggerWrapper(super.logger, opts.debug);
|
|
79
106
|
}
|
|
80
107
|
|
|
81
|
-
public completeInit(
|
|
108
|
+
public completeInit(
|
|
109
|
+
seqHelper: ISeqHelper, monomerLib: IMonomerLib, monomerSets: IMonomerSet, rdKitModule: RDModule
|
|
110
|
+
): void {
|
|
111
|
+
this._seqHelper = seqHelper;
|
|
112
|
+
this._monomerLib = monomerLib;
|
|
113
|
+
this._monomerSets = monomerSets;
|
|
82
114
|
this._rdKitModule = rdKitModule;
|
|
83
115
|
this._initialized = true;
|
|
84
116
|
}
|