@datagrok/peptides 1.0.2 → 1.2.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/dist/package-test.js +770 -475
- package/dist/package.js +914 -490
- package/dist/vendors-node_modules_datagrok-libraries_ml_src_workers_dimensionality-reducer_js.js +162 -163
- package/package.json +10 -11
- package/src/__jest__/remote.test.ts +5 -4
- package/src/__jest__/test-node.ts +3 -2
- package/src/model.ts +71 -79
- package/src/package-test.ts +0 -1
- package/src/package.ts +8 -23
- package/src/tests/core.ts +13 -3
- package/src/tests/peptide-space-test.ts +7 -7
- package/src/tests/utils.ts +3 -8
- package/src/utils/cell-renderer.ts +5 -5
- package/src/utils/constants.ts +1 -1
- package/src/utils/invariant-map.ts +163 -0
- package/src/utils/misc.ts +10 -28
- package/src/utils/{filtering-statistics.ts → statistics.ts} +0 -0
- package/src/viewers/sar-viewer.ts +4 -18
- package/src/widgets/analyze-peptides.ts +14 -6
- package/src/widgets/distribution.ts +22 -21
- package/src/widgets/manual-alignment.ts +3 -2
- package/src/widgets/{subst-table.ts → mutation-cliffs.ts} +6 -5
- package/helm/JSDraw/Pistoia.HELM.js +0 -27
- package/logojs-react/index.d.ts +0 -1
- package/src/utils/multiple-sequence-alignment.ts +0 -106
- package/src/utils/multivariate-analysis.ts +0 -76
- package/test-Peptides-4f0c8bae6479-74cbfe68.html +0 -256
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as grok from 'datagrok-api/grok';
|
|
2
|
-
import * as DG from 'datagrok-api/dg';
|
|
3
|
-
|
|
4
|
-
import * as C from './constants';
|
|
5
|
-
|
|
6
|
-
import {AlignedSequenceEncoder} from '@datagrok-libraries/bio/src/sequence-encoder';
|
|
7
|
-
|
|
8
|
-
export async function callMVA(
|
|
9
|
-
currentDf: DG.DataFrame,
|
|
10
|
-
options: {[name: string]: string},
|
|
11
|
-
sequencesCol: DG.Column,
|
|
12
|
-
): Promise<void> {
|
|
13
|
-
const activityCol = await _scaleColumn(currentDf.getCol(options['activityColumnName']), options['scaling']);
|
|
14
|
-
const encDf = _encodeSequences(sequencesCol);
|
|
15
|
-
|
|
16
|
-
//TODO: is it correct? Is it needed?
|
|
17
|
-
_insertColumns(
|
|
18
|
-
currentDf,
|
|
19
|
-
[DG.Column.fromList('double', C.COLUMNS_NAMES.ACTIVITY_SCALED, activityCol.toList())],
|
|
20
|
-
);
|
|
21
|
-
_insertColumns(currentDf, encDf.columns.toList());
|
|
22
|
-
|
|
23
|
-
const res = await grok.functions.call('MultivariateAnalysis', {
|
|
24
|
-
table: currentDf,
|
|
25
|
-
features: encDf.columns.names(),
|
|
26
|
-
prediction: C.COLUMNS_NAMES.ACTIVITY_SCALED,
|
|
27
|
-
components: 10,
|
|
28
|
-
showScores: true,
|
|
29
|
-
showRegresCoefs: true,
|
|
30
|
-
});
|
|
31
|
-
console.log(res);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Encodes a series of sequences into a certain scale.
|
|
36
|
-
*
|
|
37
|
-
* @param {string[]} sequencesCol Column containing the sequences.
|
|
38
|
-
* @return {DG.DataFrame} The data frame with seqences encoded.
|
|
39
|
-
*/
|
|
40
|
-
function _encodeSequences(sequencesCol: DG.Column): DG.DataFrame {
|
|
41
|
-
const nRows = sequencesCol.length;
|
|
42
|
-
const nCols = AlignedSequenceEncoder.clean(sequencesCol.get(0)).length;
|
|
43
|
-
const enc = new AlignedSequenceEncoder('WimleyWhite');
|
|
44
|
-
const positions = new Array(nCols).fill(0).map((_) => new Float32Array(nRows));
|
|
45
|
-
|
|
46
|
-
for (let j = 0; j < nRows; ++j) {
|
|
47
|
-
const s = AlignedSequenceEncoder.clean(sequencesCol.get(j));
|
|
48
|
-
for (let i = 0; i < nCols; ++i)
|
|
49
|
-
positions[i][j] = enc.encodeLettter(s[i]);
|
|
50
|
-
}
|
|
51
|
-
return DG.DataFrame.fromColumns(positions.map(
|
|
52
|
-
(v, i) => DG.Column.fromFloat32Array((i+1).toString(), v),
|
|
53
|
-
));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function _scaleColumn(column: DG.Column, method: string): Promise<DG.Column> {
|
|
57
|
-
if (method == 'none')
|
|
58
|
-
return column;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const formula = (method.startsWith('-') ? '0-' : '')+'Log10(${'+column.name+'})';
|
|
62
|
-
const newCol = await column.applyFormula(formula);
|
|
63
|
-
|
|
64
|
-
if (newCol == null)
|
|
65
|
-
throw new Error('Column formula returned unexpected null.');
|
|
66
|
-
|
|
67
|
-
return newCol;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _insertColumns(targetDf: DG.DataFrame, columns: DG.Column[]): DG.DataFrame {
|
|
71
|
-
for (const col of columns)
|
|
72
|
-
targetDf.columns.add(col);
|
|
73
|
-
|
|
74
|
-
return targetDf;
|
|
75
|
-
}
|
|
76
|
-
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
<html><head><meta charset="utf-8"/><title>Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit 74cbfe68.</title><style type="text/css">html,
|
|
2
|
-
body {
|
|
3
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
4
|
-
font-size: 1rem;
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
color: #333;
|
|
8
|
-
}
|
|
9
|
-
body {
|
|
10
|
-
padding: 2rem 1rem;
|
|
11
|
-
font-size: 0.85rem;
|
|
12
|
-
}
|
|
13
|
-
#jesthtml-content {
|
|
14
|
-
margin: 0 auto;
|
|
15
|
-
max-width: 70rem;
|
|
16
|
-
}
|
|
17
|
-
header {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
#title {
|
|
22
|
-
margin: 0;
|
|
23
|
-
flex-grow: 1;
|
|
24
|
-
}
|
|
25
|
-
#logo {
|
|
26
|
-
height: 4rem;
|
|
27
|
-
}
|
|
28
|
-
#timestamp {
|
|
29
|
-
color: #777;
|
|
30
|
-
margin-top: 0.5rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** SUMMARY */
|
|
34
|
-
#summary {
|
|
35
|
-
color: #333;
|
|
36
|
-
margin: 2rem 0;
|
|
37
|
-
display: flex;
|
|
38
|
-
font-family: monospace;
|
|
39
|
-
font-size: 1rem;
|
|
40
|
-
}
|
|
41
|
-
#summary > div {
|
|
42
|
-
margin-right: 2rem;
|
|
43
|
-
background: #eee;
|
|
44
|
-
padding: 1rem;
|
|
45
|
-
min-width: 15rem;
|
|
46
|
-
}
|
|
47
|
-
#summary > div:last-child {
|
|
48
|
-
margin-right: 0;
|
|
49
|
-
}
|
|
50
|
-
@media only screen and (max-width: 720px) {
|
|
51
|
-
#summary {
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
}
|
|
54
|
-
#summary > div {
|
|
55
|
-
margin-right: 0;
|
|
56
|
-
margin-top: 2rem;
|
|
57
|
-
}
|
|
58
|
-
#summary > div:first-child {
|
|
59
|
-
margin-top: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.summary-total {
|
|
64
|
-
font-weight: bold;
|
|
65
|
-
margin-bottom: 0.5rem;
|
|
66
|
-
}
|
|
67
|
-
.summary-passed {
|
|
68
|
-
color: #4f8a10;
|
|
69
|
-
border-left: 0.4rem solid #4f8a10;
|
|
70
|
-
padding-left: 0.5rem;
|
|
71
|
-
}
|
|
72
|
-
.summary-failed,
|
|
73
|
-
.summary-obsolete-snapshots {
|
|
74
|
-
color: #d8000c;
|
|
75
|
-
border-left: 0.4rem solid #d8000c;
|
|
76
|
-
padding-left: 0.5rem;
|
|
77
|
-
}
|
|
78
|
-
.summary-pending {
|
|
79
|
-
color: #9f6000;
|
|
80
|
-
border-left: 0.4rem solid #9f6000;
|
|
81
|
-
padding-left: 0.5rem;
|
|
82
|
-
}
|
|
83
|
-
.summary-empty {
|
|
84
|
-
color: #999;
|
|
85
|
-
border-left: 0.4rem solid #999;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.test-result {
|
|
89
|
-
padding: 1rem;
|
|
90
|
-
margin-bottom: 0.25rem;
|
|
91
|
-
}
|
|
92
|
-
.test-result:last-child {
|
|
93
|
-
border: 0;
|
|
94
|
-
}
|
|
95
|
-
.test-result.passed {
|
|
96
|
-
background-color: #dff2bf;
|
|
97
|
-
color: #4f8a10;
|
|
98
|
-
}
|
|
99
|
-
.test-result.failed {
|
|
100
|
-
background-color: #ffbaba;
|
|
101
|
-
color: #d8000c;
|
|
102
|
-
}
|
|
103
|
-
.test-result.pending {
|
|
104
|
-
background-color: #ffdf61;
|
|
105
|
-
color: #9f6000;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.test-info {
|
|
109
|
-
display: flex;
|
|
110
|
-
justify-content: space-between;
|
|
111
|
-
}
|
|
112
|
-
.test-suitename {
|
|
113
|
-
width: 20%;
|
|
114
|
-
text-align: left;
|
|
115
|
-
font-weight: bold;
|
|
116
|
-
word-break: break-word;
|
|
117
|
-
}
|
|
118
|
-
.test-title {
|
|
119
|
-
width: 40%;
|
|
120
|
-
text-align: left;
|
|
121
|
-
font-style: italic;
|
|
122
|
-
}
|
|
123
|
-
.test-status {
|
|
124
|
-
width: 20%;
|
|
125
|
-
text-align: right;
|
|
126
|
-
}
|
|
127
|
-
.test-duration {
|
|
128
|
-
width: 10%;
|
|
129
|
-
text-align: right;
|
|
130
|
-
font-size: 0.75rem;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.failureMessages {
|
|
134
|
-
padding: 0 1rem;
|
|
135
|
-
margin-top: 1rem;
|
|
136
|
-
border-top: 1px dashed #d8000c;
|
|
137
|
-
}
|
|
138
|
-
.failureMessages.suiteFailure {
|
|
139
|
-
border-top: none;
|
|
140
|
-
}
|
|
141
|
-
.failureMsg {
|
|
142
|
-
white-space: pre-wrap;
|
|
143
|
-
white-space: -moz-pre-wrap;
|
|
144
|
-
white-space: -pre-wrap;
|
|
145
|
-
white-space: -o-pre-wrap;
|
|
146
|
-
word-wrap: break-word;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.suite-container {
|
|
150
|
-
margin-bottom: 2rem;
|
|
151
|
-
}
|
|
152
|
-
.suite-info {
|
|
153
|
-
padding: 1rem;
|
|
154
|
-
background-color: #eee;
|
|
155
|
-
color: #777;
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
margin-bottom: 0.25rem;
|
|
159
|
-
}
|
|
160
|
-
.suite-info .suite-path {
|
|
161
|
-
word-break: break-all;
|
|
162
|
-
flex-grow: 1;
|
|
163
|
-
font-family: monospace;
|
|
164
|
-
font-size: 1rem;
|
|
165
|
-
}
|
|
166
|
-
.suite-info .suite-time {
|
|
167
|
-
margin-left: 0.5rem;
|
|
168
|
-
padding: 0.2rem 0.3rem;
|
|
169
|
-
font-size: 0.75rem;
|
|
170
|
-
}
|
|
171
|
-
.suite-info .suite-time.warn {
|
|
172
|
-
background-color: #d8000c;
|
|
173
|
-
color: #fff;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* CONSOLE LOGS */
|
|
177
|
-
.suite-consolelog {
|
|
178
|
-
margin-bottom: 0.25rem;
|
|
179
|
-
padding: 1rem;
|
|
180
|
-
background-color: #efefef;
|
|
181
|
-
}
|
|
182
|
-
.suite-consolelog-header {
|
|
183
|
-
font-weight: bold;
|
|
184
|
-
}
|
|
185
|
-
.suite-consolelog-item {
|
|
186
|
-
padding: 0.5rem;
|
|
187
|
-
}
|
|
188
|
-
.suite-consolelog-item pre {
|
|
189
|
-
margin: 0.5rem 0;
|
|
190
|
-
white-space: pre-wrap;
|
|
191
|
-
white-space: -moz-pre-wrap;
|
|
192
|
-
white-space: -pre-wrap;
|
|
193
|
-
white-space: -o-pre-wrap;
|
|
194
|
-
word-wrap: break-word;
|
|
195
|
-
}
|
|
196
|
-
.suite-consolelog-item-origin {
|
|
197
|
-
color: #777;
|
|
198
|
-
font-weight: bold;
|
|
199
|
-
}
|
|
200
|
-
.suite-consolelog-item-message {
|
|
201
|
-
color: #000;
|
|
202
|
-
font-size: 1rem;
|
|
203
|
-
padding: 0 0.5rem;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/* OBSOLETE SNAPSHOTS */
|
|
207
|
-
.suite-obsolete-snapshots {
|
|
208
|
-
margin-bottom: 0.25rem;
|
|
209
|
-
padding: 1rem;
|
|
210
|
-
background-color: #ffbaba;
|
|
211
|
-
color: #d8000c;
|
|
212
|
-
}
|
|
213
|
-
.suite-obsolete-snapshots-header {
|
|
214
|
-
font-weight: bold;
|
|
215
|
-
}
|
|
216
|
-
.suite-obsolete-snapshots-item {
|
|
217
|
-
padding: 0.5rem;
|
|
218
|
-
}
|
|
219
|
-
.suite-obsolete-snapshots-item pre {
|
|
220
|
-
margin: 0.5rem 0;
|
|
221
|
-
white-space: pre-wrap;
|
|
222
|
-
white-space: -moz-pre-wrap;
|
|
223
|
-
white-space: -pre-wrap;
|
|
224
|
-
white-space: -o-pre-wrap;
|
|
225
|
-
word-wrap: break-word;
|
|
226
|
-
}
|
|
227
|
-
.suite-obsolete-snapshots-item-message {
|
|
228
|
-
color: #000;
|
|
229
|
-
font-size: 1rem;
|
|
230
|
-
padding: 0 0.5rem;
|
|
231
|
-
}
|
|
232
|
-
</style></head><body><div id="jesthtml-content"><header><h1 id="title">Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=4f0c8bae6479. Commit 74cbfe68.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-08-04 13:00:12</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts</div><div class="suite-time warn">122.36s</div></div><div class="suite-tests"><div class="test-result failed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">failed</div><div class="test-duration">100.002s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: thrown: "Exceeded timeout of 100000 ms for a test.
|
|
233
|
-
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
|
|
234
|
-
at Object.<anonymous> (/home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:38:1)
|
|
235
|
-
at Runtime._execModule (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runtime/build/index.js:1646:24)
|
|
236
|
-
at Runtime._loadModule (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runtime/build/index.js:1185:12)
|
|
237
|
-
at Runtime.requireModule (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runtime/build/index.js:1009:12)
|
|
238
|
-
at jestAdapter (/home/runner/work/public/public/packages/Peptides/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:13)
|
|
239
|
-
at runTestInternal (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runner/build/runTest.js:389:16)
|
|
240
|
-
at runTest (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runner/build/runTest.js:475:34)
|
|
241
|
-
at TestRunner.runTests (/home/runner/work/public/public/packages/Peptides/node_modules/jest-runner/build/index.js:101:12)
|
|
242
|
-
at TestScheduler.scheduleTests (/home/runner/work/public/public/packages/Peptides/node_modules/@jest/core/build/TestScheduler.js:333:13)
|
|
243
|
-
at runJest (/home/runner/work/public/public/packages/Peptides/node_modules/@jest/core/build/runJest.js:404:19)
|
|
244
|
-
at _run10000 (/home/runner/work/public/public/packages/Peptides/node_modules/@jest/core/build/cli/index.js:320:7)
|
|
245
|
-
at runCLI (/home/runner/work/public/public/packages/Peptides/node_modules/@jest/core/build/cli/index.js:173:3)
|
|
246
|
-
at Object.run (/home/runner/work/public/public/packages/Peptides/node_modules/jest-cli/build/cli/index.js:155:37)</pre></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.<anonymous> (/home/runner/work/public/public/packages/Peptides/src/__jest__/test-node.ts:62:11)
|
|
247
|
-
at Generator.next (<anonymous>)
|
|
248
|
-
at fulfilled (/home/runner/work/public/public/packages/Peptides/src/__jest__/test-node.ts:28:58)
|
|
249
|
-
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:40:11
|
|
250
|
-
at Generator.next (<anonymous>)
|
|
251
|
-
at /home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:34:71
|
|
252
|
-
at new Promise (<anonymous>)
|
|
253
|
-
at Object.<anonymous>.__awaiter (/home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:30:12)
|
|
254
|
-
at Object.<anonymous> (/home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:38:23)
|
|
255
|
-
at Promise.then.completed (/home/runner/work/public/public/packages/Peptides/node_modules/jest-circus/build/utils.js:391:28)
|
|
256
|
-
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing Peptides package</pre></div></div></div></div></body></html>
|