@datagrok/sequence-translator 1.10.13 → 1.10.15

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/detectors.js +30 -2
  3. package/dist/455.js +1 -1
  4. package/dist/455.js.map +1 -1
  5. package/dist/package-test.js +1 -1
  6. package/dist/package-test.js.map +1 -1
  7. package/dist/package.js +1 -1
  8. package/dist/package.js.map +1 -1
  9. package/files/samples/sirna-demo.csv +38 -0
  10. package/files/tests/chem_enum_cores.csv +5 -0
  11. package/files/tests/chem_enum_rgroups.csv +5 -0
  12. package/package.json +2 -2
  13. package/src/apps/structure/view/ui.ts +1 -1
  14. package/src/apps/translator/view/ui.ts +1 -1
  15. package/src/oligo-renderer/canvas-renderer.ts +500 -0
  16. package/src/oligo-renderer/cell-renderer.ts +105 -0
  17. package/src/oligo-renderer/converters.ts +77 -0
  18. package/src/oligo-renderer/helm-parser.ts +154 -0
  19. package/src/oligo-renderer/legend-panel.ts +154 -0
  20. package/src/oligo-renderer/structures-panel.ts +96 -0
  21. package/src/oligo-renderer/tooltip.ts +223 -0
  22. package/src/oligo-renderer/types.ts +221 -0
  23. package/src/package-api.ts +43 -1
  24. package/src/package-test.ts +2 -0
  25. package/src/package.g.ts +56 -3
  26. package/src/package.ts +92 -5
  27. package/src/polytool/const.ts +1 -1
  28. package/src/polytool/pt-chem-enum-dialog.ts +940 -0
  29. package/src/polytool/pt-chem-enum.ts +553 -0
  30. package/src/polytool/pt-dialog.ts +4 -125
  31. package/src/polytool/pt-enumerate-seq-dialog.ts +3 -3
  32. package/src/tests/oligo-renderer-tests.ts +299 -0
  33. package/src/tests/polytool-enumerate-chem-tests.ts +408 -0
  34. package/test-console-output-1.log +303 -97
  35. package/test-record-1.mp4 +0 -0
  36. package/src/polytool/pt-enumeration-chem.ts +0 -100
package/src/package.ts CHANGED
@@ -16,8 +16,13 @@ import {demoOligoPatternUI, demoOligoStructureUI, demoOligoTranslatorUI} from '.
16
16
  import {getExternalAppViewFactories} from './plugins/mermade';
17
17
  import {defaultErrorHandler} from './utils/err-info';
18
18
 
19
+ import {OligoNucleotideCellRenderer} from './oligo-renderer/cell-renderer';
20
+ import {buildOligoPanel} from './oligo-renderer/legend-panel';
21
+ import {buildOligoStructuresPanel} from './oligo-renderer/structures-panel';
22
+ import {combineSenseAntisenseToOligo, convertHelmColumnToOligo} from './oligo-renderer/converters';
23
+
19
24
  import {polyToolConvert, polyToolConvertUI} from './polytool/pt-dialog';
20
- import {polyToolEnumerateChemUI} from './polytool/pt-dialog';
25
+ import {polyToolEnumerateChemApp, polyToolEnumerateChemUI} from './polytool/pt-chem-enum-dialog';
21
26
  import {polyToolEnumerateHelmUI, polyToolEnumerateSeq} from './polytool/pt-enumerate-seq-dialog';
22
27
  import {_setPeptideColumn} from './polytool/utils';
23
28
  import {PolyToolCsvLibHandler} from './polytool/csv-to-json-monomer-lib-converter';
@@ -276,6 +281,16 @@ export class PackageFunctions {
276
281
  }
277
282
 
278
283
 
284
+ @grok.decorators.func({
285
+ 'top-menu': 'Chem | Transform | Reactions | Enumerate...',
286
+ 'name': 'chemEnumerateReactions',
287
+ 'description': 'Enumerate cores and R-group lists into a molecule table (Zip or Cartesian)'
288
+ })
289
+ static async chemEnumerateReactionsTopMenu(): Promise<void> {
290
+ polyToolEnumerateChemUI();
291
+ }
292
+
293
+
279
294
  @grok.decorators.func()
