@datagrok/peptides 1.7.2 → 1.8.0
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/README.md +3 -3
- package/dist/563.js +2 -0
- package/dist/611.js +2 -0
- package/dist/802.js +2 -0
- package/dist/96.js +2 -0
- package/dist/package-test.js +2 -29778
- package/dist/package.js +2 -28285
- package/files/icons/logo-summary-viewer.svg +13 -0
- package/files/icons/peptide-sar-vertical-viewer.svg +13 -0
- package/files/icons/peptide-sar-viewer.svg +19 -0
- package/files/icons/peptide-space-viewer.svg +40 -0
- package/package.json +5 -6
- package/src/model.ts +262 -196
- package/src/package.ts +44 -29
- package/src/tests/peptide-space-test.ts +1 -2
- package/src/tests/viewers.ts +0 -2
- package/src/utils/cell-renderer.ts +1 -1
- package/src/utils/distance-matrix.worker.ts +16 -0
- package/src/utils/peptide-similarity-space.ts +0 -1
- package/src/utils/statistics.ts +9 -0
- package/src/utils/types.ts +5 -1
- package/src/utils/worker-creator.ts +11 -0
- package/src/viewers/logo-summary.ts +232 -133
- package/src/viewers/peptide-space-viewer.ts +6 -6
- package/src/viewers/sar-viewer.ts +3 -3
- package/src/widgets/distribution.ts +14 -17
- package/src/widgets/peptides.ts +4 -1
- package/src/widgets/settings.ts +30 -4
- package/dist/vendors-node_modules_datagrok-libraries_ml_src_workers_dimensionality-reducer_js.js +0 -9077
package/src/widgets/settings.ts
CHANGED
|
@@ -3,21 +3,46 @@ import * as DG from 'datagrok-api/dg';
|
|
|
3
3
|
|
|
4
4
|
import * as type from '../utils/types';
|
|
5
5
|
import * as C from '../utils/constants';
|
|
6
|
-
import {PeptidesModel} from '../model';
|
|
6
|
+
import {PeptidesModel, VIEWER_TYPE} from '../model';
|
|
7
7
|
|
|
8
8
|
import $ from 'cash-dom';
|
|
9
|
+
import wu from 'wu';
|
|
9
10
|
|
|
10
11
|
//TODO: show sliderInput values
|
|
11
12
|
export function getSettingsDialog(model: PeptidesModel): DG.Dialog {
|
|
12
13
|
const accordion = ui.accordion();
|
|
13
14
|
const settings = model.settings;
|
|
14
15
|
const result: type.PeptidesSettings = {columns: {}};
|
|
16
|
+
|
|
17
|
+
// General pane options
|
|
15
18
|
const activityScaling = ui.choiceInput('Activity scaling', settings.scaling ?? 'none', ['none', 'lg', '-lg'],
|
|
16
19
|
() => result.scaling = activityScaling.value! as type.ScalingMethods);
|
|
17
20
|
const bidirectionalAnalysis = ui.boolInput('Bidirectional analysis', settings.isBidirectional ?? false,
|
|
18
21
|
() => result.isBidirectional = bidirectionalAnalysis.value!);
|
|
22
|
+
|
|
19
23
|
accordion.addPane('General', () => ui.inputs([activityScaling, bidirectionalAnalysis]), true);
|
|
20
24
|
|
|
25
|
+
// Viewers pane options
|
|
26
|
+
/* FIXME: combinations of adding and deleting viewers are not working properly
|
|
27
|
+
const isMPEnabled = wu(model.analysisView.viewers).some((v) => v.type === VIEWER_TYPE.MONOMER_POSITION);
|
|
28
|
+
const monomerPosition = ui.boolInput(VIEWER_TYPE.MONOMER_POSITION, isMPEnabled ?? false,
|
|
29
|
+
() => result.showMostPotentResidues = monomerPosition.value!);
|
|
30
|
+
const isMPREnabled = wu(model.analysisView.viewers).some((v) => v.type === VIEWER_TYPE.MOST_POTENT_RESIDUES);
|
|
31
|
+
const mostPotentResidues = ui.boolInput(VIEWER_TYPE.MOST_POTENT_RESIDUES, isMPREnabled ?? false,
|
|
32
|
+
() => result.showMonomerPosition = mostPotentResidues.value!);
|
|
33
|
+
const isLSTEnabled = wu(model.analysisView.viewers).some((v) => v.type === VIEWER_TYPE.LOGO_SUMMARY_TABLE);
|
|
34
|
+
const logoSummaryTable = ui.boolInput(VIEWER_TYPE.LOGO_SUMMARY_TABLE, isLSTEnabled ?? false,
|
|
35
|
+
() => result.showLogoSummaryTable = logoSummaryTable.value!);
|
|
36
|
+
logoSummaryTable.enabled = typeof settings.clustersColumnName !== 'undefined';
|
|
37
|
+
*/
|
|
38
|
+
const isDendrogramEnabled = wu(model.analysisView.viewers).some((v) => v.type === VIEWER_TYPE.DENDROGRAM);
|
|
39
|
+
const dendrogram = ui.boolInput(VIEWER_TYPE.DENDROGRAM, isDendrogramEnabled ?? false,
|
|
40
|
+
() => result.showDendrogram = dendrogram.value!);
|
|
41
|
+
|
|
42
|
+
accordion.addPane('Viewers',
|
|
43
|
+
() => ui.inputs([dendrogram]), true);
|
|
44
|
+
|
|
45
|
+
// Mutation Cliffs pane options
|
|
21
46
|
const maxMutations = ui.sliderInput('Max mutations', settings.maxMutations ?? 1, 0, 50, () => {
|
|
22
47
|
const val = Math.round(maxMutations.value!);
|
|
23
48
|
$(maxMutations.root).find('label.ui-input-description').remove();
|
|
@@ -34,6 +59,7 @@ export function getSettingsDialog(model: PeptidesModel): DG.Dialog {
|
|
|
34
59
|
minActivityDelta.addPostfix((settings.minActivityDelta ?? 0).toString());
|
|
35
60
|
accordion.addPane('Mutation Cliffs', () => ui.inputs([maxMutations, minActivityDelta]), true);
|
|
36
61
|
|
|
62
|
+
// Columns to include pane options
|
|
37
63
|
const inputsRows: HTMLElement[] = [];
|
|
38
64
|
for (const col of model.df.columns.numerical) {
|
|
39
65
|
const colName = col.name;
|
|
@@ -43,17 +69,17 @@ export function getSettingsDialog(model: PeptidesModel): DG.Dialog {
|
|
|
43
69
|
const isIncludedInput = ui.boolInput('', typeof (settings.columns ?? {})[colName] !== 'undefined',
|
|
44
70
|
() => {
|
|
45
71
|
if (isIncludedInput.value)
|
|
46
|
-
result.columns![colName] = aggregationInput.
|
|
72
|
+
result.columns![colName] = aggregationInput.value;
|
|
47
73
|
else
|
|
48
74
|
delete result.columns![colName];
|
|
49
75
|
}) as DG.InputBase<boolean>;
|
|
50
76
|
const aggregationInput = ui.choiceInput('Aggregation', (settings.columns ?? {})[colName] ?? 'avg',
|
|
51
77
|
Object.values(DG.STATS), () => {
|
|
52
78
|
if (isIncludedInput.value)
|
|
53
|
-
result.columns![colName] = aggregationInput.
|
|
79
|
+
result.columns![colName] = aggregationInput.value;
|
|
54
80
|
else
|
|
55
81
|
delete result.columns![col.name];
|
|
56
|
-
}) as DG.InputBase<
|
|
82
|
+
}) as DG.InputBase<DG.AggregationType>;
|
|
57
83
|
$(aggregationInput.root).find('label').css('width', 'auto');
|
|
58
84
|
const inputsRow = ui.inputsRow(col.name, [isIncludedInput, aggregationInput]);
|
|
59
85
|
$(inputsRow).find('div.ui-div').css('display', 'inline-flex');
|