@datagrok/sequence-translator 1.10.3 → 1.10.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/sequence-translator",
3
3
  "friendlyName": "Sequence Translator",
4
- "version": "1.10.3",
4
+ "version": "1.10.4",
5
5
  "author": {
6
6
  "name": "Davit Rizhinashvili",
7
7
  "email": "drizhinashvili@datagrok.ai"
@@ -74,7 +74,7 @@ export namespace funcs {
74
74
  }
75
75
 
76
76
  /**
77
- Perform cyclization of polymers
77
+ editor for Performing conversion of sequences in custom notation to molfiles
78
78
  */
79
79
  export async function polyToolConvertTopMenu(): Promise<void> {
80
80
  return await grok.functions.call('SequenceTranslator:PolyToolConvertTopMenu', {});
@@ -89,14 +89,14 @@ export namespace funcs {
89
89
  }
90
90
 
91
91
  /**
92
- Perform cyclization of polymers
92
+ Dialog for configuring enumeration of a HELM sequence
93
93
  */
94
94
  export async function polyToolEnumerateHelmTopMenu(): Promise<void> {
95
95
  return await grok.functions.call('SequenceTranslator:PolyToolEnumerateHelmTopMenu', {});
96
96
  }
97
97
 
98
98
  /**
99
- Perform cyclization of polymers
99
+ Perform enumeration of a molecule using different fragments at specified positions
100
100
  */
101
101
  export async function polyToolEnumerateChemTopMenu(): Promise<void> {
102
102
  return await grok.functions.call('SequenceTranslator:PolyToolEnumerateChemTopMenu', {});
@@ -126,6 +126,20 @@ export namespace funcs {
126
126
  return await grok.functions.call('SequenceTranslator:GetPtChemEnumeratorDialog', { cell });
127
127
  }
128
128
 
129
+ /**
130
+ Enumerate provided HELM sequence on provided positions with provided monomers and generates new table
131
+ */
132
+ export async function enumerateSingleHelmSequence(helmSequence: string , positions: any , monomerLists: any , toAtomicLevel: boolean ): Promise<DG.DataFrame> {
133
+ return await grok.functions.call('SequenceTranslator:EnumerateSingleHelmSequence', { helmSequence, positions, monomerLists, toAtomicLevel });
134
+ }
135
+
136
+ /**
137
+ Enumerate provided HELM sequence on all positions with natural amino acids and generates new table. Generated table has sequence column called "Enumerated", and molecule column called "Molfile(Enumerated) if toAtomicLevel is set to true. Keywords: Optimize, enumerate, HELM optimization, Maximize Minimize property. When you want to optimize certain peptide using for example logS, set toAtomicLevel to true and use generated molecule column to calculate given property using chem package functions.
138
+ */
139
+ export async function enumerateSingleHelmSequenceWithNaturalAAs(helmSequence: string , toAtomicLevel: boolean ): Promise<DG.DataFrame> {
140
+ return await grok.functions.call('SequenceTranslator:EnumerateSingleHelmSequenceWithNaturalAAs', { helmSequence, toAtomicLevel });
141
+ }
142
+
129
143
  export async function getPolyToolCombineDialog(): Promise<void> {
130
144
  return await grok.functions.call('SequenceTranslator:GetPolyToolCombineDialog', {});
131
145
  }
package/src/package.g.ts CHANGED
@@ -104,7 +104,7 @@ export async function translateOligonucleotideSequence(sequence: string, sourceF
104
104
  }
105
105
 
106
106
  //name: polyToolConvert
107
- //description: Perform cyclization of polymers
107
+ //description: editor for Performing conversion of sequences in custom notation to molfiles
108
108
  //top-menu: Bio | PolyTool | Convert...
109
109
  export async function polyToolConvertTopMenu() : Promise<void> {
110
110
  await PackageFunctions.polyToolConvertTopMenu();
@@ -129,14 +129,14 @@ export async function polyToolConvert2(table: DG.DataFrame, seqCol: DG.Column, g
129
129
  }
130
130
 
131
131
  //name: polyToolEnumerateHelm
132
- //description: Perform cyclization of polymers
132
+ //description: Dialog for configuring enumeration of a HELM sequence
133
133
  //top-menu: Bio | PolyTool | Enumerate HELM...
134
134
  export async function polyToolEnumerateHelmTopMenu() : Promise<void> {
135
135
  await PackageFunctions.polyToolEnumerateHelmTopMenu();
136
136
  }
137
137
 
138
138
  //name: polyToolEnumerateChem
139
- //description: Perform cyclization of polymers
139
+ //description: Perform enumeration of a molecule using different fragments at specified positions
140
140
  //top-menu: Bio | PolyTool | Enumerate Chem...
141
141
  export async function polyToolEnumerateChemTopMenu() : Promise<void> {
142
142
  await PackageFunctions.polyToolEnumerateChemTopMenu();
@@ -181,6 +181,26 @@ export async function getPtChemEnumeratorDialog(cell?: any) : Promise<void> {
181
181
  await PackageFunctions.getPtChemEnumeratorDialog(cell);
182
182
  }
183
183
 
184
+ //name: Enumerate Single HELM Sequence
185
+ //description: Enumerate provided HELM sequence on provided positions with provided monomers and generates new table
186
+ //input: string helmSequence
187
+ //input: list<double> positions
188
+ //input: dynamic monomerLists
189
+ //input: bool toAtomicLevel
190
+ //output: dataframe result
191
+ export async function enumerateSingleHelmSequence(helmSequence: string, positions: number[], monomerLists: any, toAtomicLevel: boolean) : Promise<any> {
192
+ return await PackageFunctions.enumerateSingleHelmSequence(helmSequence, positions, monomerLists, toAtomicLevel);
193
+ }
194
+
195
+ //name: Enumerate Single HELM Sequence with natural amino acids
196
+ //description: Enumerate provided HELM sequence on all positions with natural amino acids and generates new table. Generated table has sequence column called "Enumerated", and molecule column called "Molfile(Enumerated) if toAtomicLevel is set to true. Keywords: Optimize, enumerate, HELM optimization, Maximize Minimize property. When you want to optimize certain peptide using for example logS, set toAtomicLevel to true and use generated molecule column to calculate given property using chem package functions.
197
+ //input: string helmSequence
198
+ //input: bool toAtomicLevel
199
+ //output: dataframe result
200
+ export async function enumerateSingleHelmSequenceWithNaturalAAs(helmSequence: string, toAtomicLevel: boolean) : Promise<any> {
201
+ return await PackageFunctions.enumerateSingleHelmSequenceWithNaturalAAs(helmSequence, toAtomicLevel);
202
+ }
203
+
184
204
  //name: Combine Sequences
185
205
  //top-menu: Bio | PolyTool | Combine Sequences...
186
206
  export async function getPolyToolCombineDialog() : Promise<void> {
package/src/package.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-len */
1
2
  import * as grok from 'datagrok-api/grok';
2
3
  import * as ui from 'datagrok-api/ui';
3
4
  import * as DG from 'datagrok-api/dg';
@@ -17,16 +18,18 @@ import {defaultErrorHandler} from './utils/err-info';
17
18
 
18
19
  import {polyToolConvert, polyToolConvertUI} from './polytool/pt-dialog';
19
20
  import {polyToolEnumerateChemUI} from './polytool/pt-dialog';
20
- import {polyToolEnumerateHelmUI} from './polytool/pt-enumerate-seq-dialog';
21
+ import {polyToolEnumerateHelmUI, polyToolEnumerateSeq} from './polytool/pt-enumerate-seq-dialog';
21
22
  import {_setPeptideColumn} from './polytool/utils';
22
23
  import {PolyToolCsvLibHandler} from './polytool/csv-to-json-monomer-lib-converter';
23
24
  import {ITranslationHelper} from './types';
24
25
  import {PolyToolConvertFuncEditor} from './polytool/pt-convert-editor';
25
26
  import {CyclizedNotationProvider} from './utils/cyclized';
26
27
  import {getSeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
27
- import {PolyToolTags} from './consts';
28
+ import {PolyToolDataRole, PolyToolTags} from './consts';
28
29
  import {getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
29
30
  import {getPTCombineDialog} from './polytool/pt-combine-dialog';
31
+ import {PolyToolEnumeratorTypes} from './polytool/types';
32
+ import {splitterAsHelm} from '@datagrok-libraries/bio/src/utils/macromolecule';
30
33
 
31
34
  export * from './package.g';
32
35
 
@@ -220,7 +223,7 @@ export class PackageFunctions {
220
223
  @grok.decorators.func({
221
224
  'top-menu': 'Bio | PolyTool | Convert...',
222
225
  'name': 'polyToolConvert',
223
- 'description': 'Perform cyclization of polymers'
226
+ 'description': 'editor for Performing conversion of sequences in custom notation to molfiles'
224
227
  })
225
228
  static async polyToolConvertTopMenu(): Promise<void> {
226
229
  await polyToolConvertUI();
@@ -252,7 +255,7 @@ export class PackageFunctions {
252
255
  @grok.decorators.func({
253
256
  'top-menu': 'Bio | PolyTool | Enumerate HELM...',
254
257
  'name': 'polyToolEnumerateHelm',
255
- 'description': 'Perform cyclization of polymers'
258
+ 'description': 'Dialog for configuring enumeration of a HELM sequence'
256
259
  })
257
260
  static async polyToolEnumerateHelmTopMenu(): Promise<void> {
258
261
  await polyToolEnumerateHelmUI(grok.shell.tv?.dataFrame.currentCell);
@@ -262,7 +265,7 @@ export class PackageFunctions {
262
265
  @grok.decorators.func({
263
266
  'top-menu': 'Bio | PolyTool | Enumerate Chem...',
264
267
  'name': 'polyToolEnumerateChem',
265
- 'description': 'Perform cyclization of polymers'
268
+ 'description': 'Perform enumeration of a molecule using different fragments at specified positions'
266
269
  })
267
270
  static async polyToolEnumerateChemTopMenu(): Promise<void> {
268
271
  polyToolEnumerateChemUI();
@@ -333,6 +336,41 @@ export class PackageFunctions {
333
336
  return polyToolEnumerateChemUI(cell);
334
337
  }
335
338
 
339
+ @grok.decorators.func({
340
+ name: 'Enumerate Single HELM Sequence',
341
+ description: 'Enumerate provided HELM sequence on provided positions with provided monomers and generates new table',
342
+ outputs: [{type: 'dataframe', name: 'result'}]
343
+ })
344
+ static async enumerateSingleHelmSequence(
345
+ helmSequence: string, positions: number[], monomerLists: string[][], toAtomicLevel: boolean = false
346
+ ): Promise<DG.DataFrame> {
347
+ return await polyToolEnumerateSeq(helmSequence, PolyToolDataRole.macromolecule, null, {
348
+ type: PolyToolEnumeratorTypes.Single,
349
+ placeholders: positions.map((pos, i) => ({position: pos, monomers: monomerLists[i]}))
350
+ }, toAtomicLevel ? {
351
+ generateHelm: true,
352
+ chiralityEngine: true,
353
+ highlightMonomers: false,
354
+ rules: []
355
+ } : false, _package.helmHelper);
356
+ }
357
+
358
+ @grok.decorators.func({
359
+ name: 'Enumerate Single HELM Sequence with natural amino acids',
360
+ description: 'Enumerate provided HELM sequence on all positions with natural amino acids and generates new table. Generated table has sequence column called "Enumerated", and molecule column called "Molfile(Enumerated) if toAtomicLevel is set to true. Keywords: Optimize, enumerate, HELM optimization, Maximize Minimize property. When you want to optimize certain peptide using for example logS, set toAtomicLevel to true and use generated molecule column to calculate given property using chem package functions.',
361
+ outputs: [{type: 'dataframe', name: 'result'}]
362
+ })
363
+ static async enumerateSingleHelmSequenceWithNaturalAAs(
364
+ helmSequence: string, toAtomicLevel: boolean = false
365
+ ): Promise<DG.DataFrame> {
366
+ const splitt = splitterAsHelm(helmSequence);
367
+ const l = splitt.length;
368
+ const positions = Array.from({length: l}, (_, i) => i);
369
+ const monomerLists = positions.map((_part) => {
370
+ return [...['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y']];
371
+ });
372
+ return await PackageFunctions.enumerateSingleHelmSequence(helmSequence, positions, monomerLists, toAtomicLevel);
373
+ }
336
374
 
337
375
  @grok.decorators.func({
338
376
  'name': 'Combine Sequences',
@@ -697,7 +697,7 @@ async function getPolyToolEnumerateDialog(
697
697
  * @param {DG.SemanticValue} srcValue Source value to enumerate, either of data role
698
698
  * {@link PolyToolDataRole.template} or {@link PolyToolDataRole.macromolecule}
699
699
  * */
700
- async function polyToolEnumerateSeq(
700
+ export async function polyToolEnumerateSeq(
701
701
  srcHelm: string, dataRole: PolyToolDataRole, srcId: { value: string, colName: string } | null,
702
702
  params: PolyToolEnumeratorParams,
703
703
  toAtomicLevel: { generateHelm: boolean, chiralityEngine: boolean, highlightMonomers: boolean, rules: string[] } | false,