@datagrok/peptides 1.17.26 → 1.17.27
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 +6 -0
- 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/viewers/sar-viewer.ts +1 -1
- package/src/widgets/selection.ts +24 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/peptides",
|
|
3
3
|
"friendlyName": "Peptides",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.27",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Davit Rizhinashvili",
|
|
7
7
|
"email": "drizhinashvili@datagrok.ai"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@datagrok-libraries/bio": "^5.40.0",
|
|
17
17
|
"@datagrok-libraries/math": "1.1.12",
|
|
18
|
-
"@datagrok-libraries/ml": "^6.6.
|
|
18
|
+
"@datagrok-libraries/ml": "^6.6.17",
|
|
19
19
|
"@datagrok-libraries/statistics": "^1.2.12",
|
|
20
20
|
"@datagrok-libraries/tutorials": "^1.3.13",
|
|
21
21
|
"@datagrok-libraries/utils": "^4.2.20",
|
package/src/widgets/selection.ts
CHANGED
|
@@ -30,6 +30,7 @@ export function getSelectionWidget(table: DG.DataFrame, options: SelectionWidget
|
|
|
30
30
|
newTable.name = 'Selected compounds';
|
|
31
31
|
newTable.filter.copyFrom(options.tableSelection);
|
|
32
32
|
const numericalCols = wu(table.columns.numerical);
|
|
33
|
+
let gridSortOrder: {cols: DG.Column[], types: boolean[]} | null = null;
|
|
33
34
|
for (let gridColIdx = 1; gridColIdx < options.gridColumns.length; gridColIdx++) {
|
|
34
35
|
const gridCol = options.gridColumns.byIndex(gridColIdx)!;
|
|
35
36
|
if (!gridCol.visible)
|
|
@@ -40,15 +41,29 @@ export function getSelectionWidget(table: DG.DataFrame, options: SelectionWidget
|
|
|
40
41
|
if (sourceCol.type === DG.COLUMN_TYPE.BOOL)
|
|
41
42
|
continue;
|
|
42
43
|
|
|
44
|
+
// restore sorting
|
|
45
|
+
if (gridSortOrder === null && gridCol.grid && gridCol.grid.sortByColumns?.length > 0 &&
|
|
46
|
+
gridCol.grid.sortTypes?.length === gridCol.grid.sortByColumns.length)
|
|
47
|
+
gridSortOrder = {cols: gridCol.grid.sortByColumns, types: gridCol.grid.sortTypes};
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
|
|
50
|
+
// bigint or qnum columns can throw an error when getting raw data (might be fixed in future versions)
|
|
51
|
+
let sourceColRawData: ArrayLike<number> | null = null;
|
|
52
|
+
let sourceColCategories: string[] | null = null;
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
sourceColRawData = sourceCol.getRawData();
|
|
56
|
+
sourceColCategories = sourceCol.categories;
|
|
57
|
+
} catch (_e) {
|
|
58
|
+
}
|
|
59
|
+
const getValue = !sourceColRawData || !sourceColCategories ?
|
|
60
|
+
(i: number): any => sourceCol.get(i) :
|
|
61
|
+
numericalCols
|
|
62
|
+
.some((col) => col.name === sourceCol.name) ? (i: number): number => sourceColRawData[i] :
|
|
63
|
+
(i: number): string => sourceColCategories[sourceColRawData[i]];
|
|
49
64
|
const col = sourceCol.name === options.activityColumn.name ?
|
|
50
|
-
newTable.columns.addNewFloat(gridCol.name).init((i) => getValue(i)) :
|
|
51
|
-
newTable.columns.addNewVirtual(gridCol.name, (i) => getValue(i), sourceCol.type as DG.TYPE);
|
|
65
|
+
newTable.columns.addNewFloat(gridCol.name).init((i) => getValue(i) as number) :
|
|
66
|
+
newTable.columns.addNewVirtual(gridCol.name, (i) => getValue(i) as unknown, sourceCol.type as DG.TYPE);
|
|
52
67
|
for (const [tag, value] of sourceCol.tags)
|
|
53
68
|
col.setTag(tag, value);
|
|
54
69
|
}
|
|
@@ -72,6 +87,8 @@ export function getSelectionWidget(table: DG.DataFrame, options: SelectionWidget
|
|
|
72
87
|
const gridHost = ui.box(grid.root);
|
|
73
88
|
gridHost.style.marginLeft = '0px';
|
|
74
89
|
setTimeout(() => {
|
|
90
|
+
if (gridSortOrder !== null)
|
|
91
|
+
grid.sort(gridSortOrder.cols, gridSortOrder.types);
|
|
75
92
|
for (let gridColIdx = 1; gridColIdx < options.gridColumns.length; gridColIdx++) {
|
|
76
93
|
const originalGridCol = options.gridColumns.byIndex(gridColIdx)!;
|
|
77
94
|
if (!originalGridCol.visible)
|