@datagrok/sequence-translator 1.0.17 → 1.1.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.
Files changed (100) hide show
  1. package/.eslintrc.json +4 -3
  2. package/CHANGELOG.md +36 -0
  3. package/detectors.js +8 -0
  4. package/dist/package-test.js +2 -73079
  5. package/dist/package-test.js.map +1 -0
  6. package/dist/package.js +2 -72284
  7. package/dist/package.js.map +1 -0
  8. package/files/axolabs-style.json +97 -0
  9. package/files/codes-to-symbols.json +67 -0
  10. package/files/formats-to-helm.json +63 -0
  11. package/files/linkers.json +22 -0
  12. package/files/monomer-lib.json +1142 -0
  13. package/link-bio +7 -0
  14. package/package.json +30 -31
  15. package/scripts/build-monomer-lib.py +391 -122
  16. package/src/demo/demo-st-ui.ts +71 -0
  17. package/src/demo/handle-error.ts +12 -0
  18. package/src/model/axolabs/axolabs-tab.ts +111 -0
  19. package/src/model/axolabs/const.ts +33 -0
  20. package/src/{axolabs-tab → model/axolabs}/draw-svg.ts +1 -1
  21. package/src/{axolabs-tab → model/axolabs}/helpers.ts +7 -5
  22. package/src/model/const.ts +18 -0
  23. package/src/model/data-loading-utils/const.ts +8 -0
  24. package/src/model/data-loading-utils/json-loader.ts +38 -0
  25. package/src/model/data-loading-utils/types.ts +30 -0
  26. package/src/model/format-translation/const.ts +8 -0
  27. package/src/model/format-translation/conversion-utils.ts +49 -0
  28. package/src/model/format-translation/format-converter.ts +109 -0
  29. package/src/model/helpers.ts +12 -0
  30. package/src/model/monomer-lib/const.ts +3 -0
  31. package/src/model/monomer-lib/lib-wrapper.ts +119 -0
  32. package/src/model/parsing-validation/format-detector.ts +57 -0
  33. package/src/model/parsing-validation/sequence-validator.ts +52 -0
  34. package/src/model/sequence-to-structure-utils/const.ts +1 -0
  35. package/src/{utils/structures-works → model/sequence-to-structure-utils}/mol-transformations.ts +33 -41
  36. package/src/model/sequence-to-structure-utils/monomer-code-parser.ts +92 -0
  37. package/src/model/sequence-to-structure-utils/sdf-tab.ts +97 -0
  38. package/src/model/sequence-to-structure-utils/sequence-to-molfile.ts +409 -0
  39. package/src/package-test.ts +3 -1
  40. package/src/package.ts +113 -91
  41. package/src/tests/const.ts +24 -0
  42. package/src/tests/formats-support.ts +40 -0
  43. package/src/tests/formats-to-helm.ts +53 -0
  44. package/src/tests/helm-to-nucleotides.ts +28 -0
  45. package/src/view/const/main-tab.ts +3 -0
  46. package/src/view/const/view.ts +10 -0
  47. package/src/view/css/axolabs-tab.css +1 -0
  48. package/src/view/css/colored-text-input.css +27 -0
  49. package/src/view/css/main-tab.css +46 -0
  50. package/src/view/css/sdf-tab.css +39 -0
  51. package/src/view/monomer-lib-viewer/viewer.ts +22 -0
  52. package/src/view/tabs/axolabs.ts +719 -0
  53. package/src/view/tabs/main.ts +174 -0
  54. package/src/view/tabs/sdf.ts +193 -0
  55. package/src/view/utils/app-info-dialog.ts +18 -0
  56. package/src/view/utils/colored-input/colored-text-input.ts +56 -0
  57. package/src/view/utils/colored-input/input-painters.ts +44 -0
  58. package/src/view/utils/draw-molecule.ts +86 -0
  59. package/src/view/utils/molecule-img.ts +106 -0
  60. package/src/view/view.ts +127 -0
  61. package/tsconfig.json +12 -18
  62. package/webpack.config.js +17 -4
  63. package/README.md +0 -84
  64. package/css/style.css +0 -18
  65. package/img/Sequence Translator Axolabs.png +0 -0
  66. package/jest.config.js +0 -33
  67. package/setup-unlink-clean.cmd +0 -14
  68. package/setup-unlink-clean.sh +0 -21
  69. package/setup.cmd +0 -14
  70. package/setup.sh +0 -37
  71. package/src/__jest__/remote.test.ts +0 -77
  72. package/src/__jest__/test-node.ts +0 -97
  73. package/src/apps/oligo-sd-file-app.ts +0 -58
  74. package/src/autostart/calculations.ts +0 -40
  75. package/src/autostart/constants.ts +0 -37
  76. package/src/autostart/registration.ts +0 -306
  77. package/src/axolabs-tab/axolabs-tab.ts +0 -873
  78. package/src/axolabs-tab/define-pattern.ts +0 -874
  79. package/src/hardcode-to-be-eliminated/ICDs.ts +0 -3
  80. package/src/hardcode-to-be-eliminated/IDPs.ts +0 -3
  81. package/src/hardcode-to-be-eliminated/const.ts +0 -5
  82. package/src/hardcode-to-be-eliminated/constants.ts +0 -101
  83. package/src/hardcode-to-be-eliminated/converters.ts +0 -323
  84. package/src/hardcode-to-be-eliminated/map.ts +0 -720
  85. package/src/hardcode-to-be-eliminated/salts.ts +0 -2
  86. package/src/hardcode-to-be-eliminated/sources.ts +0 -3
  87. package/src/hardcode-to-be-eliminated/users.ts +0 -3
  88. package/src/main-tab/main-tab.ts +0 -210
  89. package/src/sdf-tab/sdf-tab.ts +0 -163
  90. package/src/sdf-tab/sequence-codes-tools.ts +0 -347
  91. package/src/tests/smiles-tests.ts +0 -458
  92. package/src/utils/const.ts +0 -0
  93. package/src/utils/helpers.ts +0 -28
  94. package/src/utils/parse.ts +0 -27
  95. package/src/utils/sdf-add-columns.ts +0 -118
  96. package/src/utils/sdf-save-table.ts +0 -56
  97. package/src/utils/structures-works/draw-molecule.ts +0 -84
  98. package/src/utils/structures-works/from-monomers.ts +0 -266
  99. package/test-SequenceTranslator-6288c2fbe346-695b7b55.html +0 -259
  100. package/vendors/openchemlib-full.js +0 -293
