@datagrok/bio 2.22.1 → 2.22.4
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 +5 -0
- package/detectors.js +55 -0
- package/dist/package-test.js +3 -3
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/package.json +10 -10
- package/scripts/embed.py +9 -3
- package/src/analysis/sequence-diversity-viewer.ts +85 -10
- package/src/analysis/sequence-search-base-viewer.ts +40 -8
- package/src/analysis/sequence-similarity-viewer.ts +47 -7
- package/src/analysis/sequence-space.ts +24 -4
- package/src/demo/bio05-helm-msa-sequence-space.ts +1 -1
- package/src/package-api.ts +417 -0
- package/src/package.g.ts +1 -0
- package/src/package.ts +24 -9
- package/src/tests/activity-cliffs-utils.ts +3 -2
- package/src/tests/msa-tests.ts +1 -1
- package/src/tests/pepsea-tests.ts +3 -3
- package/src/tests/similarity-diversity-tests.ts +5 -5
- package/src/utils/context-menu.ts +7 -6
- package/src/utils/helm-to-molfile/converter/mol-wrapper.ts +1 -1
- package/src/utils/multiple-sequence-alignment-ui.ts +20 -9
- package/src/utils/multiple-sequence-alignment.ts +22 -7
- package/src/utils/pepsea.ts +34 -18
- package/src/widgets/representations.ts +31 -58
- package/src/widgets/sequence-scrolling-widget.ts +185 -176
- package/src/widgets/to-atomic-level-widget.ts +94 -23
- package/test-console-output-1.log +626 -627
- package/test-record-1.mp4 +0 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
This file is auto-generated by the grok api command.
|
|
3
|
+
If you notice any changes, please push them to the repository.
|
|
4
|
+
Do not edit this file manually.
|
|
5
|
+
*/
|
|
6
|
+
import * as grok from 'datagrok-api/grok';
|
|
7
|
+
import * as DG from 'datagrok-api/dg';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export namespace scripts {
|
|
11
|
+
export async function embed(molecule: string ): Promise<string> {
|
|
12
|
+
return await grok.functions.call('Bio:Embed', { molecule });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Create the model peptides/DNA sequences with peptides data
|
|
17
|
+
*/
|
|
18
|
+
export async function sequenceGenerator(clusters: number , num_sequences: number , alphabet_key: string , motif_length: number , max_variants_position: number , random_length: number , dispersion: number , activity_range: number , cliff_probability: number , cliff_strength: number , cliff_strength_dispersion: number , assay_noise_levels: string , assay_scales: string , disable_negatives: boolean , fasta_separator: string | null, helm_library_file: DG.FileInfo | null, helm_connection_mode: string ): Promise<DG.DataFrame> {
|
|
19
|
+
return await grok.functions.call('Bio:SequenceGenerator', { clusters, num_sequences, alphabet_key, motif_length, max_variants_position, random_length, dispersion, activity_range, cliff_probability, cliff_strength, cliff_strength_dispersion, assay_noise_levels, assay_scales, disable_negatives, fasta_separator, helm_library_file, helm_connection_mode });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export namespace funcs {
|
|
24
|
+
/**
|
|
25
|
+
Returns an instance of the monomer library helper
|
|
26
|
+
*/
|
|
27
|
+
export async function getMonomerLibHelper(): Promise<any> {
|
|
28
|
+
return await grok.functions.call('Bio:GetMonomerLibHelper', {});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function initBio(): Promise<void> {
|
|
32
|
+
return await grok.functions.call('Bio:InitBio', {});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function sequenceTooltip(col: DG.Column ): Promise<any> {
|
|
36
|
+
return await grok.functions.call('Bio:SequenceTooltip', { col });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function getBioLib(): Promise<any> {
|
|
40
|
+
return await grok.functions.call('Bio:GetBioLib', {});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function getSeqHandler(sequence: DG.Column ): Promise<any> {
|
|
44
|
+
return await grok.functions.call('Bio:GetSeqHandler', { sequence });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
Creates a new column with sequences of the region between start and end
|
|
49
|
+
*/
|
|
50
|
+
export async function getRegionPanel(seqCol: DG.Column ): Promise<any> {
|
|
51
|
+
return await grok.functions.call('Bio:GetRegionPanel', { seqCol });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
//tags: panel, exclude-actions-panel
|
|
56
|
+
*/
|
|
57
|
+
export async function libraryPanel(seqColumn: DG.Column ): Promise<any> {
|
|
58
|
+
return await grok.functions.call('Bio:LibraryPanel', { seqColumn });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function getRegionEditor(call: any ): Promise<void> {
|
|
62
|
+
return await grok.functions.call('Bio:GetRegionEditor', { call });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function splitToMonomersEditor(call: any ): Promise<void> {
|
|
66
|
+
return await grok.functions.call('Bio:SplitToMonomersEditor', { call });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function sequenceSpaceEditor(call: any ): Promise<void> {
|
|
70
|
+
return await grok.functions.call('Bio:SequenceSpaceEditor', { call });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function seqActivityCliffsEditor(call: any ): Promise<void> {
|
|
74
|
+
return await grok.functions.call('Bio:SeqActivityCliffsEditor', { call });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function customSequenceCellRenderer(): Promise<any> {
|
|
78
|
+
return await grok.functions.call('Bio:CustomSequenceCellRenderer', {});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export async function fastaSequenceCellRenderer(): Promise<any> {
|
|
82
|
+
return await grok.functions.call('Bio:FastaSequenceCellRenderer', {});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function separatorSequenceCellRenderer(): Promise<any> {
|
|
86
|
+
return await grok.functions.call('Bio:SeparatorSequenceCellRenderer', {});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export async function macroMolColumnPropertyPanel(molColumn: DG.Column ): Promise<any> {
|
|
90
|
+
return await grok.functions.call('Bio:MacroMolColumnPropertyPanel', { molColumn });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function compositionAnalysisWidget(sequence: any ): Promise<any> {
|
|
94
|
+
return await grok.functions.call('Bio:CompositionAnalysisWidget', { sequence });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export async function macromoleculeDifferenceCellRenderer(): Promise<any> {
|
|
98
|
+
return await grok.functions.call('Bio:MacromoleculeDifferenceCellRenderer', {});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export async function sequenceAlignment(alignType: string , alignTable: string , gap: number , seq1: string , seq2: string ): Promise<any> {
|
|
102
|
+
return await grok.functions.call('Bio:SequenceAlignment', { alignType, alignTable, gap, seq1, seq2 });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
WebLogo
|
|
107
|
+
*/
|
|
108
|
+
export async function webLogoViewer(): Promise<any> {
|
|
109
|
+
return await grok.functions.call('Bio:WebLogoViewer', {});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
V-Domain regions viewer
|
|
114
|
+
*/
|
|
115
|
+
export async function vdRegionsViewer(): Promise<any> {
|
|
116
|
+
return await grok.functions.call('Bio:VdRegionsViewer', {});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
Gets a new column with sequences of the region between start and end
|
|
121
|
+
*/
|
|
122
|
+
export async function getRegion(sequence: DG.Column , start?: string , end?: string , name?: string ): Promise<DG.Column> {
|
|
123
|
+
return await grok.functions.call('Bio:GetRegion', { sequence, start, end, name });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
Get sequences for a region specified from a Macromolecule
|
|
128
|
+
*/
|
|
129
|
+
export async function getRegionTopMenu(table: DG.DataFrame , sequence: DG.Column , start?: string , end?: string , name?: string ): Promise<void> {
|
|
130
|
+
return await grok.functions.call('Bio:GetRegionTopMenu', { table, sequence, start, end, name });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
Detects pairs of molecules with similar structure and significant difference in any given property
|
|
135
|
+
*/
|
|
136
|
+
export async function activityCliffs(table: DG.DataFrame , molecules: DG.Column , activities: DG.Column , similarity: number , methodName: string , similarityMetric: string , preprocessingFunction: any , options?: any , demo?: boolean ): Promise<void> {
|
|
137
|
+
return await grok.functions.call('Bio:ActivityCliffs', { table, molecules, activities, similarity, methodName, similarityMetric, preprocessingFunction, options, demo });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export async function macromoleculePreprocessingFunction(col: DG.Column , metric: string , gapOpen?: number , gapExtend?: number , fingerprintType?: string ): Promise<any> {
|
|
141
|
+
return await grok.functions.call('Bio:MacromoleculePreprocessingFunction', { col, metric, gapOpen, gapExtend, fingerprintType });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export async function helmPreprocessingFunction(col: DG.Column , _metric: string ): Promise<any> {
|
|
145
|
+
return await grok.functions.call('Bio:HelmPreprocessingFunction', { col, _metric });
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
Creates 2D sequence space with projected sequences by pairwise distance
|
|
150
|
+
*/
|
|
151
|
+
export async function sequenceSpaceTopMenu(table: DG.DataFrame , molecules: DG.Column , methodName: string , similarityMetric: string , plotEmbeddings: boolean , preprocessingFunction?: any , options?: any , clusterEmbeddings?: boolean , isDemo?: boolean ): Promise<void> {
|
|
152
|
+
return await grok.functions.call('Bio:SequenceSpaceTopMenu', { table, molecules, methodName, similarityMetric, plotEmbeddings, preprocessingFunction, options, clusterEmbeddings, isDemo });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
Converts sequences to molblocks
|
|
157
|
+
*/
|
|
158
|
+
export async function toAtomicLevel(table: DG.DataFrame , seqCol: DG.Column , nonlinear: boolean , highlight: boolean ): Promise<void> {
|
|
159
|
+
return await grok.functions.call('Bio:ToAtomicLevel', { table, seqCol, nonlinear, highlight });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export async function toAtomicLevelAction(seqCol: DG.Column ): Promise<void> {
|
|
163
|
+
return await grok.functions.call('Bio:ToAtomicLevelAction', { seqCol });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export async function toAtomicLevelPanel(sequence: any ): Promise<any> {
|
|
167
|
+
return await grok.functions.call('Bio:ToAtomicLevelPanel', { sequence });
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export async function sequence3dStructureWidget(sequence: any ): Promise<any> {
|
|
171
|
+
return await grok.functions.call('Bio:Sequence3dStructureWidget', { sequence });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
Performs multiple sequence alignment
|
|
176
|
+
*/
|
|
177
|
+
export async function multipleSequenceAlignmentDialog(): Promise<void> {
|
|
178
|
+
return await grok.functions.call('Bio:MultipleSequenceAlignmentDialog', {});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
Multiple sequence alignment
|
|
183
|
+
*/
|
|
184
|
+
export async function alignSequences(sequenceCol: DG.Column , clustersCol: DG.Column , options?: any ): Promise<DG.Column> {
|
|
185
|
+
return await grok.functions.call('Bio:AlignSequences', { sequenceCol, clustersCol, options });
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
Visualizes sequence composition on a WebLogo plot
|
|
190
|
+
*/
|
|
191
|
+
export async function compositionAnalysis(): Promise<any> {
|
|
192
|
+
return await grok.functions.call('Bio:CompositionAnalysis', {});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
Opens FASTA file
|
|
197
|
+
*/
|
|
198
|
+
export async function importFasta(fileContent: string ): Promise<any> {
|
|
199
|
+
return await grok.functions.call('Bio:ImportFasta', { fileContent });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
Opens Bam file
|
|
204
|
+
*/
|
|
205
|
+
export async function importBam(fileContent: string ): Promise<any> {
|
|
206
|
+
return await grok.functions.call('Bio:ImportBam', { fileContent });
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export async function convertDialog(): Promise<void> {
|
|
210
|
+
return await grok.functions.call('Bio:ConvertDialog', {});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export async function convertColumnAction(col: DG.Column ): Promise<void> {
|
|
214
|
+
return await grok.functions.call('Bio:ConvertColumnAction', { col });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export async function monomerCellRenderer(): Promise<any> {
|
|
218
|
+
return await grok.functions.call('Bio:MonomerCellRenderer', {});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export async function testDetectMacromolecule(path: string ): Promise<DG.DataFrame> {
|
|
222
|
+
return await grok.functions.call('Bio:TestDetectMacromolecule', { path });
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export async function splitToMonomersTopMenu(table: DG.DataFrame , sequence: DG.Column ): Promise<DG.DataFrame> {
|
|
226
|
+
return await grok.functions.call('Bio:SplitToMonomersTopMenu', { table, sequence });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export async function getHelmMonomers(sequence: DG.Column ): Promise<any> {
|
|
230
|
+
return await grok.functions.call('Bio:GetHelmMonomers', { sequence });
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export async function similaritySearchViewer(): Promise<any> {
|
|
234
|
+
return await grok.functions.call('Bio:SimilaritySearchViewer', {});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
Finds similar sequences
|
|
239
|
+
*/
|
|
240
|
+
export async function similaritySearchTopMenu(): Promise<any> {
|
|
241
|
+
return await grok.functions.call('Bio:SimilaritySearchTopMenu', {});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export async function diversitySearchViewer(): Promise<any> {
|
|
245
|
+
return await grok.functions.call('Bio:DiversitySearchViewer', {});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
Finds the most diverse sequences
|
|
250
|
+
*/
|
|
251
|
+
export async function diversitySearchTopMenu(): Promise<any> {
|
|
252
|
+
return await grok.functions.call('Bio:DiversitySearchTopMenu', {});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export async function searchSubsequenceEditor(call: any ): Promise<void> {
|
|
256
|
+
return await grok.functions.call('Bio:SearchSubsequenceEditor', { call });
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export async function subsequenceSearchTopMenu(macromolecules: DG.Column ): Promise<void> {
|
|
260
|
+
return await grok.functions.call('Bio:SubsequenceSearchTopMenu', { macromolecules });
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
Adds a column with fraction of matching monomers
|
|
265
|
+
*/
|
|
266
|
+
export async function sequenceIdentityScoring(table: DG.DataFrame , macromolecule: DG.Column , reference: string ): Promise<DG.Column> {
|
|
267
|
+
return await grok.functions.call('Bio:SequenceIdentityScoring', { table, macromolecule, reference });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
Adds a column with similarity scores, calculated as sum of monomer fingerprint similarities
|
|
272
|
+
*/
|
|
273
|
+
export async function sequenceSimilarityScoring(table: DG.DataFrame , macromolecule: DG.Column , reference: string ): Promise<DG.Column> {
|
|
274
|
+
return await grok.functions.call('Bio:SequenceSimilarityScoring', { table, macromolecule, reference });
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
Manage HELM monomer libraries
|
|
279
|
+
*/
|
|
280
|
+
export async function manageMonomerLibraries(): Promise<void> {
|
|
281
|
+
return await grok.functions.call('Bio:ManageMonomerLibraries', {});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export async function manageLibrariesView(): Promise<void> {
|
|
285
|
+
return await grok.functions.call('Bio:ManageLibrariesView', {});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
Edit and create monomers
|
|
290
|
+
*/
|
|
291
|
+
export async function manageMonomersView(): Promise<void> {
|
|
292
|
+
return await grok.functions.call('Bio:ManageMonomersView', {});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export async function manageMonomerLibrariesView(): Promise<DG.View> {
|
|
296
|
+
return await grok.functions.call('Bio:ManageMonomerLibrariesView', {});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export async function manageMonomerLibrariesViewTreeBrowser(treeNode: any , browsePanel: any ): Promise<void> {
|
|
300
|
+
return await grok.functions.call('Bio:ManageMonomerLibrariesViewTreeBrowser', { treeNode, browsePanel });
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
As FASTA...
|
|
305
|
+
*/
|
|
306
|
+
export async function saveAsFasta(): Promise<void> {
|
|
307
|
+
return await grok.functions.call('Bio:SaveAsFasta', {});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
Substructure filter for macromolecules
|
|
312
|
+
*/
|
|
313
|
+
export async function bioSubstructureFilter(): Promise<any> {
|
|
314
|
+
return await grok.functions.call('Bio:BioSubstructureFilter', {});
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
Substructure filter for Helm package tests
|
|
319
|
+
*/
|
|
320
|
+
export async function bioSubstructureFilterTest(): Promise<any> {
|
|
321
|
+
return await grok.functions.call('Bio:BioSubstructureFilterTest', {});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export async function webLogoLargeApp(): Promise<void> {
|
|
325
|
+
return await grok.functions.call('Bio:WebLogoLargeApp', {});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export async function webLogoAggApp(): Promise<void> {
|
|
329
|
+
return await grok.functions.call('Bio:WebLogoAggApp', {});
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export async function getRegionApp(): Promise<void> {
|
|
333
|
+
return await grok.functions.call('Bio:GetRegionApp', {});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export async function getRegionHelmApp(): Promise<void> {
|
|
337
|
+
return await grok.functions.call('Bio:GetRegionHelmApp', {});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export async function longSeqTableSeparator(): Promise<void> {
|
|
341
|
+
return await grok.functions.call('Bio:LongSeqTableSeparator', {});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export async function longSeqTableFasta(): Promise<void> {
|
|
345
|
+
return await grok.functions.call('Bio:LongSeqTableFasta', {});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export async function longSeqTableHelm(): Promise<void> {
|
|
349
|
+
return await grok.functions.call('Bio:LongSeqTableHelm', {});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export async function addCopyMenu(cell: any , menu: any ): Promise<void> {
|
|
353
|
+
return await grok.functions.call('Bio:AddCopyMenu', { cell, menu });
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
Sequence similarity tracking and evaluation dataset diversity
|
|
358
|
+
*/
|
|
359
|
+
export async function demoBioSimilarityDiversity(): Promise<void> {
|
|
360
|
+
return await grok.functions.call('Bio:DemoBioSimilarityDiversity', {});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
Exploring sequence space of Macromolecules, comparison with hierarchical clustering results
|
|
365
|
+
*/
|
|
366
|
+
export async function demoBioSequenceSpace(): Promise<void> {
|
|
367
|
+
return await grok.functions.call('Bio:DemoBioSequenceSpace', {});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
Activity Cliffs analysis on Macromolecules data
|
|
372
|
+
*/
|
|
373
|
+
export async function demoBioActivityCliffs(): Promise<void> {
|
|
374
|
+
return await grok.functions.call('Bio:DemoBioActivityCliffs', {});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
Atomic level structure of Macromolecules
|
|
379
|
+
*/
|
|
380
|
+
export async function demoBioAtomicLevel(): Promise<void> {
|
|
381
|
+
return await grok.functions.call('Bio:DemoBioAtomicLevel', {});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export async function sdfToJsonLib(table: DG.DataFrame ): Promise<void> {
|
|
385
|
+
return await grok.functions.call('Bio:SdfToJsonLib', { table });
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
Converts a `Macromolecule` sequence to its atomic level `Molecule` representation
|
|
390
|
+
*/
|
|
391
|
+
export async function seq2atomic(seq: string , nonlinear: boolean ): Promise<string> {
|
|
392
|
+
return await grok.functions.call('Bio:Seq2atomic', { seq, nonlinear });
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
Gets identity to a reference sequence
|
|
397
|
+
*/
|
|
398
|
+
export async function seqIdentity(seq: string , ref: string ): Promise<number> {
|
|
399
|
+
return await grok.functions.call('Bio:SeqIdentity', { seq, ref });
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export async function detectMacromoleculeProbe(file: DG.FileInfo , colName: string , probeCount: number ): Promise<void> {
|
|
403
|
+
return await grok.functions.call('Bio:DetectMacromoleculeProbe', { file, colName, probeCount });
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export async function getSeqHelper(): Promise<any> {
|
|
407
|
+
return await grok.functions.call('Bio:GetSeqHelper', {});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export async function getMolFromHelm(df: DG.DataFrame , helmCol: DG.Column , chiralityEngine: boolean ): Promise<DG.Column> {
|
|
411
|
+
return await grok.functions.call('Bio:GetMolFromHelm', { df, helmCol, chiralityEngine });
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export async function test1(): Promise<any> {
|
|
415
|
+
return await grok.functions.call('Bio:Test1', {});
|
|
416
|
+
}
|
|
417
|
+
}
|
package/src/package.g.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import * as DG from 'datagrok-api/dg';
|
package/src/package.ts
CHANGED
|
@@ -74,7 +74,7 @@ import {MonomerManager} from './utils/monomer-lib/monomer-manager/monomer-manage
|
|
|
74
74
|
import {calculateScoresWithEmptyValues} from './utils/calculate-scores';
|
|
75
75
|
import {SeqHelper} from './utils/seq-helper/seq-helper';
|
|
76
76
|
import {_toAtomicLevel} from '@datagrok-libraries/bio/src/monomer-works/to-atomic-level';
|
|
77
|
-
import {toAtomicLevelWidget} from './widgets/to-atomic-level-widget';
|
|
77
|
+
import {molecular3DStructureWidget, toAtomicLevelWidget} from './widgets/to-atomic-level-widget';
|
|
78
78
|
import {handleSequenceHeaderRendering} from './widgets/sequence-scrolling-widget';
|
|
79
79
|
export const _package = new BioPackage(/*{debug: true}/**/);
|
|
80
80
|
|
|
@@ -455,17 +455,17 @@ export async function getRegionTopMenu(
|
|
|
455
455
|
//input: func preprocessingFunction
|
|
456
456
|
//input: object options {optional: true}
|
|
457
457
|
//input: bool demo {optional: true}
|
|
458
|
-
//output: viewer result
|
|
459
458
|
//editor: Bio:SeqActivityCliffsEditor
|
|
460
459
|
export async function activityCliffs(table: DG.DataFrame, molecules: DG.Column<string>, activities: DG.Column,
|
|
461
460
|
similarity: number, methodName: DimReductionMethods,
|
|
462
461
|
similarityMetric: MmDistanceFunctionsNames | BitArrayMetrics, preprocessingFunction: DG.Func,
|
|
463
462
|
options?: (IUMAPOptions | ITSNEOptions) & Options, demo?: boolean): Promise<DG.Viewer | undefined> {
|
|
464
463
|
//workaround for functions which add viewers to tableView (can be run only on active table view)
|
|
465
|
-
if (table
|
|
464
|
+
if (table !== grok.shell.tv.dataFrame) {
|
|
466
465
|
grok.shell.error(`Table ${table.name} is not a current table view`);
|
|
467
466
|
return;
|
|
468
467
|
}
|
|
468
|
+
const tv = grok.shell.tv;
|
|
469
469
|
if (!checkInputColumnUI(molecules, 'Activity Cliffs'))
|
|
470
470
|
return;
|
|
471
471
|
const axesNames = getEmbeddingColsNames(table);
|
|
@@ -509,7 +509,7 @@ export async function activityCliffs(table: DG.DataFrame, molecules: DG.Column<s
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
const pi = DG.TaskBarProgressIndicator.create(`Running sequence activity cliffs ...`);
|
|
512
|
-
|
|
512
|
+
const scRes = (await new Promise<DG.Viewer | undefined>((resolve, reject) => {
|
|
513
513
|
if (table.rowCount > fastRowCount && !options?.[BYPASS_LARGE_DATA_WARNING]) {
|
|
514
514
|
ui.dialog().add(ui.divText(`Activity cliffs analysis might take several minutes.
|
|
515
515
|
Do you want to continue?`))
|
|
@@ -524,7 +524,13 @@ export async function activityCliffs(table: DG.DataFrame, molecules: DG.Column<s
|
|
|
524
524
|
const [errMsg, errStack] = errInfo(err);
|
|
525
525
|
_package.logger.error(errMsg, undefined, errStack);
|
|
526
526
|
throw err;
|
|
527
|
-
}).finally(() => { pi.close(); });
|
|
527
|
+
}).finally(() => { pi.close(); })) as DG.ScatterPlotViewer | undefined;
|
|
528
|
+
if (scRes?.props?.xColumnName && scRes?.props?.yColumnName && table.col(scRes.props.xColumnName) && table.col(scRes.props.yColumnName)) {
|
|
529
|
+
table.col(scRes.props.xColumnName)!.set(0, table.col(scRes.props.xColumnName)!.get(0)); // to trigger rendering
|
|
530
|
+
table.col(scRes.props.yColumnName)!.set(0, table.col(scRes.props.yColumnName)!.get(0)); // to trigger rendering
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
return scRes;
|
|
528
534
|
}
|
|
529
535
|
|
|
530
536
|
//name: Encode Sequences
|
|
@@ -544,8 +550,9 @@ export async function macromoleculePreprocessingFunction(
|
|
|
544
550
|
fingerprintType = 'Morgan'): Promise<PreprocessFunctionReturnType> {
|
|
545
551
|
if (col.semType !== DG.SEMTYPE.MACROMOLECULE)
|
|
546
552
|
return {entries: col.toList(), options: {}};
|
|
547
|
-
|
|
548
|
-
|
|
553
|
+
|
|
554
|
+
const {seqList, options} = await getEncodedSeqSpaceCol(col, metric, fingerprintType, gapOpen, gapExtend);
|
|
555
|
+
return {entries: seqList, options};
|
|
549
556
|
}
|
|
550
557
|
|
|
551
558
|
//name: Helm Fingerprints
|
|
@@ -658,6 +665,14 @@ export async function toAtomicLevelPanel(sequence: DG.SemanticValue): Promise<DG
|
|
|
658
665
|
return toAtomicLevelWidget(sequence);
|
|
659
666
|
}
|
|
660
667
|
|
|
668
|
+
//name: Molecular 3D Structure
|
|
669
|
+
//tags: panel, bio, widgets
|
|
670
|
+
//input: semantic_value sequence { semType: Macromolecule }
|
|
671
|
+
//output: widget result
|
|
672
|
+
export async function sequence3dStructureWidget(sequence: DG.SemanticValue): Promise<DG.Widget> {
|
|
673
|
+
return molecular3DStructureWidget(sequence);
|
|
674
|
+
}
|
|
675
|
+
|
|
661
676
|
//top-menu: Bio | Analyze | MSA...
|
|
662
677
|
//name: MSA
|
|
663
678
|
//description: Performs multiple sequence alignment
|
|
@@ -986,7 +1001,7 @@ export async function manageMonomerLibrariesView(): Promise<DG.View> {
|
|
|
986
1001
|
//name: Monomer Manager Tree Browser
|
|
987
1002
|
//input: dynamic treeNode
|
|
988
1003
|
//input: dynamic browsePanel
|
|
989
|
-
export async function
|
|
1004
|
+
export async function manageMonomerLibrariesViewTreeBrowser(treeNode: DG.TreeViewGroup, browsePanel: DG.BrowsePanel) {
|
|
990
1005
|
const libraries = (await (await MonomerLibManager.getInstance()).getFileManager()).getValidLibraryPaths();
|
|
991
1006
|
libraries.forEach((libName) => {
|
|
992
1007
|
const nodeName = libName.endsWith('.json') ? libName.substring(0, libName.length - 5) : libName;
|
|
@@ -1100,7 +1115,7 @@ export function longSeqTableHelm(): void {
|
|
|
1100
1115
|
|
|
1101
1116
|
// -- Handle context menu --
|
|
1102
1117
|
|
|
1103
|
-
|
|
1118
|
+
//name: addCopyMenu
|
|
1104
1119
|
//input: object cell
|
|
1105
1120
|
//input: object menu
|
|
1106
1121
|
export function addCopyMenu(cell: DG.Cell, menu: DG.Menu): void {
|
|
@@ -12,7 +12,7 @@ export async function _testActivityCliffsOpen(df: DG.DataFrame, drMethod: DimRed
|
|
|
12
12
|
similarityMetric: MmDistanceFunctionsNames | BitArrayMetrics, preprocessingFunction: DG.Func,
|
|
13
13
|
): Promise<void> {
|
|
14
14
|
await grok.data.detectSemanticTypes(df);
|
|
15
|
-
|
|
15
|
+
(await grok.functions.call('Bio:activityCliffs', {
|
|
16
16
|
table: df,
|
|
17
17
|
molecules: df.getCol(seqColName),
|
|
18
18
|
activities: df.getCol(activityColName),
|
|
@@ -23,7 +23,8 @@ export async function _testActivityCliffsOpen(df: DG.DataFrame, drMethod: DimRed
|
|
|
23
23
|
options: {[`${BYPASS_LARGE_DATA_WARNING}`]: true},
|
|
24
24
|
demo: false,
|
|
25
25
|
})) as DG.Viewer | undefined;
|
|
26
|
-
|
|
26
|
+
const scatterPlot = Array.from(grok.shell.tv.viewers)[1];
|
|
27
|
+
expect(scatterPlot?.type === DG.VIEWER.SCATTER_PLOT, true);
|
|
27
28
|
|
|
28
29
|
await awaitCheck(() => {
|
|
29
30
|
const link = Array.from(scatterPlot!.root.getElementsByClassName('scatter_plot_link'));
|
package/src/tests/msa-tests.ts
CHANGED
|
@@ -140,7 +140,7 @@ async function _testMsaIsCorrect(srcCsv: string, tgtCsv: string): Promise<void>
|
|
|
140
140
|
expect(srcCol.semType, DG.SEMTYPE.MACROMOLECULE);
|
|
141
141
|
|
|
142
142
|
const tgtCol: DG.Column = tgtDf.getCol('seq')!;
|
|
143
|
-
const resCol: DG.Column = await runKalign(srcCol, true);
|
|
143
|
+
const resCol: DG.Column = await runKalign(srcDf, srcCol, true);
|
|
144
144
|
expectArray(resCol.toList(), tgtCol.toList());
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -31,7 +31,7 @@ category('PepSeA', () => {
|
|
|
31
31
|
|
|
32
32
|
test('Basic alignment', async () => {
|
|
33
33
|
const df = DG.DataFrame.fromCsv(testCsv);
|
|
34
|
-
const resMsaCol = await runPepsea(df.getCol('HELM'), 'msa(HELM)');
|
|
34
|
+
const resMsaCol = await runPepsea(df, df.getCol('HELM'), 'msa(HELM)');
|
|
35
35
|
const tgtMsaCol = df.getCol('MSA');
|
|
36
36
|
for (let i = 0; i < resMsaCol!.length; ++i)
|
|
37
37
|
expect(resMsaCol!.get(i) == tgtMsaCol.get(i), true);
|
|
@@ -40,7 +40,7 @@ category('PepSeA', () => {
|
|
|
40
40
|
test('stderr', async () => {
|
|
41
41
|
const logger = new TestLogger();
|
|
42
42
|
const df = DG.DataFrame.fromCsv(pepseaStderrCsv);
|
|
43
|
-
const resMsaCol = await runPepsea(df.getCol('HELM'), 'msa(HELM)',
|
|
43
|
+
const resMsaCol = await runPepsea(df, df.getCol('HELM'), 'msa(HELM)',
|
|
44
44
|
undefined, undefined, undefined, undefined, logger);
|
|
45
45
|
const tgtMsaCol = df.getCol('MSA');
|
|
46
46
|
expectArray(resMsaCol!.toList(), tgtMsaCol.toList());
|
|
@@ -51,7 +51,7 @@ category('PepSeA', () => {
|
|
|
51
51
|
const logger = new TestLogger();
|
|
52
52
|
try {
|
|
53
53
|
const df = DG.DataFrame.fromCsv(pepseaErrorCsv);
|
|
54
|
-
const _resMsaCol = await runPepsea(df.getCol('HELM'), 'msa(HELM)',
|
|
54
|
+
const _resMsaCol = await runPepsea(df, df.getCol('HELM'), 'msa(HELM)',
|
|
55
55
|
undefined, undefined, undefined, undefined, logger);
|
|
56
56
|
} catch (err: any) {
|
|
57
57
|
const [errMsg, errStack] = errInfo(err);
|
|
@@ -48,17 +48,17 @@ async function _testSimilaritySearchViewer() {
|
|
|
48
48
|
|
|
49
49
|
/* eslint-disable max-len */
|
|
50
50
|
const str0: string = 'D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me';
|
|
51
|
-
const str1: string = '
|
|
51
|
+
const str1: string = '/D-Tyr_Et/meQ/dV/E/N/dV///Phe_4Me';
|
|
52
52
|
const simStr1: string = 'meI/hHis/Aca/Cys_SEt/T/dK/Thr_PO3H2/Aca/Tyr_PO3H2/D-Chg/dV/Phe_ab-dehydro/N/D-Orn/D-aThr//Phe_4Me';
|
|
53
53
|
/* eslint-enable max-len */
|
|
54
54
|
|
|
55
55
|
expect(similaritySearchViewer.fingerprint, 'Morgan');
|
|
56
|
-
expect(similaritySearchViewer.distanceMetric, '
|
|
56
|
+
expect(similaritySearchViewer.distanceMetric, 'Hamming');
|
|
57
57
|
expect(similaritySearchViewer.scores!.get(0), DG.FLOAT_NULL);
|
|
58
58
|
expect(similaritySearchViewer.idxs!.get(0), 0);
|
|
59
59
|
expect(similaritySearchViewer.molCol!.get(0), str0);
|
|
60
|
-
expect((similaritySearchViewer.scores!.get(1) as number).toFixed(2), '0.
|
|
61
|
-
expect(similaritySearchViewer.idxs!.get(1),
|
|
60
|
+
expect((similaritySearchViewer.scores!.get(1) as number).toFixed(2), '0.10');
|
|
61
|
+
expect(similaritySearchViewer.idxs!.get(1), 7);
|
|
62
62
|
expect(similaritySearchViewer.molCol!.get(1), str1);
|
|
63
63
|
moleculesView.dataFrame.currentRowIdx = 1;
|
|
64
64
|
await awaitCheck(() => similaritySearchViewer.targetMoleculeIdx === 1,
|
|
@@ -98,7 +98,7 @@ async function _testDiversitySearchViewer() {
|
|
|
98
98
|
'Sequence Diversity Search viewer grid has not been created', 100);
|
|
99
99
|
|
|
100
100
|
expect(diversitySearchViewer.fingerprint, 'Morgan');
|
|
101
|
-
expect(diversitySearchViewer.distanceMetric, '
|
|
101
|
+
expect(diversitySearchViewer.distanceMetric, 'Hamming');
|
|
102
102
|
expect(diversitySearchViewer.initialized, true);
|
|
103
103
|
expect(diversitySearchViewer.renderMolIds!.length > 0, true);
|
|
104
104
|
}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
import * as grok from 'datagrok-api/grok';
|
|
2
3
|
import * as DG from 'datagrok-api/dg';
|
|
3
4
|
import * as ui from 'datagrok-api/ui';
|
|
4
5
|
|
|
5
|
-
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
|
+
import {ALPHABET, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
7
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
7
8
|
|
|
8
9
|
import {_package} from '../package';
|
|
10
|
+
import {TAGS as bioTags} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
export function addCopyMenuUI(cell: DG.Cell, menu: DG.Menu, seqHelper: ISeqHelper): void {
|
|
12
|
-
const
|
|
13
|
-
const tgtNotationList: string[] = Object.values(NOTATION).filter((v) => v !== sh.units);
|
|
14
|
+
const tgtNotationList: string[] = Object.values(NOTATION).filter((v) => v !== NOTATION.CUSTOM);
|
|
14
15
|
|
|
15
16
|
menu.group('Copy')
|
|
16
17
|
.items(tgtNotationList, (tgtNotation) => {
|
|
17
18
|
const srcCol = cell.column;
|
|
18
19
|
const srcRowIdx = cell.rowIndex;
|
|
19
20
|
const srcSh = seqHelper.getSeqHandler(srcCol);
|
|
20
|
-
const separator = tgtNotation === NOTATION.SEPARATOR ? _package.properties.defaultSeparator : undefined;
|
|
21
|
+
const separator = tgtNotation === NOTATION.SEPARATOR ? (_package.properties.defaultSeparator ?? '-') : undefined;
|
|
21
22
|
const joiner = srcSh.getJoiner({notation: tgtNotation as NOTATION, separator});
|
|
22
23
|
const srcSS = srcSh.getSplitted(srcRowIdx);
|
|
23
24
|
const tgtSeq = joiner(srcSS);
|
|
24
25
|
|
|
25
|
-
if (!navigator.clipboard)
|
|
26
|
+
if (!navigator.clipboard)
|
|
26
27
|
grok.shell.warning('The clipboard functionality requires a secure origin — either HTTPS or localhost');
|
|
27
|
-
|
|
28
|
+
else {
|
|
28
29
|
navigator.clipboard.writeText(tgtSeq);
|
|
29
30
|
grok.shell.info(`Value of notation '${tgtNotation}' copied to clipboard`);
|
|
30
31
|
}
|
|
@@ -16,7 +16,7 @@ export abstract class MolfileWrapper {
|
|
|
16
16
|
protected shiftR1GroupToOrigin(): void {
|
|
17
17
|
const r1Idx = this.rGroups.getAtomicIdx(1);
|
|
18
18
|
if (r1Idx === null)
|
|
19
|
-
|
|
19
|
+
return; // R1 group is not present, nothing to shift
|
|
20
20
|
const {x, y} = this.atoms.atomCoordinates[r1Idx];
|
|
21
21
|
this.atoms.shift({x: -x, y: -y});
|
|
22
22
|
}
|