@datagrok/bio 2.21.7 → 2.21.9
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 +7 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/src/widgets/sequence-scrolling-widget.ts +23 -16
- package/test-console-output-1.log +307 -306
- package/test-record-1.mp4 +0 -0
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.
|
|
8
|
+
"version": "2.21.9",
|
|
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
|
+
"@datagrok-libraries/bio": "^5.53.0",
|
|
48
48
|
"@datagrok-libraries/chem-meta": "^1.2.7",
|
|
49
49
|
"@datagrok-libraries/math": "^1.2.4",
|
|
50
50
|
"@datagrok-libraries/ml": "^6.10.0",
|
|
@@ -30,20 +30,26 @@ export function handleSequenceHeaderRendering() {
|
|
|
30
30
|
if (!gCol)
|
|
31
31
|
continue;
|
|
32
32
|
|
|
33
|
-
let positionStatsViewerAddedOnce =
|
|
34
|
-
|
|
33
|
+
let positionStatsViewerAddedOnce = !!grid.tableView && Array.from(grid.tableView.viewers).some((v) => v.type === 'Sequence Position Statistics');
|
|
34
|
+
const isMSA = sh.isMsa();
|
|
35
35
|
const ifNan = (a: number, els: number) => (Number.isNaN(a) ? els : a);
|
|
36
36
|
const getStart = () => ifNan(Math.max(Number.parseInt(seqCol.getTag(bioTAGS.positionShift) ?? '0'), 0), 0) + 1;
|
|
37
37
|
const getCurrent = () => ifNan(Number.parseInt(seqCol.getTag(bioTAGS.selectedPosition) ?? '-2'), -2);
|
|
38
38
|
const getFontSize = () => MonomerPlacer.getFontSettings(seqCol).fontWidth;
|
|
39
|
-
// get the maximum length of
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
// get the maximum length of seqs by getting the primitive length first and then splitting it with correct splitter;
|
|
40
|
+
let pseudoMaxLenIndex = 0;
|
|
41
|
+
let pseudoMaxLength = 0;
|
|
42
|
+
const cats = seqCol.categories;
|
|
43
|
+
for (let i = 0; i < cats.length; i++) {
|
|
44
|
+
const seq = cats[i];
|
|
45
|
+
if (seq && seq.length > pseudoMaxLength) {
|
|
46
|
+
pseudoMaxLength = seq.length;
|
|
47
|
+
pseudoMaxLenIndex = i;
|
|
48
|
+
}
|
|
46
49
|
}
|
|
50
|
+
const seq = cats[pseudoMaxLenIndex];
|
|
51
|
+
const split = sh.splitter(seq);
|
|
52
|
+
const maxSeqLen = split ? split.length : 30;
|
|
47
53
|
|
|
48
54
|
// makes no sense to have scroller if we have shorter than 50 positions
|
|
49
55
|
if (maxSeqLen < 50)
|
|
@@ -60,9 +66,9 @@ export function handleSequenceHeaderRendering() {
|
|
|
60
66
|
const cur = getCurrent();
|
|
61
67
|
if (start !== scrollerRange.start)
|
|
62
68
|
seqCol.setTag(bioTAGS.positionShift, (scrollerRange.start - 1).toString());
|
|
63
|
-
if (
|
|
69
|
+
if (cur !== scrollerCur) {
|
|
64
70
|
seqCol.setTag(bioTAGS.selectedPosition, (scrollerCur).toString());
|
|
65
|
-
if (!positionStatsViewerAddedOnce && grid.tableView) {
|
|
71
|
+
if (scrollerCur >= 0 && !positionStatsViewerAddedOnce && grid.tableView) {
|
|
66
72
|
positionStatsViewerAddedOnce = true;
|
|
67
73
|
const v = grid.tableView.addViewer('Sequence Position Statistics', {sequenceColumnName: seqCol.name});
|
|
68
74
|
grid.tableView.dockManager.dock(v, DG.DOCK_TYPE.DOWN, null, 'Sequence Position Statistics', 0.4);
|
|
@@ -78,8 +84,10 @@ export function handleSequenceHeaderRendering() {
|
|
|
78
84
|
if (!cell || !cell.isColHeader || cell?.gridColumn?.name !== gCol?.name)
|
|
79
85
|
return;
|
|
80
86
|
const cellBounds = e.bounds;
|
|
81
|
-
if (!cellBounds || cellBounds.height <= 50)
|
|
87
|
+
if (!cellBounds || cellBounds.height <= 50) {
|
|
88
|
+
scroller.headerHeight = 0;
|
|
82
89
|
return;
|
|
90
|
+
}
|
|
83
91
|
|
|
84
92
|
const headerTitleSpace = 20;
|
|
85
93
|
const availableTitleSpace = cellBounds.height - defaultHeaderHeight;
|
|
@@ -114,11 +122,10 @@ export function handleSequenceHeaderRendering() {
|
|
|
114
122
|
|
|
115
123
|
const titleShift = Math.max(0, availableTitleSpace ?? 0) > headerTitleSpace ? headerTitleSpace : 0;
|
|
116
124
|
const font = getFontSize();
|
|
117
|
-
scroller.positionWidth = font + 8;
|
|
125
|
+
scroller.positionWidth = font + (isMSA ? 8 : 0);
|
|
118
126
|
const start = getStart();
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
scroller.draw(cellBounds.x, cellBounds.y + titleShift, cellBounds.width, cellBounds.height - titleShift, getCurrent(), start, e);
|
|
127
|
+
const startPadding = isMSA ? 0 : 4;
|
|
128
|
+
scroller.draw(cellBounds.x + startPadding, cellBounds.y + titleShift, cellBounds.width - startPadding, cellBounds.height - titleShift, getCurrent(), start, e);
|
|
122
129
|
}));
|
|
123
130
|
}
|
|
124
131
|
}, 1000);
|