@@ -0,0 +1,127 @@
1
+ /* Do not change these import lines to match external modules in webpack configuration */
2
+ import * as grok from 'datagrok-api/grok';
3
+ import * as ui from 'datagrok-api/ui';
4
+ import * as DG from 'datagrok-api/dg';
5
+
6
+ import {MAIN_TAB, AXOLABS_TAB, SDF_TAB} from './const/view';
7
+ import {MainTabUI} from './tabs/main';
8
+ import {SdfTabUI} from './tabs/sdf';
9
+ import {AxolabsTabUI} from './tabs/axolabs';
10
+ import {MonomerLibViewer} from './monomer-lib-viewer/viewer';
11
+
12
+ export class SequenceTranslatorUI {
13
+ constructor() {
14
+ this.view = DG.View.create();
15
+ this.urlRouter = new URLRouter(this.view);
16
+ this.view.box = true;
17
+ this.view.name = 'Sequence Translator';
18
+
19
+ const windows = grok.shell.windows;
20
+ windows.showProperties = false;
21
+ windows.showToolbox = false;
22
+ windows.showHelp = false;
23
+
24
+ const viewMonomerLibIcon = ui.iconFA('book', MonomerLibViewer.view, 'View monomer library');
25
+ this.topPanel = [
26
+ viewMonomerLibIcon,
27
+ ];
28
+ this.view.setRibbonPanels([this.topPanel]);
29
+
30
+ this.tabs = new TabLayout(
31
+ new MainTabUI(),
32
+ new AxolabsTabUI(),
33
+ new SdfTabUI(),
34
+ this.urlRouter
35
+ );
36
+ }
37
+
38
+ private readonly view: DG.View;
39
+ public readonly tabs: TabLayout;
40
+ private readonly topPanel: HTMLElement[];
41
+ private readonly urlRouter: URLRouter;
42
+
43
+ /** Create master layout of the app */
44
+ public async createLayout(): Promise<void> {
45
+ const tabControl = await this.tabs.getControl();
46
+
47
+ const tabName = this.urlRouter.tabName;
48
+ if (tabName)
49
+ tabControl.currentPane = tabControl.getPane(tabName);
50
+ this.view.append(tabControl);
51
+
52
+ grok.shell.addView(this.view);
53
+ }
54
+ };
55
+
56
+ class TabLayout {
57
+ constructor(
58
+ public readonly mainTab: MainTabUI,
59
+ public readonly axolabsTab: AxolabsTabUI,
60
+ public readonly sdfTab: SdfTabUI,
61
+ private readonly urlRouter: URLRouter
62
+ ) {}
63
+
64
+ private control: DG.TabControl | null = null;
65
+
66
+ async getControl(): Promise<DG.TabControl> {
67
+ if (this.control)
68
+ return this.control;
69
+ const control = ui.tabControl({
70
+ [MAIN_TAB]: await this.mainTab.getHtmlElement(),
71
+ [AXOLABS_TAB]: this.axolabsTab.htmlDivElement,
72
+ [SDF_TAB]: await this.sdfTab.getHtmlDivElement(),
73
+ });
74
+
75
+ const sdfPane = control.getPane(SDF_TAB);
76
+ ui.tooltip.bind(sdfPane.header, 'Get atomic-level structure for SS + AS/AS2 and save SDF');
77
+
78
+ const mainPane = control.getPane(MAIN_TAB);
79
+ ui.tooltip.bind(mainPane.header, 'Translate across formats');
80
+
81
+ const axolabsPane = control.getPane(AXOLABS_TAB);
82
+ ui.tooltip.bind(axolabsPane.header, 'Create modification pattern for SS and AS');
83
+
84
+ control.onTabChanged.subscribe(() => {
85
+ if (control.currentPane.name !== MAIN_TAB)
86
+ this.urlRouter.searchParams.delete('seq');
87
+ else {
88
+ this.urlRouter.searchParams.set('seq', this.mainTab.sequence);
89
+ }
90
+ this.urlRouter.updatePath(control);
91
+ });
92
+
93
+ this.control = control;
94
+
95
+ return this.control;
96
+ }
97
+ }
98
+
99
+ class URLRouter {
100
+ constructor(private readonly view: DG.View) {
101
+ this.pathParts = window.location.pathname.split('/');
102
+ this.searchParams = new URLSearchParams(window.location.search);
103
+ }
104
+
105
+ public searchParams: URLSearchParams;
106
+ private pathParts: string[];
107
+
108
+ get urlParamsString(): string {
109
+ return Object.entries(this.searchParams)
110
+ .map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
111
+ }
112
+
113
+ public updatePath(control: DG.TabControl) {
114
+ const urlParamsTxt: string = Object.entries(this.searchParams)
115
+ .map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
116
+ this.view.path = '/apps/SequenceTranslator' + `/${control.currentPane.name}`;
117
+ if (urlParamsTxt)
118
+ this.view.path += `/?${urlParamsTxt}`;
119
+ }
120
+
121
+ get tabName(): string {
122
+ const idx = this.pathParts.findIndex((el) => el === 'SequenceTranslator');
123
+ if (idx === -1) // todo: remove after verification of validity condition
124
+ return '';
125
+ return this.pathParts[idx + 1];
126
+ }
127
+ }
package/tsconfig.json CHANGED
@@ -4,14 +4,13 @@
4
4
 
