@datagrok/bio 2.11.15 → 2.11.18
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/detectors.js +50 -15
- package/dist/796.js +1 -1
- package/dist/796.js.map +1 -1
- 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 +13 -6
- package/src/analysis/sequence-activity-cliffs.ts +3 -3
- package/src/demo/bio01a-hierarchical-clustering-and-sequence-space.ts +4 -5
- package/src/package-types.ts +4 -5
- package/src/package.ts +16 -13
- package/src/utils/get-region-func-editor.ts +3 -3
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.11.
|
|
8
|
+
"version": "2.11.18",
|
|
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",
|
|
@@ -30,15 +30,22 @@
|
|
|
30
30
|
"propertyType": "string",
|
|
31
31
|
"defaultValue": ".",
|
|
32
32
|
"nullable": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "Debug",
|
|
36
|
+
"propertyType": "string_list",
|
|
37
|
+
"choices": ["detectors", "WebLogo"],
|
|
38
|
+
"defaultValue": [],
|
|
39
|
+
"nullable": false
|
|
33
40
|
}
|
|
34
41
|
],
|
|
35
42
|
"dependencies": {
|
|
36
43
|
"@biowasm/aioli": "^3.1.0",
|
|
37
|
-
"@datagrok-libraries/bio": "^5.39.
|
|
44
|
+
"@datagrok-libraries/bio": "^5.39.13",
|
|
38
45
|
"@datagrok-libraries/chem-meta": "^1.2.1",
|
|
39
|
-
"@datagrok-libraries/ml": "^6.3.
|
|
46
|
+
"@datagrok-libraries/ml": "^6.3.67",
|
|
40
47
|
"@datagrok-libraries/tutorials": "^1.3.11",
|
|
41
|
-
"@datagrok-libraries/utils": "^4.1.
|
|
48
|
+
"@datagrok-libraries/utils": "^4.1.36",
|
|
42
49
|
"cash-dom": "^8.0.0",
|
|
43
50
|
"css-loader": "^6.7.3",
|
|
44
51
|
"datagrok-api": "^1.16.0",
|
|
@@ -64,9 +71,9 @@
|
|
|
64
71
|
"webpack": "^5.76.3",
|
|
65
72
|
"webpack-bundle-analyzer": "latest",
|
|
66
73
|
"webpack-cli": "^4.9.1",
|
|
67
|
-
"@datagrok/chem": "^1.8.
|
|
74
|
+
"@datagrok/chem": "^1.8.8",
|
|
68
75
|
"@datagrok/helm": "^2.1.22",
|
|
69
|
-
"@datagrok/dendrogram": "^1.2.
|
|
76
|
+
"@datagrok/dendrogram": "^1.2.22"
|
|
70
77
|
},
|
|
71
78
|
"scripts": {
|
|
72
79
|
"link-api": "npm link datagrok-api",
|
|
@@ -60,7 +60,7 @@ export async function getChemSimilaritiesMatrix(dim: number, seqCol: DG.Column,
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export function createTooltipElement(params: ITooltipAndPanelParams): HTMLDivElement {
|
|
63
|
-
const tooltipElement = ui.divH([]);
|
|
63
|
+
const tooltipElement = ui.divH([], {style: {gap: '10px'}});
|
|
64
64
|
const columnNames = ui.divV([
|
|
65
65
|
ui.divText(params.seqCol.name),
|
|
66
66
|
ui.divText(params.activityCol.name),
|
|
@@ -69,7 +69,7 @@ export function createTooltipElement(params: ITooltipAndPanelParams): HTMLDivEle
|
|
|
69
69
|
columnNames.style.display = 'flex';
|
|
70
70
|
columnNames.style.justifyContent = 'space-between';
|
|
71
71
|
tooltipElement.append(columnNames);
|
|
72
|
-
params.
|
|
72
|
+
params.points.forEach((molIdx: number) => {
|
|
73
73
|
const activity = ui.divText(params.activityCol.get(molIdx).toFixed(2));
|
|
74
74
|
activity.style.display = 'flex';
|
|
75
75
|
activity.style.justifyContent = 'left';
|
|
@@ -99,7 +99,7 @@ export function createPropPanelElement(params: ITooltipAndPanelParams): HTMLDivE
|
|
|
99
99
|
|
|
100
100
|
const sequencesArray = new Array<string>(2);
|
|
101
101
|
const activitiesArray = new Array<number>(2);
|
|
102
|
-
params.
|
|
102
|
+
params.points.forEach((molIdx, idx) => {
|
|
103
103
|
sequencesArray[idx] = params.seqCol.get(molIdx);
|
|
104
104
|
activitiesArray[idx] = params.activityCol.get(molIdx);
|
|
105
105
|
});
|
|
@@ -22,6 +22,7 @@ export async function demoBio01aUI() {
|
|
|
22
22
|
let _spViewer: DG.ScatterPlotViewer;
|
|
23
23
|
|
|
24
24
|
const dimRedMethod: string = 'UMAP';
|
|
25
|
+
const activityColName = 'activity';
|
|
25
26
|
|
|
26
27
|
try {
|
|
27
28
|
const demoScript = new DemoScript(
|
|
@@ -48,6 +49,7 @@ export async function demoBio01aUI() {
|
|
|
48
49
|
})
|
|
49
50
|
.step('Build sequence space', async () => {
|
|
50
51
|
_spViewer = await demoSequenceSpace(view, df, seqColName, dimRedMethod);
|
|
52
|
+
_spViewer.setOptions({color: activityColName});
|
|
51
53
|
}, {
|
|
52
54
|
description: `Reduce sequence space dimensionality to display on 2D representation.`,
|
|
53
55
|
delay: 2000,
|
|
@@ -66,16 +68,13 @@ export async function demoBio01aUI() {
|
|
|
66
68
|
delay: 2000,
|
|
67
69
|
})
|
|
68
70
|
.step('Select a sequence', async () => {
|
|
69
|
-
df.selection.
|
|
71
|
+
df.selection.set(65, true);
|
|
70
72
|
}, {
|
|
71
73
|
description: `Handling selection of data frame row reflecting on linked viewers.`,
|
|
72
74
|
delay: 2000,
|
|
73
75
|
})
|
|
74
76
|
.step('Select a bunch of sequences', async () => {
|
|
75
|
-
|
|
76
|
-
df.selection.init((rowI: number) => {
|
|
77
|
-
return ['c0_seq120', 'c0_seq105', 'c0_seq121', 'c0_seq93'].includes(seqIdCol.get(rowI)!);
|
|
78
|
-
});
|
|
77
|
+
[67, 72, 77, 82, 83, 84, 85, 91, 93].forEach((idx) => df.selection.set(idx, true));
|
|
79
78
|
df.currentRowIdx = 27;
|
|
80
79
|
}, {
|
|
81
80
|
// eslint-disable-next-line max-len
|
package/src/package-types.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as DG from 'datagrok-api/dg';
|
|
|
3
3
|
import * as ui from 'datagrok-api/ui';
|
|
4
4
|
|
|
5
5
|
import {Observable, Subject} from 'rxjs';
|
|
6
|
-
import {
|
|
6
|
+
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
7
7
|
|
|
8
8
|
/** Names of package properties/settings declared in properties section of {@link './package.json'} */
|
|
9
9
|
export const enum BioPackagePropertiesNames {
|
|
@@ -60,13 +60,12 @@ export class BioPackage extends DG.Package {
|
|
|
60
60
|
|
|
61
61
|
private _initialized: boolean = false;
|
|
62
62
|
|
|
63
|
-
public get initialized(): boolean { return this._initialized;}
|
|
63
|
+
public get initialized(): boolean { return this._initialized; }
|
|
64
64
|
|
|
65
|
-
public completeInit(): void { this._initialized = true;}
|
|
65
|
+
public completeInit(): void { this._initialized = true; }
|
|
66
66
|
|
|
67
67
|
handleErrorUI(err: any) {
|
|
68
|
-
const errMsg = err
|
|
69
|
-
const errStack = err instanceof Error ? err.stack : undefined;
|
|
68
|
+
const [errMsg, errStack] = errInfo(err);
|
|
70
69
|
grok.shell.error(errMsg);
|
|
71
70
|
this.logger.error(errMsg, undefined, errStack);
|
|
72
71
|
}
|
package/src/package.ts
CHANGED
|
@@ -68,7 +68,7 @@ import {SplitToMonomersFunctionEditor} from './function-edtiors/split-to-monomer
|
|
|
68
68
|
import {splitToMonomersUI} from './utils/split-to-monomers';
|
|
69
69
|
import {MonomerCellRenderer} from './utils/monomer-cell-renderer';
|
|
70
70
|
import {BioPackage, BioPackageProperties} from './package-types';
|
|
71
|
-
import {PackageSettingsEditorWidget} from './widgets/package-settings-editor-widget';
|
|
71
|
+
// import {PackageSettingsEditorWidget} from './widgets/package-settings-editor-widget';
|
|
72
72
|
import {getCompositionAnalysisWidget} from './widgets/composition-analysis-widget';
|
|
73
73
|
import {MacromoleculeColumnWidget} from './utils/macromolecule-column-widget';
|
|
74
74
|
import {addCopyMenuUI} from './utils/context-menu';
|
|
@@ -268,16 +268,16 @@ export function SeqActivityCliffsEditor(call: DG.FuncCall) {
|
|
|
268
268
|
|
|
269
269
|
// -- Package settings editor --
|
|
270
270
|
|
|
271
|
-
//name: packageSettingsEditor
|
|
272
|
-
//description: The database connection
|
|
273
|
-
//tags: packageSettingsEditor
|
|
274
|
-
//input: object propList
|
|
275
|
-
//output: widget result
|
|
276
|
-
export function packageSettingsEditor(propList: DG.Property[]): DG.Widget {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
271
|
+
// //name: packageSettingsEditor
|
|
272
|
+
// //description: The database connection
|
|
273
|
+
// //tags: packageSettingsEditor
|
|
274
|
+
// //input: object propList
|
|
275
|
+
// //output: widget result
|
|
276
|
+
// export function packageSettingsEditor(propList: DG.Property[]): DG.Widget {
|
|
277
|
+
// const widget = new PackageSettingsEditorWidget(propList);
|
|
278
|
+
// widget.init().then(); // Ignore promise returned
|
|
279
|
+
// return widget as DG.Widget;
|
|
280
|
+
// }
|
|
281
281
|
|
|
282
282
|
// -- Cell renderers --
|
|
283
283
|
|
|
@@ -498,11 +498,14 @@ export async function activityCliffs(df: DG.DataFrame, macroMolecule: DG.Column<
|
|
|
498
498
|
//meta.supportedDistanceFunctions: Hamming,Levenshtein,Monomer chemical distance,Needlemann-Wunsch
|
|
499
499
|
//input: column col {semType: Macromolecule}
|
|
500
500
|
//input: string metric
|
|
501
|
+
//input: double gapOpen = 1 {caption: Gap open penalty; default: 1; optional: true}
|
|
502
|
+
//input: double gapExtend = 0.6 {caption: Gap extension penalty; default: 0.6; optional: true}
|
|
501
503
|
//output: object result
|
|
502
504
|
export async function macromoleculePreprocessingFunction(
|
|
503
|
-
col: DG.Column, metric: MmDistanceFunctionsNames
|
|
505
|
+
col: DG.Column, metric: MmDistanceFunctionsNames, gapOpen: number = 1, gapExtend: number = 0.6
|
|
506
|
+
): Promise<PreprocessFunctionReturnType> {
|
|
504
507
|
const {seqList, options} = await getEncodedSeqSpaceCol(col, metric);
|
|
505
|
-
return {entries: seqList, options};
|
|
508
|
+
return {entries: seqList, options: {...options, gapOpen, gapExtend}};
|
|
506
509
|
}
|
|
507
510
|
|
|
508
511
|
//name: Helm Fingerprints
|
|
@@ -235,7 +235,7 @@ export class GetRegionFuncEditor {
|
|
|
235
235
|
const inputsForm = ui.inputs(Object.values(this.inputs), {style: {minWidth: '320px'}});
|
|
236
236
|
ui.dialog({title: 'Get Region'})
|
|
237
237
|
.add(inputsForm)
|
|
238
|
-
.onOK(
|
|
238
|
+
.onOK(() => {
|
|
239
239
|
(async () => {
|
|
240
240
|
const callParams = this.getParams();
|
|
241
241
|
await this.call.func.prepare(callParams).call(true);
|
|
@@ -247,8 +247,8 @@ export class GetRegionFuncEditor {
|
|
|
247
247
|
|
|
248
248
|
public widget(): DG.Widget {
|
|
249
249
|
const inputsForm = ui.inputs(Object.entries(this.inputs)
|
|
250
|
-
.filter(([inputName,
|
|
251
|
-
.map(([
|
|
250
|
+
.filter(([inputName, _input]) => !['table', 'sequence'].includes(inputName))
|
|
251
|
+
.map(([_inputName, input]) => input));
|
|
252
252
|
const doBtn = ui.button('Get Region', () => {
|
|
253
253
|
(async () => {
|
|
254
254
|
const callParams = this.getParams();
|