280
295
  static async polyToolColumnChoice(
281
296
  @grok.decorators.param({options: {description: 'Input data table'}}) df: DG.DataFrame,
@@ -314,14 +329,15 @@ export class PackageFunctions {
314
329
  @grok.decorators.func({
315
330
  meta: {
316
331
  icon: 'img/icons/structure.png',
317
- browsePath: 'Peptides | PolyTool',
332
+ browsePath: 'Chem | PolyTool',
318
333
  role: 'app'
319
334
  },
320
335
  name: 'Chem Enumerator',
321
- tags: ['app']
336
+ tags: ['app'],
337
+ outputs: [{type: 'view', name: 'result'}]
322
338
  })
323
- static async ptEnumeratorChemApp(): Promise<void> {
324
- polyToolEnumerateChemUI();
339
+ static async ptEnumeratorChemApp() {
340
+ return await polyToolEnumerateChemApp();
325
341
  }
326
342
 
327
343
 
@@ -387,6 +403,77 @@ export class PackageFunctions {
387
403
  }
388
404
 
389
405
 
406
+ // ---- OligoNucleotide cell renderer + panel + converters ----
407
+
408
+ @grok.decorators.func({
409
+ name: 'oligoNucleotideCellRenderer',
410
+ description: 'Renders OligoNucleotide (siRNA / ASO) duplex view in grid cells',
411
+ tags: ['cellRenderer'],
412
+ meta: {
413
+ cellType: 'OligoNucleotide',
414
+ columnTags: 'quality=OligoNucleotide',
415
+ role: 'cellRenderer',
416
+ },
417
+ outputs: [{type: 'grid_cell_renderer', name: 'result'}],
418
+ })
419
+ static oligoNucleotideCellRenderer(): DG.GridCellRenderer {
420
+ return new OligoNucleotideCellRenderer();
421
+ }
422
+
423
+ @grok.decorators.func({
424
+ name: 'Oligo-Nucleotide',
425
+ description: 'Modifications, lengths, conjugates and color legend for an OligoNucleotide cell',
426
+ tags: ['panel', 'widgets'],
427
+ outputs: [{type: 'widget', name: 'result'}],
428
+ })
429
+ static oligoNucleotidePanel(
430
+ @grok.decorators.param({type: 'semantic_value', options: {semType: 'OligoNucleotide'}}) value: DG.SemanticValue,
431
+ ): DG.Widget {
432
+ return buildOligoPanel(value);
433
+ }
434
+
435
+ @grok.decorators.func({
436
+ name: 'Oligo Structures',
437
+ description: 'Sense and antisense full molecular structures rendered separately',
438
+ tags: ['panel', 'widgets'],
439
+ outputs: [{type: 'widget', name: 'result'}],
440
+ })
441
+ static oligoNucleotideStructuresPanel(
442
+ @grok.decorators.param({type: 'semantic_value', options: {semType: 'OligoNucleotide'}}) value: DG.SemanticValue,
443
+ ): DG.Widget {
444
+ return buildOligoStructuresPanel(value);
445
+ }
446
+
447
+ // Invoked from the column / cell context menu via detectors.js (no top-menu).
448
+ @grok.decorators.func({
449
+ name: 'convertHelmToOligoNucleotide',
450
+ description: 'Create a new column tagged as OligoNucleotide so HELM duplex cells render with the oligo view',
451
+ })
452
+ static async convertHelmToOligoNucleotide(
453
+ table: DG.DataFrame,
454
+ @grok.decorators.param({options: {caption: 'HELM column', semType: 'Macromolecule'}}) helmCol: DG.Column,
455
+ ): Promise<DG.Column> {
456
+ const out = convertHelmColumnToOligo(table, helmCol);
457
+ await grok.data.detectSemanticTypes(table);
458
+ return out;
459
+ }
460
+
461
+ // Invoked from the column / cell context menu via detectors.js — opens the
462
+ // function editor (`.prepare().edit()`) so the user can pick antisense column.
463
+ @grok.decorators.func({
464
+ name: 'combineSenseAntisenseToOligoNucleotide',
465
+ description: 'Combine separate sense + antisense HELM columns into one OligoNucleotide column',
466
+ })
467
+ static async combineSenseAntisenseToOligoNucleotide(
468
+ table: DG.DataFrame,
469
+ @grok.decorators.param({options: {caption: 'Sense', semType: 'Macromolecule'}}) senseCol: DG.Column,
470
+ @grok.decorators.param({options: {caption: 'Antisense', semType: 'Macromolecule'}}) antiCol: DG.Column,
471
+ ): Promise<DG.Column> {
472
+ const out = combineSenseAntisenseToOligo(table, senseCol, antiCol);
473
+ await grok.data.detectSemanticTypes(table);
474
+ return out;
475
+ }
476
+
390
477
  @grok.decorators.func({
391
478
  name: 'applyNotationProviderForHarmonizedSequence'
392
479
  })
@@ -38,7 +38,7 @@ export const PT_UI_USE_CHIRALITY = 'Chirality engine';
38
38
  export const PT_UI_HIGHLIGHT_MONOMERS = 'Highlight monomers';
39
39
  export const PT_UI_DIALOG_CONVERSION = 'PolyTool Conversion';
40
40
  export const PT_UI_DIALOG_UNRULE = 'PolyTool Unrule';
41
- export const PT_UI_DIALOG_ENUMERATION = 'PolyTool Enumeration';
41
+ export const PT_HELM_UI_DIALOG_ENUMERATION = 'PolyTool Helm Enumeration';
42
42
  export const PT_UI_RULES_USED = 'Rules used';
43
43
 
44
44
  export const PT_ENUM_TYPE_TOOLTIPS: Record<string, string> = {