5
5
  /* Basic Options */
6
6
  // "incremental": true, /* Enable incremental compilation */
7
- "target": "es6",
7
+ "target": "es2022",
8
8
  /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
9
- "module": "es2020",
9
+ "module": "es2022",
10
10
  /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
11
11
  "lib": [
12
- "es2020",
13
- "dom",
14
- "ES2021.String"
12
+ "ES2022",
13
+ "dom"
15
14
  ],
16
15
  /* Specify library files to be included in the compilation. */
17
16
  // "allowJs": true, /* Allow javascript files to be compiled. */
@@ -19,9 +18,9 @@
19
18
  // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
20
19
  // "declaration": true, /* Generates corresponding '.d.ts' file. */
21
20
  // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
22
- // "sourceMap": true, /* Generates corresponding '.map' file. */
21
+ "sourceMap": true, /* Generates corresponding '.map' file. */
23
22
  // "outFile": "./", /* Concatenate and emit output to single file. */
24
- // "outDir": "./", /* Redirect output structure to the directory. */
23
+ "outDir": "./dist", /* Redirect output structure to the directory. */
25
24
  // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
26
25
  // "composite": true, /* Enable project compilation */
27
26
  // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
@@ -32,13 +31,12 @@
32
31
  // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
33
32
 
34
33
  /* Strict Type-Checking Options */
