@datagrok/peptides 1.3.2 → 1.3.3
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 +1307 -106
- package/dist/package.js +1310 -109
- package/package.json +2 -2
- package/setup-unlink-clean.cmd +19 -0
- package/setup.cmd +15 -18
- package/src/utils/cell-renderer.ts +3 -4
- package/src/utils/misc.ts +0 -14
- package/src/widgets/manual-alignment.ts +2 -3
- package/src/widgets/peptides.ts +3 -4
- package/{test-Peptides-916a90d7d48b-ea373bf5.html → test-Peptides-916a90d7d48b-44350c85.html} +25 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/peptides",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Volodymyr Dyma",
|
|
6
6
|
"email": "vdyma@datagrok.ai"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/Peptides"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@datagrok-libraries/bio": "^5.
|
|
15
|
+
"@datagrok-libraries/bio": "^5.1.0",
|
|
16
16
|
"@datagrok-libraries/ml": "^2.0.1",
|
|
17
17
|
"@datagrok-libraries/statistics": "^0.1.6",
|
|
18
18
|
"@datagrok-libraries/utils": "^1.10.1",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
set package_dir=%cd%
|
|
2
|
+
|
|
3
|
+
set dirs=^
|
|
4
|
+
\..\..\js-api\ ^
|
|
5
|
+
\..\..\libraries\utils\ ^
|
|
6
|
+
\..\..\libraries\ml\ ^
|
|
7
|
+
\..\..\libraries\bio\ ^
|
|
8
|
+
\
|
|
9
|
+
|
|
10
|
+
call npm uninstall -g ^
|
|
11
|
+
datagrok-api ^
|
|
12
|
+
@datagrok-libraries/utils ^
|
|
13
|
+
@datagrok-libraries/ml ^
|
|
14
|
+
@datagrok-libraries/bio ^
|
|
15
|
+
|
|
16
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q node_modules
|
|
17
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q dist
|
|
18
|
+
|
|
19
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & del "package-lock.json"
|
package/setup.cmd
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
call
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
call npm install
|
|
13
|
-
call npm link
|
|
14
|
-
call npm link
|
|
15
|
-
cd
|
|
16
|
-
call npm install
|
|
17
|
-
call npm link datagrok-api @datagrok-libraries/utils @datagrok-libraries/ml
|
|
18
|
-
webpack
|
|
1
|
+
call setup-unlink-clean.cmd
|
|
2
|
+
|
|
3
|
+
set package_dir=%cd%
|
|
4
|
+
|
|
5
|
+
set dirs=^
|
|
6
|
+
\..\..\js-api\ ^
|
|
7
|
+
\..\..\libraries\utils\ ^
|
|
8
|
+
\..\..\libraries\ml\ ^
|
|
9
|
+
\..\..\libraries\bio\ ^
|
|
10
|
+
\
|
|
11
|
+
|
|
12
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & call npm install
|
|
13
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & call npm link
|
|
14
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run link-all
|
|
15
|
+
for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run build
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {SeqPaletteBase} from '@datagrok-libraries/bio/src/seq-palettes';
|
|
2
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
|
+
import * as bio from '@datagrok-libraries/bio';
|
|
3
3
|
|
|
4
4
|
import * as C from './constants';
|
|
5
|
-
import {getPalleteByType} from './misc';
|
|
6
5
|
import * as types from './types';
|
|
7
6
|
|
|
8
7
|
function renderCellSelection(canvasContext: CanvasRenderingContext2D, bound: DG.Rect): void {
|
|
@@ -104,7 +103,7 @@ export function renderLogoSummaryCell(canvasContext: CanvasRenderingContext2D, c
|
|
|
104
103
|
export function renderBarchart(ctx: CanvasRenderingContext2D, col: DG.Column, monomerColStats: types.MonomerColStats,
|
|
105
104
|
bounds: DG.Rect, max: number): types.BarCoordinates {
|
|
106
105
|
let sum = col.length - (monomerColStats['-']?.count ?? 0);
|
|
107
|
-
const colorPalette =
|
|
106
|
+
const colorPalette = bio.getPaletteByType(col.tags[C.TAGS.ALPHABET]);
|
|
108
107
|
const name = col.name;
|
|
109
108
|
const colNameSize = ctx.measureText(name);
|
|
110
109
|
const margin = 0.2;
|
|
@@ -144,7 +143,7 @@ export function renderBarchart(ctx: CanvasRenderingContext2D, col: DG.Column, mo
|
|
|
144
143
|
ctx.fillStyle = color;
|
|
145
144
|
|
|
146
145
|
if (textSize.width <= subBarHeight) {
|
|
147
|
-
if (color != SeqPaletteBase.undefinedColor)
|
|
146
|
+
if (color != bio.SeqPaletteBase.undefinedColor)
|
|
148
147
|
ctx.fillRect(xStart, yStart, barWidth, subBarHeight);
|
|
149
148
|
else {
|
|
150
149
|
ctx.strokeRect(xStart + 0.5, yStart, barWidth - 1, subBarHeight);
|
package/src/utils/misc.ts
CHANGED
|
@@ -7,20 +7,6 @@ import {NucleotidesPalettes} from '@datagrok-libraries/bio/src/nucleotides';
|
|
|
7
7
|
import {UnknownSeqPalettes} from '@datagrok-libraries/bio/src/unknown';
|
|
8
8
|
import {SeqPalette} from '@datagrok-libraries/bio/src/seq-palettes';
|
|
9
9
|
|
|
10
|
-
export function getPalleteByType(paletteType: string): SeqPalette {
|
|
11
|
-
switch (paletteType) {
|
|
12
|
-
case 'PT':
|
|
13
|
-
return AminoacidsPalettes.GrokGroups;
|
|
14
|
-
case 'NT':
|
|
15
|
-
case 'DNA':
|
|
16
|
-
case 'RNA':
|
|
17
|
-
return NucleotidesPalettes.Chromatogram;
|
|
18
|
-
// other
|
|
19
|
-
default:
|
|
20
|
-
return UnknownSeqPalettes.Color;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
10
|
export function getTypedArrayConstructor(
|
|
25
11
|
maxNum: number): Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor {
|
|
26
12
|
return maxNum < 256 ? Uint8Array :
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as ui from 'datagrok-api/ui';
|
|
2
2
|
import * as grok from 'datagrok-api/grok';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
import {splitAlignedSequences} from '@datagrok-libraries/bio/src/utils/splitter';
|
|
4
|
+
import * as bio from '@datagrok-libraries/bio';
|
|
6
5
|
|
|
7
6
|
import $ from 'cash-dom';
|
|
8
7
|
import '../styles.css';
|
|
@@ -20,7 +19,7 @@ export function manualAlignmentWidget(alignedSequenceCol: DG.Column<string>, cur
|
|
|
20
19
|
const applyChangesBtn = ui.button('Apply', async () => {
|
|
21
20
|
const newSequence = sequenceInput.value;
|
|
22
21
|
const affectedRowIndex = currentDf.currentRowIdx;
|
|
23
|
-
const splitSequence = splitAlignedSequences(DG.Column.fromStrings('splitSequence', [newSequence]));
|
|
22
|
+
const splitSequence = bio.splitAlignedSequences(DG.Column.fromStrings('splitSequence', [newSequence]));
|
|
24
23
|
|
|
25
24
|
alignedSequenceCol.set(affectedRowIndex, newSequence);
|
|
26
25
|
for (const part of splitSequence.columns) {
|
package/src/widgets/peptides.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as grok from 'datagrok-api/grok';
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
import {WebLogo} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
4
|
+
import * as bio from '@datagrok-libraries/bio';
|
|
6
5
|
|
|
7
6
|
import '../styles.css';
|
|
8
7
|
import * as C from '../utils/constants';
|
|
@@ -84,7 +83,7 @@ export async function analyzePeptidesWidget(df: DG.DataFrame, col: DG.Column): P
|
|
|
84
83
|
});
|
|
85
84
|
startBtn.style.alignSelf = 'center';
|
|
86
85
|
|
|
87
|
-
const viewer = await df.plot.fromType('WebLogo') as WebLogo;
|
|
86
|
+
const viewer = await df.plot.fromType('WebLogo') as bio.WebLogo;
|
|
88
87
|
viewer.root.style.setProperty('height', '130px');
|
|
89
88
|
const logoHost = ui.div();
|
|
90
89
|
$(logoHost).empty().append(viewer.root);
|
|
@@ -109,7 +108,7 @@ export async function startAnalysis(activityColumn: DG.Column<number> | null, pe
|
|
|
109
108
|
const f = currentDf.filter;
|
|
110
109
|
//prepare new DF
|
|
111
110
|
const newDf = DG.DataFrame.create(f.trueCount);
|
|
112
|
-
const getIndex = indexes.length !== 0 ? (i: number)
|
|
111
|
+
const getIndex = indexes.length !== 0 ? (i: number): number => indexes[i] : (i: number): number => i;
|
|
113
112
|
let activityCol: DG.Column<number> | null = null;
|
|
114
113
|
for (const col of currentDf.columns.toList()) {
|
|
115
114
|
let virtualCol: DG.Column<any>;
|
package/{test-Peptides-916a90d7d48b-ea373bf5.html → test-Peptides-916a90d7d48b-44350c85.html}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<html><head><meta charset="utf-8"/><title>Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=916a90d7d48b. Commit
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=916a90d7d48b. Commit 44350c85.</title><style type="text/css">html,
|
|
2
2
|
body {
|
|
3
3
|
font-family: Arial, Helvetica, sans-serif;
|
|
4
4
|
font-size: 1rem;
|
|
@@ -229,9 +229,9 @@ header {
|
|
|
229
229
|
font-size: 1rem;
|
|
230
230
|
padding: 0 0.5rem;
|
|
231
231
|
}
|
|
232
|
-
</style></head><body><div id="jesthtml-content"><header><h1 id="title">Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=916a90d7d48b. Commit
|
|
233
|
-
Test result : Failed :
|
|
234
|
-
Test result : Failed :
|
|
232
|
+
</style></head><body><div id="jesthtml-content"><header><h1 id="title">Peptides Test Report. Datagrok version datagrok/datagrok:latest SHA=916a90d7d48b. Commit 44350c85.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-10-14 10:11:35</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">96.64s</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">76.108s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Failed : 610 : Peptides.Core.Start analysis: simple : Unable to get project asset "getMonomerLib"
|
|
233
|
+
Test result : Failed : 372 : Peptides.Core.Start analysis: сomplex : Unable to get project asset "getMonomerLib"
|
|
234
|
+
Test result : Failed : 382 : Peptides.Core.Save and load project : Unable to get project asset "getMonomerLib"
|
|
235
235
|
|
|
236
236
|
at /home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:68:20
|
|
237
237
|
at Generator.next (<anonymous>)
|
|
@@ -250,27 +250,27 @@ Test result : Failed : 431 : Peptides.Core.Save and load project : Unable to get
|
|
|
250
250
|
at Generator.next (<anonymous>)
|
|
251
251
|
at fulfilled (/home/runner/work/public/public/packages/Peptides/src/__jest__/remote.test.ts:31:58)
|
|
252
252
|
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Test result : Success : 0 : Peptides.Peptide space.test_table.is_not_empty : OK
|
|
253
|
-
Test result : Success :
|
|
253
|
+
Test result : Success : 6368 : Peptides.Peptide space.PeptideSimilaritySpaceWidget.is_drawing : OK
|
|
254
254
|
Test result : Success : 2 : Peptides.Peptide space.test_deminsionality_reducer : OK
|
|
255
255
|
Test result : Success : 1 : Peptides.Peptide space.test_peptide_similarity_space_viewer : OK
|
|
256
|
-
Test result : Success :
|
|
257
|
-
Test result : Success :
|
|
258
|
-
Test result : Success :
|
|
259
|
-
Test result : Success :
|
|
260
|
-
Test result : Success :
|
|
261
|
-
Test result : Success :
|
|
262
|
-
Test result : Success :
|
|
263
|
-
Test result : Success :
|
|
264
|
-
Test result : Success :
|
|
265
|
-
Test result : Success :
|
|
266
|
-
Test result : Success :
|
|
267
|
-
Test result : Success :
|
|
268
|
-
Test result : Success :
|
|
269
|
-
Test result : Success :
|
|
270
|
-
Test result : Success :
|
|
271
|
-
Test result : Success :
|
|
272
|
-
Test result : Success :
|
|
273
|
-
Test result : Success :
|
|
274
|
-
Test result : Success :
|
|
275
|
-
Test result : Success :
|
|
256
|
+
Test result : Success : 2945 : Peptides.Peptide space.peptide_space.DimensinalityReducer.UMAP.Levenshtein.is_numeric : OK
|
|
257
|
+
Test result : Success : 3009 : Peptides.Peptide space.peptide_space.DimensinalityReducer.UMAP.Jaro-Winkler.is_numeric : OK
|
|
258
|
+
Test result : Success : 3394 : Peptides.Peptide space.peptide_space.DimensinalityReducer.t-SNE.Levenshtein.is_numeric : OK
|
|
259
|
+
Test result : Success : 3685 : Peptides.Peptide space.peptide_space.DimensinalityReducer.t-SNE.Jaro-Winkler.is_numeric : OK
|
|
260
|
+
Test result : Success : 205 : Peptides.Peptide space.peptide_space.DimensinalityReducer.SPE.Levenshtein.is_numeric : OK
|
|
261
|
+
Test result : Success : 629 : Peptides.Peptide space.peptide_space.DimensinalityReducer.SPE.Jaro-Winkler.is_numeric : OK
|
|
262
|
+
Test result : Success : 174 : Peptides.Peptide space.peptide_space.DimensinalityReducer.pSPE.Levenshtein.is_numeric : OK
|
|
263
|
+
Test result : Success : 731 : Peptides.Peptide space.peptide_space.DimensinalityReducer.pSPE.Jaro-Winkler.is_numeric : OK
|
|
264
|
+
Test result : Success : 7686 : Peptides.Peptide space.peptide_space.DimensinalityReducer.OriginalSPE.Levenshtein.is_numeric : OK
|
|
265
|
+
Test result : Success : 9316 : Peptides.Peptide space.peptide_space.DimensinalityReducer.OriginalSPE.Jaro-Winkler.is_numeric : OK
|
|
266
|
+
Test result : Success : 1837 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.UMAP.Levenshtein.is_proper : OK
|
|
267
|
+
Test result : Success : 2670 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.UMAP.Jaro-Winkler.is_proper : OK
|
|
268
|
+
Test result : Success : 3278 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.t-SNE.Levenshtein.is_proper : OK
|
|
269
|
+
Test result : Success : 4073 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.t-SNE.Jaro-Winkler.is_proper : OK
|
|
270
|
+
Test result : Success : 244 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.SPE.Levenshtein.is_proper : OK
|
|
271
|
+
Test result : Success : 666 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.SPE.Jaro-Winkler.is_proper : OK
|
|
272
|
+
Test result : Success : 578 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.pSPE.Levenshtein.is_proper : OK
|
|
273
|
+
Test result : Success : 612 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.pSPE.Jaro-Winkler.is_proper : OK
|
|
274
|
+
Test result : Success : 9654 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.OriginalSPE.Levenshtein.is_proper : OK
|
|
275
|
+
Test result : Success : 9749 : Peptides.Peptide space.peptide_space.PeptideSimilaritySpaceViewer.OriginalSPE.Jaro-Winkler.is_proper : OK
|
|
276
276
|
</pre></div></div></div></div></body></html>
|