@datagrok/peptides 1.27.9 → 1.27.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 +7 -0
- package/CLAUDE.md +1 -0
- package/dist/216.js +1 -1
- package/dist/216.js.map +1 -1
- package/dist/682.js +1 -1
- package/dist/682.js.map +1 -1
- package/dist/705.js +1 -1
- package/dist/705.js.map +1 -1
- package/dist/774.js +1 -1
- package/dist/774.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 +11 -10
- package/src/package-api.ts +7 -0
- package/src/package.g.ts +10 -0
- package/src/package.ts +13 -0
- package/src/tests/viewers.ts +56 -0
- package/src/viewers/peptide-generation-viewer.ts +745 -0
- package/test-console-output-1.log +156 -117
- package/test-record-1.mp4 +0 -0
- package/tsconfig.json +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/peptides",
|
|
3
3
|
"friendlyName": "Peptides",
|
|
4
|
-
"version": "1.27.
|
|
4
|
+
"version": "1.27.11",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Davit Rizhinashvili",
|
|
7
7
|
"email": "drizhinashvili@datagrok.ai"
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
"directory": "packages/Peptides"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@datagrok-libraries/bio": "^
|
|
16
|
+
"@datagrok-libraries/bio": "^6.0.2",
|
|
17
17
|
"@datagrok-libraries/math": "^1.2.6",
|
|
18
|
-
"@datagrok-libraries/ml": "^6.10.
|
|
18
|
+
"@datagrok-libraries/ml": "^6.10.15",
|
|
19
19
|
"@datagrok-libraries/statistics": "^1.2.12",
|
|
20
|
+
"@datagrok-libraries/test": "^1.3.1",
|
|
20
21
|
"@datagrok-libraries/tutorials": "^1.7.4",
|
|
21
22
|
"@datagrok-libraries/utils": "^4.6.9",
|
|
22
23
|
"@webgpu/types": "^0.1.40",
|
|
@@ -24,18 +25,16 @@
|
|
|
24
25
|
"datagrok-api": "^1.26.0",
|
|
25
26
|
"file-loader": "^6.2.0",
|
|
26
27
|
"rxjs": "^6.5.5",
|
|
27
|
-
"uuid": "^
|
|
28
|
-
"wu": "^2.1.0"
|
|
29
|
-
"@datagrok-libraries/test": "^1.1.0"
|
|
28
|
+
"uuid": "^11.1.1",
|
|
29
|
+
"wu": "^2.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@datagrok-libraries/helm-web-editor": "^1.1.16",
|
|
33
|
-
"@datagrok-libraries/js-draw-lite": "^0.0.5",
|
|
34
32
|
"@datagrok/bio": "^2.26.4",
|
|
35
33
|
"@datagrok/chem": "^1.17.1",
|
|
36
34
|
"@datagrok/dendrogram": "^1.2.33",
|
|
37
35
|
"@datagrok/eda": "^1.3.1",
|
|
38
36
|
"@datagrok/helm": "^2.13.0",
|
|
37
|
+
"@playwright/test": "^1.48.0",
|
|
39
38
|
"@types/uuid": "^10.0.0",
|
|
40
39
|
"@types/wu": "^2.1.44",
|
|
41
40
|
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
@@ -83,6 +82,8 @@
|
|
|
83
82
|
],
|
|
84
83
|
"category": "Bioinformatics",
|
|
85
84
|
"overrides": {
|
|
86
|
-
"datagrok-api": "$datagrok-api"
|
|
87
|
-
|
|
85
|
+
"datagrok-api": "$datagrok-api",
|
|
86
|
+
"uuid": "^11.1.1"
|
|
87
|
+
},
|
|
88
|
+
"playwrightTests": "playwright"
|
|
88
89
|
}
|
package/src/package-api.ts
CHANGED
|
@@ -67,6 +67,13 @@ export namespace funcs {
|
|
|
67
67
|
return await grok.functions.call('Peptides:ClusterMaxActivity', {});
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
Generates new candidate peptides from monomer-position statistics, ranked by predicted activity
|
|
72
|
+
*/
|
|
73
|
+
export async function peptideGeneration(): Promise<any> {
|
|
74
|
+
return await grok.functions.call('Peptides:PeptideGeneration', {});
|
|
75
|
+
}
|
|
76
|
+
|
|
70
77
|
export async function manualAlignment(_monomer: string ): Promise<any> {
|
|
71
78
|
return await grok.functions.call('Peptides:ManualAlignment', { _monomer });
|
|
72
79
|
}
|
package/src/package.g.ts
CHANGED
|
@@ -88,6 +88,16 @@ export function clusterMaxActivity() : any {
|
|
|
88
88
|
return PackageFunctions.clusterMaxActivity();
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
//name: Peptide Generation
|
|
92
|
+
//description: Generates new candidate peptides from monomer-position statistics, ranked by predicted activity
|
|
93
|
+
//tags: viewer
|
|
94
|
+
//output: viewer result
|
|
95
|
+
//meta.role: viewer
|
|
96
|
+
//meta.icon: files/icons/peptide-sar-vertical-viewer.svg
|
|
97
|
+
export function peptideGeneration() : any {
|
|
98
|
+
return PackageFunctions.peptideGeneration();
|
|
99
|
+
}
|
|
100
|
+
|
|
91
101
|
//name: Manual Alignment
|
|
92
102
|
//tags: widgets, panel
|
|
93
103
|
//input: string _monomer { semType: Monomer }
|
package/src/package.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {LSTPieChartRenderer} from './utils/cell-renderer';
|
|
|
19
19
|
import {PeptideUtils} from './peptideUtils';
|
|
20
20
|
import {SequencePositionStatsViewer} from './viewers/position-statistics-viewer';
|
|
21
21
|
import {MutationCliffsViewer} from './viewers/mutation-cliffs-viewer';
|
|
22
|
+
import {PeptideGenerationViewer} from './viewers/peptide-generation-viewer';
|
|
22
23
|
|
|
23
24
|
let monomerWorks: MonomerWorks | null = null;
|
|
24
25
|
let treeHelper: ITreeHelper;
|
|
@@ -240,6 +241,18 @@ export class PackageFunctions {
|
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
|
|
244
|
+
@grok.decorators.func({
|
|
245
|
+
name: 'Peptide Generation',
|
|
246
|
+
description: 'Generates new candidate peptides from monomer-position statistics, ranked by predicted activity',
|
|
247
|
+
outputs: [{type: 'viewer', name: 'result'}],
|
|
248
|
+
meta: {role: 'viewer', icon: 'files/icons/peptide-sar-vertical-viewer.svg'},
|
|
249
|
+
tags: ['viewer'],
|
|
250
|
+
})
|
|
251
|
+
static peptideGeneration(): DG.Viewer {
|
|
252
|
+
return new PeptideGenerationViewer();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
243
256
|
@grok.decorators.panel({
|
|
244
257
|
name: 'Manual Alignment',
|
|
245
258
|
meta: {role: 'widgets'},
|
package/src/tests/viewers.ts
CHANGED
|
@@ -13,6 +13,9 @@ import {PositionHeight} from '@datagrok-libraries/bio/src/viewers/web-logo';
|
|
|
13
13
|
import {TEST_COLUMN_NAMES} from './utils';
|
|
14
14
|
import {showTooltip} from '../utils/tooltips';
|
|
15
15
|
import {PeptideUtils} from '../peptideUtils';
|
|
16
|
+
import {GEN_COLUMN_NAMES, PEPTIDE_GENERATION_PROPS, PEPTIDE_GENERATION_VIEWER_NAME,
|
|
17
|
+
PeptideGenerationViewer} from '../viewers/peptide-generation-viewer';
|
|
18
|
+
import {ACTIVITY_TARGET} from '../utils/constants';
|
|
16
19
|
|
|
17
20
|
// category('Viewers: Basic', () => {
|
|
18
21
|
// let df: DG.DataFrame;
|
|
@@ -195,3 +198,56 @@ category('Viewers: Logo Summary Table', () => {
|
|
|
195
198
|
expect(tooltipElement !== null, true, `Tooltip is not shown for cluster '${cluster}'`);
|
|
196
199
|
});
|
|
197
200
|
}, {clear: false});
|
|
201
|
+
|
|
202
|
+
category('Viewers: Peptide Generation', () => {
|
|
203
|
+
let df: DG.DataFrame;
|
|
204
|
+
let genViewer: PeptideGenerationViewer;
|
|
205
|
+
|
|
206
|
+
before(async () => {
|
|
207
|
+
await PeptideUtils.loadComponents();
|
|
208
|
+
df = DG.DataFrame.fromCsv(await _package.files.readAsText('tests/HELM_small.csv'));
|
|
209
|
+
const sequenceCol = df.getCol(TEST_COLUMN_NAMES.SEQUENCE);
|
|
210
|
+
sequenceCol.semType = DG.SEMTYPE.MACROMOLECULE;
|
|
211
|
+
sequenceCol.setTag(DG.TAGS.UNITS, NOTATION.HELM);
|
|
212
|
+
genViewer = await df.plot.fromType(PEPTIDE_GENERATION_VIEWER_NAME, {
|
|
213
|
+
[PEPTIDE_GENERATION_PROPS.SEQUENCE]: TEST_COLUMN_NAMES.SEQUENCE,
|
|
214
|
+
[PEPTIDE_GENERATION_PROPS.ACTIVITY]: TEST_COLUMN_NAMES.ACTIVITY,
|
|
215
|
+
}) as PeptideGenerationViewer;
|
|
216
|
+
await delay(500);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
after(async () => await delay(1000));
|
|
220
|
+
|
|
221
|
+
test('Generates peptides', async () => {
|
|
222
|
+
const peptideCount = 10;
|
|
223
|
+
genViewer.getProperty(PEPTIDE_GENERATION_PROPS.PEPTIDE_COUNT)!.set(genViewer, peptideCount);
|
|
224
|
+
genViewer.getProperty(PEPTIDE_GENERATION_PROPS.EXCLUDE_EXISTING)!.set(genViewer, false);
|
|
225
|
+
const resultDf = genViewer.generatePeptides();
|
|
226
|
+
expect(resultDf.rowCount > 0, true, 'Peptide Generation produced no peptides');
|
|
227
|
+
expect(resultDf.rowCount <= peptideCount, true,
|
|
228
|
+
`Peptide Generation produced more than the requested ${peptideCount} peptides`);
|
|
229
|
+
for (const colName of Object.values(GEN_COLUMN_NAMES)) {
|
|
230
|
+
expect(resultDf.col(colName) !== null, true,
|
|
231
|
+
`Generated dataframe is missing the '${colName}' column`);
|
|
232
|
+
}
|
|
233
|
+
expect(resultDf.getCol(GEN_COLUMN_NAMES.PEPTIDE).semType, DG.SEMTYPE.MACROMOLECULE,
|
|
234
|
+
'Generated peptide column is not a Macromolecule');
|
|
235
|
+
// Per-position basis columns are appended after the fixed statistics columns.
|
|
236
|
+
expect(resultDf.columns.length > Object.values(GEN_COLUMN_NAMES).length, true,
|
|
237
|
+
'Generated dataframe is missing the per-position basis columns');
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test('Respects High/Low target', async () => {
|
|
241
|
+
genViewer.getProperty(PEPTIDE_GENERATION_PROPS.EXCLUDE_EXISTING)!.set(genViewer, false);
|
|
242
|
+
genViewer.getProperty(PEPTIDE_GENERATION_PROPS.ACTIVITY_TARGET)!.set(genViewer, ACTIVITY_TARGET.HIGH);
|
|
243
|
+
const highDf = genViewer.generatePeptides();
|
|
244
|
+
const highMax = highDf.getCol(GEN_COLUMN_NAMES.PREDICTED).stats.max;
|
|
245
|
+
|
|
246
|
+
genViewer.getProperty(PEPTIDE_GENERATION_PROPS.ACTIVITY_TARGET)!.set(genViewer, ACTIVITY_TARGET.LOW);
|
|
247
|
+
const lowDf = genViewer.generatePeptides();
|
|
248
|
+
const lowMin = lowDf.getCol(GEN_COLUMN_NAMES.PREDICTED).stats.min;
|
|
249
|
+
|
|
250
|
+
expect(highMax >= lowMin, true,
|
|
251
|
+
'High-target peptides should reach at least as high a predicted activity as the Low-target minimum');
|
|
252
|
+
});
|
|
253
|
+
});
|