35
- "strict": true,
36
- /* Enable all strict type-checking options. */
34
+ "strict": true, /* Enable all strict type-checking options. */
37
35
  // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
38
36
  // "strictNullChecks": true, /* Enable strict null checks. */
39
37
  // "strictFunctionTypes": true, /* Enable strict checking of function types. */
40
38
  // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
41
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
39
+ "strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
42
40
  // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
43
41
  // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
44
42
 
@@ -51,16 +49,14 @@
51
49
  // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
52
50
 
53
51
  /* Module Resolution Options */
54
- "moduleResolution": "node",
55
- /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
52
+ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
56
53
  // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
57
54
  // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
58
55
  // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
59
56
  // "typeRoots": [], /* List of folders to include type definitions from. */
60
57
  // "types": [], /* Type declaration files to be included in compilation. */
61
58
  // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
62
- "esModuleInterop": true,
63
- /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
59
+ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
64
60
  // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
65
61
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
66
62
 
@@ -75,9 +71,7 @@
75
71
  // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
76
72
 
77
73
  /* Advanced Options */
78
- "skipLibCheck": false,
79
- /* Skip type checking of declaration files. */
80
- "forceConsistentCasingInFileNames": true
81
- /* Disallow inconsistently-cased references to the same file. */
74
+ "skipLibCheck": true, /* Skip type checking of declaration files. */
75
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
82
76
  }
83
77
  }
package/webpack.config.js CHANGED
@@ -12,21 +12,34 @@ module.exports = {
12
12
  }
13
13
  },
14
14
  resolve: {
15
- extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'],
15
+ extensions: ['.ts', '.tsx', '.wasm', '.mjs', '.js', '.json'],
16
16
  },
17
17
  module: {
18
18
  rules: [
19
- {test: /\.tsx?$/, loader: 'ts-loader'}
19
+ {
20
+ test: /\.ts(x?)$/,
21
+ use: 'ts-loader',
22
+ exclude: /node_modules/,
23
+ },
24
+ {
25
+ test: /\.css$/,
26
+ use: ['style-loader', 'css-loader'],
27
+ exclude: /node_modules/,
28
+ },
20
29
  ],
21
30
  },
22
- devtool: 'inline-source-map',
31
+ devtool: 'source-map',
23
32
  externals: {
24
33
  'datagrok-api/dg': 'DG',
25
34
  'datagrok-api/grok': 'grok',
26
35
  'datagrok-api/ui': 'ui',
27
36
  // 'openchemlib/full.js': 'OCL',
28
37
  'rxjs': 'rxjs',
29
- 'rxjs/operators': 'rxjs.operators'
38
+ 'rxjs/operators': 'rxjs.operators',
39
+ 'cash-dom': '$',
40
+ 'dayjs': 'dayjs',
41
+ 'wu': 'wu',
42
+ 'exceljs': 'ExcelJS',
30
43
  },
