@datagrok/bio 2.10.9 → 2.10.11
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 -4
- 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 +1 -1
- package/src/demo/bio01b-hierarchical-clustering-and-activity-cliffs.ts +2 -0
- package/src/utils/cell-renderer.ts +6 -4
- package/src/viewers/vd-regions-viewer.ts +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.10.
|
|
8
|
+
"version": "2.10.11",
|
|
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",
|
|
@@ -65,6 +65,7 @@ export async function demoBio01bUI() {
|
|
|
65
65
|
delay: 2000,
|
|
66
66
|
})
|
|
67
67
|
.step('Cluster sequences', async () => {
|
|
68
|
+
const progressBar = DG.TaskBarProgressIndicator.create(`Running sequence clustering...`);
|
|
68
69
|
const seqCol: DG.Column<string> = df.getCol('sequence');
|
|
69
70
|
const seqList = seqCol.toList();
|
|
70
71
|
const distance: DistanceMatrix = DistanceMatrix.calc(seqList, (aSeq: string, bSeq: string) => {
|
|
@@ -72,6 +73,7 @@ export async function demoBio01bUI() {
|
|
|
72
73
|
return levDistance / ((aSeq.length + bSeq.length) / 2);
|
|
73
74
|
});
|
|
74
75
|
const treeRoot = await treeHelper.hierarchicalClusteringByDistance(distance, 'ward');
|
|
76
|
+
progressBar.close();
|
|
75
77
|
dendrogramSvc.injectTreeForGrid(view.grid, treeRoot, undefined, 150, undefined);
|
|
76
78
|
|
|
77
79
|
// adjust for visual
|
|
@@ -34,8 +34,8 @@ type TempType = { [tagName: string]: any };
|
|
|
34
34
|
const undefinedColor = 'rgb(100,100,100)';
|
|
35
35
|
const monomerToShortFunction: MonomerToShortFunc = monomerToShort;
|
|
36
36
|
|
|
37
|
-
function getUpdatedWidth(grid: DG.Grid | null, g: CanvasRenderingContext2D, x: number, w: number): number {
|
|
38
|
-
return grid ? Math.min(grid.canvas.width - x, w) : g.canvas.width - x;
|
|
37
|
+
function getUpdatedWidth(grid: DG.Grid | null, g: CanvasRenderingContext2D, x: number, w: number, dpr: number): number {
|
|
38
|
+
return !!grid ? Math.max(Math.min(grid.canvas.width / dpr - x, w)) : Math.max(g.canvas.width / dpr - x, 0);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export function processSequence(subParts: ISeqSplitted): [string[], boolean] {
|
|
@@ -182,11 +182,12 @@ export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer {
|
|
|
182
182
|
|
|
183
183
|
g.save();
|
|
184
184
|
try {
|
|
185
|
+
const dpr = window.devicePixelRatio;
|
|
185
186
|
const grid = gridCell.gridRow !== -1 ? gridCell.grid : null;
|
|
186
187
|
const value: any = gridCell.cell.value;
|
|
187
188
|
const paletteType = tableCol.getTag(bioTAGS.alphabet);
|
|
188
189
|
const minDistanceRenderer = 50;
|
|
189
|
-
w = getUpdatedWidth(grid, g, x, w);
|
|
190
|
+
w = getUpdatedWidth(grid, g, x, w, dpr);
|
|
190
191
|
g.beginPath();
|
|
191
192
|
g.rect(x + this.padding, y + this.padding, w - this.padding - 1, h - this.padding * 2);
|
|
192
193
|
g.clip();
|
|
@@ -263,13 +264,14 @@ export class MacromoleculeDifferenceCellRenderer extends DG.GridCellRenderer {
|
|
|
263
264
|
render(
|
|
264
265
|
g: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, gridCell: DG.GridCell,
|
|
265
266
|
_cellStyle: DG.GridCellStyle): void {
|
|
267
|
+
const dpr = window.devicePixelRatio;
|
|
266
268
|
const grid = gridCell.grid;
|
|
267
269
|
const cell = gridCell.cell;
|
|
268
270
|
const tableCol = gridCell.tableColumn as DG.Column<string>;
|
|
269
271
|
const s: string = cell.value ?? '';
|
|
270
272
|
const separator = tableCol.tags[bioTAGS.separator];
|
|
271
273
|
const units: string = tableCol.tags[DG.TAGS.UNITS];
|
|
272
|
-
w = getUpdatedWidth(grid, g, x, w);
|
|
274
|
+
w = getUpdatedWidth(grid, g, x, w, dpr);
|
|
273
275
|
//TODO: can this be replaced/merged with splitSequence?
|
|
274
276
|
const [s1, s2] = s.split('#');
|
|
275
277
|
const splitter = getSplitter(units, separator);
|
|
@@ -192,7 +192,7 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
192
192
|
case PROPS.positionHeight:
|
|
193
193
|
for (let orderI = 0; orderI < this.logos.length; ++orderI) {
|
|
194
194
|
for (const chain of this.chains)
|
|
195
|
-
this.logos[orderI][chain].setOptions({[wlPROPS.
|
|
195
|
+
this.logos[orderI][chain].setOptions({[wlPROPS.positionHeight]: this.positionHeight});
|
|
196
196
|
}
|
|
197
197
|
this.calcSize();
|
|
198
198
|
break;
|