@datagrok/bio 2.4.8 → 2.4.10
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/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/src/package.ts +15 -11
- package/src/tests/WebLogo-positions-test.ts +1 -2
- package/src/viewers/vd-regions-viewer.ts +2 -2
- package/src/viewers/web-logo-viewer.ts +23 -42
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.4.
|
|
8
|
+
"version": "2.4.10",
|
|
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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@biowasm/aioli": "^3.1.0",
|
|
17
|
-
"@datagrok-libraries/bio": "^5.
|
|
17
|
+
"@datagrok-libraries/bio": "^5.28.0",
|
|
18
18
|
"@datagrok-libraries/chem-meta": "^1.0.1",
|
|
19
19
|
"@datagrok-libraries/ml": "^6.3.16",
|
|
20
20
|
"@datagrok-libraries/utils": "^2.1.3",
|
package/src/package.ts
CHANGED
|
@@ -758,30 +758,34 @@ export function bioSubstructureFilter(): BioSubstructureFilter {
|
|
|
758
758
|
|
|
759
759
|
// -- Demo --
|
|
760
760
|
|
|
761
|
-
//
|
|
762
|
-
//
|
|
761
|
+
// demoBio01
|
|
762
|
+
//name: demoBioSimilarityDiversity
|
|
763
|
+
//meta.demoPath: Bioinformatics | Similarity, Diversity
|
|
763
764
|
//description:
|
|
764
|
-
export async function
|
|
765
|
+
export async function demoBioSimilarityDiversity(): Promise<void> {
|
|
765
766
|
await demoBio01UI('func/Bio.demoBio01');
|
|
766
767
|
}
|
|
767
768
|
|
|
768
|
-
//
|
|
769
|
-
//
|
|
769
|
+
// demoBio01a
|
|
770
|
+
//name:demoBioSequenceSpace
|
|
771
|
+
//meta.demoPath: Bioinformatics | Sequence Space
|
|
770
772
|
//description:
|
|
771
|
-
export async function
|
|
773
|
+
export async function demoBioSequenceSpace(): Promise<void> {
|
|
772
774
|
await demoBio01aUI('func/Bio.demoBio01a');
|
|
773
775
|
}
|
|
774
776
|
|
|
775
|
-
//
|
|
776
|
-
//
|
|
777
|
+
// demoBio01b
|
|
778
|
+
//name: demoBioActivityCliffs
|
|
779
|
+
//meta.demoPath: Bioinformatics | Activity Cliffs
|
|
777
780
|
//description:
|
|
778
|
-
export async function
|
|
781
|
+
export async function demoBioActivityCliffs(): Promise<void> {
|
|
779
782
|
await demoBio01bUI('func/Bio.demoBio01b');
|
|
780
783
|
}
|
|
781
784
|
|
|
782
|
-
//
|
|
785
|
+
// demoBio05
|
|
786
|
+
//name: demoBioHelmMsaSequenceSpace
|
|
783
787
|
//meta.demoPath: Bioinformatics | Helm, MSA, Sequence Space
|
|
784
788
|
//description:
|
|
785
|
-
export async function
|
|
789
|
+
export async function demoBioHelmMsaSequenceSpace(): Promise<void> {
|
|
786
790
|
await demoBio05UI('func/demoBio05');
|
|
787
791
|
}
|
|
@@ -5,7 +5,6 @@ import {after, before, category, expect, expectArray, test} from '@datagrok-libr
|
|
|
5
5
|
import {ALPHABET, NOTATION, SplitterFunc, TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
6
|
import {
|
|
7
7
|
countForMonomerAtPosition,
|
|
8
|
-
FilterSources,
|
|
9
8
|
PositionInfo as PI,
|
|
10
9
|
PositionMonomerInfo as PMI,
|
|
11
10
|
WebLogoViewer
|
|
@@ -81,7 +80,7 @@ ATC-G-TTGC--
|
|
|
81
80
|
});
|
|
82
81
|
|
|
83
82
|
test('positions with shrinkEmptyTail option true (filtered)', async () => {
|
|
84
|
-
const csvDf2 = `seq
|
|
83
|
+
const csvDf2 = `seq
|
|
85
84
|
-TC-G-TTGC--
|
|
86
85
|
-TC-GCTTGC--
|
|
87
86
|
-T--C-GT-
|
|
@@ -2,12 +2,12 @@ import * as ui from 'datagrok-api/ui';
|
|
|
2
2
|
import * as DG from 'datagrok-api/dg';
|
|
3
3
|
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
|
-
import {
|
|
5
|
+
import {WebLogoViewer, PROPS as wlPROPS} from '../viewers/web-logo-viewer';
|
|
6
6
|
import {
|
|
7
7
|
VdRegionsPropsDefault, VdRegionsProps, IVdRegionsViewer,
|
|
8
8
|
VdRegion, VdRegionType
|
|
9
9
|
} from '@datagrok-libraries/bio/src/viewers/vd-regions';
|
|
10
|
-
import {PositionHeight} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
10
|
+
import {FilterSources, PositionHeight} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
11
11
|
import {Unsubscribable} from 'rxjs';
|
|
12
12
|
|
|
13
13
|
const vrt = VdRegionType;
|
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
WebLogoPropsDefault, WebLogoProps, IWebLogoViewer,
|
|
17
17
|
PositionHeight,
|
|
18
18
|
positionSeparator,
|
|
19
|
+
VerticalAlignments,
|
|
20
|
+
HorizontalAlignments,
|
|
21
|
+
PositionMarginStates,
|
|
22
|
+
FilterSources,
|
|
19
23
|
} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
20
24
|
import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
|
|
21
25
|
import {TAGS as wlTAGS} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
@@ -80,29 +84,6 @@ export class PositionInfo {
|
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
export enum VerticalAlignments {
|
|
84
|
-
TOP = 'top',
|
|
85
|
-
MIDDLE = 'middle',
|
|
86
|
-
BOTTOM = 'bottom',
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export enum HorizontalAlignments {
|
|
90
|
-
LEFT = 'left',
|
|
91
|
-
CENTER = 'center',
|
|
92
|
-
RIGHT = 'right',
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export enum PositionMarginStates {
|
|
96
|
-
AUTO = 'auto',
|
|
97
|
-
ON = 'on',
|
|
98
|
-
OFF = 'off',
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export enum FilterSources {
|
|
102
|
-
Filtered = 'Filtered',
|
|
103
|
-
Selected = 'Selected',
|
|
104
|
-
}
|
|
105
|
-
|
|
106
87
|
export enum PROPS_CATS {
|
|
107
88
|
STYLE = 'Style',
|
|
108
89
|
BEHAVIOR = 'Behavior',
|
|
@@ -138,6 +119,8 @@ export enum PROPS {
|
|
|
138
119
|
filterSource = 'filterSource',
|
|
139
120
|
}
|
|
140
121
|
|
|
122
|
+
const defaults: WebLogoProps = WebLogoPropsDefault;
|
|
123
|
+
|
|
141
124
|
export class WebLogoViewer extends DG.JsViewer {
|
|
142
125
|
public static residuesSet = 'nucleotides';
|
|
143
126
|
private static viewerCount: number = -1;
|
|
@@ -270,43 +253,41 @@ export class WebLogoViewer extends DG.JsViewer {
|
|
|
270
253
|
this.unitsHandler = null;
|
|
271
254
|
|
|
272
255
|
// -- Data --
|
|
273
|
-
this.sequenceColumnName = this.string(PROPS.sequenceColumnName,
|
|
256
|
+
this.sequenceColumnName = this.string(PROPS.sequenceColumnName, defaults.sequenceColumnName,
|
|
274
257
|
{category: PROPS_CATS.DATA});
|
|
275
|
-
this.startPositionName = this.string(PROPS.startPositionName,
|
|
258
|
+
this.startPositionName = this.string(PROPS.startPositionName, defaults.startPositionName,
|
|
276
259
|
{category: PROPS_CATS.DATA});
|
|
277
|
-
this.endPositionName = this.string(PROPS.endPositionName,
|
|
260
|
+
this.endPositionName = this.string(PROPS.endPositionName, defaults.endPositionName,
|
|
278
261
|
{category: PROPS_CATS.DATA});
|
|
279
|
-
this.skipEmptySequences = this.bool(PROPS.skipEmptySequences,
|
|
262
|
+
this.skipEmptySequences = this.bool(PROPS.skipEmptySequences, defaults.skipEmptySequences,
|
|
280
263
|
{category: PROPS_CATS.DATA});
|
|
281
|
-
this.skipEmptyPositions = this.bool(PROPS.skipEmptyPositions,
|
|
264
|
+
this.skipEmptyPositions = this.bool(PROPS.skipEmptyPositions, defaults.skipEmptyPositions,
|
|
282
265
|
{category: PROPS_CATS.DATA});
|
|
283
|
-
this.shrinkEmptyTail = this.bool(PROPS.shrinkEmptyTail,
|
|
266
|
+
this.shrinkEmptyTail = this.bool(PROPS.shrinkEmptyTail, defaults.shrinkEmptyTail,
|
|
284
267
|
{category: PROPS_CATS.DATA});
|
|
285
268
|
|
|
286
|
-
|
|
287
269
|
// -- Style --
|
|
288
|
-
this.backgroundColor = this.int(PROPS.backgroundColor,
|
|
270
|
+
this.backgroundColor = this.int(PROPS.backgroundColor, defaults.backgroundColor,
|
|
289
271
|
{category: PROPS_CATS.STYLE});
|
|
290
|
-
this.positionHeight = this.string(PROPS.positionHeight,
|
|
272
|
+
this.positionHeight = this.string(PROPS.positionHeight, defaults.positionHeight,
|
|
291
273
|
{category: PROPS_CATS.STYLE, choices: Object.values(PositionHeight)});
|
|
292
|
-
this._positionWidth = this.positionWidth = this.float(PROPS.positionWidth,
|
|
274
|
+
this._positionWidth = this.positionWidth = this.float(PROPS.positionWidth, defaults.positionWidth,
|
|
293
275
|
{category: PROPS_CATS.STYLE/* editor: 'slider', min: 4, max: 64, postfix: 'px' */});
|
|
294
276
|
|
|
295
|
-
|
|
296
277
|
// -- Layout --
|
|
297
|
-
this.verticalAlignment = this.string(PROPS.verticalAlignment,
|
|
278
|
+
this.verticalAlignment = this.string(PROPS.verticalAlignment, defaults.verticalAlignment,
|
|
298
279
|
{category: PROPS_CATS.LAYOUT, choices: Object.values(VerticalAlignments)});
|
|
299
|
-
this.horizontalAlignment = this.string(PROPS.horizontalAlignment,
|
|
280
|
+
this.horizontalAlignment = this.string(PROPS.horizontalAlignment, defaults.horizontalAlignment,
|
|
300
281
|
{category: PROPS_CATS.LAYOUT, choices: Object.values(HorizontalAlignments)});
|
|
301
|
-
this.fixWidth = this.bool(PROPS.fixWidth,
|
|
282
|
+
this.fixWidth = this.bool(PROPS.fixWidth, defaults.fixWidth,
|
|
302
283
|
{category: PROPS_CATS.LAYOUT});
|
|
303
|
-
this.fitArea = this.bool(PROPS.fitArea,
|
|
284
|
+
this.fitArea = this.bool(PROPS.fitArea, defaults.fitArea,
|
|
304
285
|
{category: PROPS_CATS.LAYOUT});
|
|
305
|
-
this.minHeight = this.float(PROPS.minHeight,
|
|
286
|
+
this.minHeight = this.float(PROPS.minHeight, defaults.minHeight,
|
|
306
287
|
{category: PROPS_CATS.LAYOUT/*, editor: 'slider', min: 25, max: 250, postfix: 'px'*/});
|
|
307
|
-
this.maxHeight = this.float(PROPS.maxHeight,
|
|
288
|
+
this.maxHeight = this.float(PROPS.maxHeight, defaults.maxHeight,
|
|
308
289
|
{category: PROPS_CATS.LAYOUT/*, editor: 'slider', min: 25, max: 500, postfix: 'px'*/});
|
|
309
|
-
this.positionMarginState = this.string(PROPS.positionMarginState,
|
|
290
|
+
this.positionMarginState = this.string(PROPS.positionMarginState, defaults.positionMarginState,
|
|
310
291
|
{category: PROPS_CATS.LAYOUT, choices: Object.values(PositionMarginStates)});
|
|
311
292
|
let defaultValueForPositionMargin = 0;
|
|
312
293
|
if (this.positionMarginState === 'auto') defaultValueForPositionMargin = 4;
|
|
@@ -314,7 +295,7 @@ export class WebLogoViewer extends DG.JsViewer {
|
|
|
314
295
|
{category: PROPS_CATS.LAYOUT, min: 0, max: 16});
|
|
315
296
|
|
|
316
297
|
// -- Behavior --
|
|
317
|
-
this.filterSource = this.string(PROPS.filterSource,
|
|
298
|
+
this.filterSource = this.string(PROPS.filterSource, defaults.filterSource,
|
|
318
299
|
{category: PROPS_CATS.BEHAVIOR, choices: Object.values(FilterSources)}) as FilterSources;
|
|
319
300
|
|
|
320
301
|
const style: SliderOptions = {style: 'barbell'};
|