31
44
  output: {
32
45
  filename: '[name].js',
package/README.md DELETED
@@ -1,84 +0,0 @@
1
- # [Sequence Translator](https://public.datagrok.ai/apps/Sequencetranslator/)
2
-
3
- ![Sequence Translator](img/Sequence%20Translator%20Axolabs.png)
4
-
5
- SequenceTranslator is a [package](https://datagrok.ai/help/develop/develop#packages) for
6
- the [Datagrok](https://datagrok.ai) platform, used to
7
- translate [oligonucleotide](https://en.wikipedia.org/wiki/Oligonucleotide)
8
- sequences
9
- between [different representations](https://github.com/datagrok-ai/public/tree/master/packages/SequenceTranslator#sequence-representations)
10
- .
11
-
12
- Presentation: https://www.youtube.com/watch?v=2xuxJjpjXi4&t=3783s
13
-
14
- Oligonucleotides are characterized by the sequence
15
- of [nucleotide modifications](https://github.com/datagrok-ai/public/tree/master/packages/SequenceTranslator#axolabs-nucleotide-modifications)
16
- that make up the entire molecule. The length of the oligonucleotide is usually 13-25 nucleotides long (denoted by "
17
- -mer").
18
-
19
- Oligonucleotides are chemically synthesized. Chain assembly proceeds in the 3' to 5' direction by following a routine
20
- procedure referred to as a "synthetic cycle". Completion of a single synthetic cycle results in the addition of one
21
- nucleotide residue to the growing chain.
22
-
23
- # Use cases
24
-
25
- | Name | Steps |
26
- |---|---|
27
- | Translate one sequence of types list | Paste sequence into the text field in `MAIN` tab of App |
28
- | Translate many sequences of types list | 1. Open [SequenceTranslator](https://public.datagrok.ai/apps/Sequencetranslator/) <br/>2. Drag & drop an Excel or CSV file with sequences into Datagrok. The platform will detect columns with sequences if they match corresponding RegExp rules <br/>3. Right-click on the column header, then see the `Convert` menu <br/>4. Choose translation function <br/>This will add the result column to the right of the table|
29
- | Translate sequences using new Axolabs pattern | 1. Go to `AXOLABS` tab <br/>2. Drag & drop an Excel or CSV file with sequences into Datagrok <br/>3. Choose your table in the `Table` field <br/>4. Choose `SS Column`, and, if needed, `AS Column` and `ID Column`(needed to add column with concatenated ID and pattern name) <br/>5. Press `Convert Sequences` button <br/>This will add the result column(s) to the right of the table. Save pattern, if needed|
30
- | Translate sequences using existing Axolabs pattern | 1. Go to `AXOLABS` tab <br/>2. Select your pattern in `Load Pattern` field <br/>3. Do steps #2-5 from previous use case |
31
-
32
- # Sequence representations
33
-
34
- In the modification section on the right side of the screen you can select modification for each base in your input
35
- sequence and check if PTO after the base is required.
36
-
37
- Representations are splitted into categories by synthesizer's sequence format(BioSpring/Axolabs/MerMade) and type of
38
- molecule (Gapmers / siRNA).
39
-
40
- | Name | Example | Regular expression |
41
- |---|---|---|
42
- | DNA nucleotides | `AGGTCTTCATGACTTCGGCC` | `^[ATGC]{10,}$` |
43
- | RNA nucleotides | `UUCAACUGCUUACGUCUUU` | `^[AUGC]{10,}$` |
44
- | BioSpring / Gapmers | `6*8*8*5*7*T*T*9*A*T*G*A*9*T*T*7*8*8*7*7` | `^[*56789ATGC]{30,}$` |
45
- | GCRS / Gapmers | `moeAnpsmoeGnpsmoeGnpsmoeUnpsmoe5mCnpsTpsTpsCpsApsTpsGpsApsCpsTpsTpsmoe5mCnpsmoeGnpsmoeGnpsmoe5mCnpsmoe5mC` | `^(?=.*moe)(?=.*5mC)(?=.*ps){30,}` |
46
- | BioSpring / siRNA | `5*1*766354715274575*5*5` | `^[*1-8]{30,}$` |
47
- | Axolabs / siRNA | `usUfscaaCfuGfcUfuAfcGfucususu` | `^[fsACGUacgu]{20,}$` |
48
- | GCRS | `mUpsfUpsmCmAmAfCmUfGmCfUmUfAmCfGmUmCmUpsmUpsmU` | `^[fmpsACGU]{30,}$` |
49
- | OP100 | `ug*aa*uu*ag*ag*ga*ga*cg*ga*cac` | `^[acgu*]{10,}$` |
50
- | MerMade (MM) | `kgKHKGLHIELGJFHKiehK` | `^[IiJjKkLlEeFfGgHhQq]{10,}$` |
51
- | Applied Biosystems Inc. (ABI) | `58877TTTACCACGT56788` | `^[5678ATGC]{10,}$` |
52
-
53
- # Axolabs nucleotide modifications
54
-
55
- | Name | Description | Symbols |
56
- |---|---|---|
57
- | `RNA` | RNA nucleotides | `A, C, G, U` |
58
- | `DNA` | DNA nucleotides | `dA, dC, dG, dT` |
59
- | `2'-Fluoro` | 2'-Fluoro nucleotides | `Af, Cf, Gf, Uf` |
60
- | `2'-O-Methyl` | 2'-O-Methyl nucleotides | `a, c, g, u` |
61
- | `2'-O-MOE` | 2'-O-MOE nucleotides (including 5-Methyl C) | `Am, Cm, Gm, Tm` |
62
- | `GNA` | Glycol nucleic acid | `(GNA-A), (GNA-C), (GNA-G), (GNA-T)` |
63
- | `LNA` | Locked nucleic acid (including 5-Methyl C) | `Ab, Cb, Gb, Tb` |
64
- | `UNA` | Unlocked nucleotides | `Ao, Co, Go, Uo` |
65
- | `A` | Adenine | `a` |
66
- | `C` | Cytosine | `c` |
67
- | `G` | Guanine | `g` |
68
- | `U` | Uracil | `u` |
69
- | `X-New` | | `X` |
70
- | `Y-New` | | `Y` |
71
- | `Z-New` | | `Z` |
72
- | `InvAbasic` | Inverted abasic capped | `(invabasic)` |
73
- | `5'-vinylps` | 5'-vinylphosphonate-2'-OMe-uridine | `(vinu)` |
74
- | `InvAbasic(o)` | Inverted abasic capped (overhang) | `(invabasic)` |
75
- | `2'-OMe-U(o)` | Nucleotide Uridine with 2’O-Methyl protection (overhang) | `mU` |
76
-
77
- # App glossary
78
-
79
- | Term | Definition |
80
- |---|---|
81
- | Pattern | Defines translation rules. Contains: pattern name, modifications and PTO linkages for both strands, and comment, displayed on image |
82
- | PTO linkage | Indicates whether oligonucleotide has phosphorothioated bond (ps linkage) after the base |
83
- | Sense strand (SS) | Contains the exact nucleotide sequence to the mRNA which encodes for a functional protein. Has the information that would be readable on the RNA, and that's called the coding side.|
84
- | Antisense strand (AS) | Non-coding DNA strand of a gene. A cell uses antisense DNA strand as a template for producing messenger RNA (mRNA) that directs the synthesis of a protein. |
package/css/style.css DELETED
@@ -1,18 +0,0 @@
1
- .inputSequence textarea {
2
- resize: none;
3
- min-height: 70px;
4
- width: 100%;
5
- font-family: monospace;
6
- }
7
-
8
- .inputSequence .input-base {
9
- margin: '0';
10
- }
11
-
12
- .inputSequence select {
13
- width: 100%;
14
- }
15
-
16
- .sequence .children {
17
- padding: '5px 0';
18
- }
Binary file
package/jest.config.js DELETED
@@ -1,33 +0,0 @@
1
- module.exports = {
2
- "roots": [
3
- "<rootDir>/src"
4
- ],
5
- "testMatch": [
6
- "**/__jest__/**/*.test.+(ts|tsx)"
7
- ],
8
- moduleFileExtensions: [
9
- 'ts',
10
- 'js',
11
- ],
12
- "transform": {
13
- "^.+\\.(ts|tsx)$": "ts-jest"
14
- },
15
- transformIgnorePatterns: ['^.+\\.js$'],
16
- globals: {
17
- 'ts-jest': {
18
- 'tsconfig': {
19
- "target": "es6",
20
- "module": "es2020",
21
- }
22
- }
23
- },
24
- reporters: [
25
- "default",
26
- [
27
- "./node_modules/jest-html-reporter",
28
- {
29
- "includeConsoleLog": true
30
- }
31
- ]
32
- ]
33
- }
@@ -1,14 +0,0 @@
1
- set package_dir=%cd%
2
-
3
- set dirs=^
4
- \..\..\js-api\ ^
5
- \..\..\libraries\utils\ ^
6
- \..\..\libraries\bio\ ^
7
- \
8
-
9
- call npm uninstall -g datagrok-api @datagrok-libraries/utils @datagrok-libraries/bio
10
-
11
- for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q node_modules
12
- for %%p in (%dirs%) do cd %package_dir%\%%p & rmdir /s /q dist
13
-
14
- rem for %%p in (%dirs%) do cd %package_dir%\%%p & del "package-lock.json"
@@ -1,21 +0,0 @@
1
- #!/bin/bash
2
- package_dir=$(pwd)
3
-
4
- GREEN='\e[0;32m'
5
- NO_COLOR='\e[0m'
6
-
7
- dirs=(
8
- "../../js-api/"
9
- "../../libraries/utils/"
10
- "../../libraries/bio/"
11
- )
12
-
13
- npm uninstall --location=global datagrok-api @datagrok-libraries/utils @datagrok-libraries/ml @datagrok-libraries/bio
14
-
15
- for dir in ${dirs[@]}; do
16
- cd $package_dir
17
- cd $dir
18
- echo -e $GREEN Removing node_modules and dist in $(pwd) $NO_COLOR
19
- rm -rf node_modules dist
20
- # rm package-lock.json
21
- done
package/setup.cmd DELETED
@@ -1,14 +0,0 @@
1
- call setup-unlink-clean.cmd
2
-
3
- set package_dir=%cd%
4
-
5
- set dirs=^
6
- \..\..\js-api\ ^
7
- \..\..\libraries\utils\ ^
8
- \..\..\libraries\bio\ ^
9
- \
10
-
11
- for %%p in (%dirs%) do cd %package_dir%\%%p & call npm install
12
- for %%p in (%dirs%) do cd %package_dir%\%%p & call npm link
13
- for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run link-all
14
- for %%p in (%dirs%) do cd %package_dir%\%%p & call npm run build
package/setup.sh DELETED
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- ./setup-unlink-clean.sh
4
-
5
- GREEN='\e[0;32m'
6
- NO_COLOR='\e[0m'
7
-
8
- package_dir=$(pwd)
9
-
10
- dirs=(
11
- "../../js-api/"
12
- "../../libraries/utils/"
13
- "../../libraries/bio/"
14
- )
15
-
16
- for dir in ${dirs[@]}; do
17
- cd $package_dir
18
- cd $dir
19
- echo -e $GREEN npm install in $(pwd) $NO_COLOR
20
- npm install
21
- echo -e $GREEN npm link in $(pwd) $NO_COLOR
22
- npm link
23
- done
24
-
25
- for dir in ${dirs[@]}; do
26
- cd $package_dir
27
- cd $dir
28
- if [ $dir != "../../js-api/" ]; then
29
- echo -e $GREEN npm link-all in $(pwd) $NO_COLOR
30
- npm run link-all
31
- fi
32
- echo -e $GREEN npm run build in$(pwd) $NO_COLOR
33
- npm run build || exit
34
- done
35
-
36
- cd $package_dir
37
- npm run link-all
@@ -1,77 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
-
5
- import * as utils from './test-node';
6
- import puppeteer from 'puppeteer';
7
-
8
- const P_START_TIMEOUT: number = 3600000;
9
- let browser: puppeteer.Browser;
10
- let page: puppeteer.Page;
11
-
12
- beforeAll(async () => {
13
- let out = await utils.getBrowserPage(puppeteer);
14
- browser = out.browser;
15
- page = out.page;
16
- }, P_START_TIMEOUT);
17
-
18
- afterAll(async () => {
19
- await browser?.close();
20
- });
21
-
22
- expect.extend({
23
- checkOutput(received, expected, context) {
24
- if (received === expected) {
25
- return {
26
- message: () => context,
27
- pass: true
28
- };
29
- } else {
30
- return {
31
- message: () => context,
32
- pass: false
33
- };
34
- }
35
- }
36
- });
37
-
38
- it('TEST', async () => {
39
- const targetPackage:string = process.env.TARGET_PACKAGE ?? 'SequenceTranslator';
40
- console.log(`Testing ${targetPackage} package`);
41
-
42
- let r = await page.evaluate((targetPackage):Promise<object> => {
43
- return new Promise<object>((resolve, reject) => {
44
- (<any>window).grok.functions.eval(targetPackage + ':test()').then((df: any) => {
45
- const cStatus = df.columns.byName('success');
46
- const cSkipped = df.columns.byName('skipped');
47
- const cMessage = df.columns.byName('result');
48
- const cCat = df.columns.byName('category');
49
- const cName = df.columns.byName('name');
50
- const cTime = df.columns.byName('ms');
51
- let failed = false;
52
- let skipReport = '';
53
- let passReport = '';
54
- let failReport = '';
55
- for (let i = 0; i < df.rowCount; i++) {
56
- if (cStatus.get(i)) {
57
- if (cSkipped.get(i)) {
58
- skipReport += `Test result : Skipped : ${cTime.get(i)} : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
59
- } else {
60
- passReport += `Test result : Success : ${cTime.get(i)} : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
61
- }
62
- } else {
63
- failed = true;
64
- failReport += `Test result : Failed : ${cTime.get(i)} : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
65
- }
66
- }
67
- resolve({failReport, skipReport, passReport, failed});
68
- }).catch((e: any) => reject(e));
69
- });
70
- }, targetPackage);
71
- // @ts-ignore
72
- console.log(r.passReport);
73
- // @ts-ignore
74
- console.log(r.skipReport);
75
- // @ts-ignore
76
- expect(r.failed).checkOutput(false, r.failReport);
77
- }, 7200000);
@@ -1,97 +0,0 @@
1
- import * as path from "path";
2
- import * as os from "os";
3
- import * as fs from "fs";
4
- // @ts-ignore
5
- import * as yaml from 'js-yaml';
6
- const fetch = require('node-fetch');
7
-
8
- export async function getToken(url: string, key: string) {
9
- let response = await fetch(`${url}/users/login/dev/${key}`, {method: 'POST'});
10
- let json = await response.json();
11
- if (json.isSuccess == true)
12
- return json.token;
13
- else
14
- throw 'Unable to login to server. Check your dev key';
15
- }
16
-
17
- export async function getWebUrl(url: string, token: string) {
18
- let response = await fetch(`${url}/admin/plugins/admin/settings`, {headers: {Authorization: token}});
19
- let json = await response.json();
20
- return json.settings.webRoot;
21
- }
22
-
23
- const grokDir = path.join(os.homedir(), '.grok');
24
- const confPath = path.join(grokDir, 'config.yaml');
25
-
26
- function mapURL(conf: Config): Indexable {
27
- let urls: Indexable = {};
28
- for (let server in conf.servers) {
29
- urls[conf['servers'][server]['url']] = conf['servers'][server];
30
- }
31
- return urls;
32
- }
33
-
34
- export function getDevKey(hostKey: string): {url: string, key: string} {
35
- let config = yaml.load(fs.readFileSync(confPath, 'utf8')) as any;
36
- let host = hostKey == '' ? config.default : hostKey;
37
- host = host.trim();
38
- let urls = mapURL(config);
39
- let key = '';
40
- let url = '';
41
- try {
42
- let url = new URL(host).href;
43
- if (url.endsWith('/')) url = url.slice(0, -1);
44
- if (url in urls) key = config['servers'][urls[url]]['key'];
45
- } catch (error) {
46
- if (config['servers'][host] == null)
47
- throw `Unknown server alias. Please add it to ${confPath}`;
48
- url = config['servers'][host]['url'];
49
- key = config['servers'][host]['key'];
50
- }
51
- return {url, key};
52
- }
53
-
54
- export async function getBrowserPage(puppeteer: any): Promise<{browser: any, page: any}> {
55
- let url:string = process.env.HOST ?? '';
56
- let cfg = getDevKey(url);
57
- url = cfg.url;
58
-
59
- let key = cfg.key;
60
- let token = await getToken(url, key);
61
- url = await getWebUrl(url, token);
62
- console.log(`Using web root: ${url}`);
63
-
64
- let browser = await puppeteer.launch({
65
- args: ['--disable-dev-shm-usage', '--disable-features=site-per-process'],
66
- ignoreHTTPSErrors: true,
67
- });
68
-
69
- let page = await browser.newPage();
70
- await page.setDefaultNavigationTimeout(0);
71
- await page.goto(`${url}/oauth/`);
72
- await page.setCookie({name: 'auth', value: token});
73
- await page.evaluate((token: any) => {
74
- window.localStorage.setItem('auth', token);
75
- }, token);
76
- await page.goto(url);
77
- try {
78
- // await page.waitForSelector('.grok-preloader', { timeout: 1800000 });
79
- await page.waitForFunction(() => document.querySelector('.grok-preloader') == null, {timeout: 3600000});
80
- } catch (error) {
81
- throw error;
82
- }
83
- return {browser, page};
84
- }
85
-
86
-
87
- interface Config {
88
- servers: {
89
- [alias: string]: {
90
- url: string,
91
- key: string
92
- }
93
- },
94
- default: string,
95
- }
96
-
97
- interface Indexable { [key: string]: any }