@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
@@ -1,3 +0,0 @@
1
- export const ICDS = `DISPLAY
2
- NO DATA
3
- `;
@@ -1,3 +0,0 @@
1
- export const IDPS = `DISPLAY
2
- NO DATA
3
- `;
@@ -1,5 +0,0 @@
1
- import * as map from './map';
2
-
3
- export const MODIFICATIONS = map.MODIFICATIONS;
4
-
5
- export const standardPhosphateLinkSmiles = 'OP(=O)(O)O';
@@ -1,101 +0,0 @@
1
- const RNA_COLOR = 'rgb(255,230,153)';
2
- const INVABASIC_COLOR = 'rgb(203,119,211)';
3
- export const AXOLABS_MAP:
4
- {[index: string]: {fullName: string, symbols: [string, string, string, string], color: string}} =
5
- {
6
- 'RNA': {
7
- fullName: 'RNA nucleotides',
8
- symbols: ['A', 'C', 'G', 'U'],
9
- color: RNA_COLOR,
10
- },
11
- 'DNA': {
12
- fullName: 'DNA nucleotides',
13
- symbols: ['dA', 'dC', 'dG', 'dT'],
14
- color: 'rgb(197,224,180)',
15
- },
16
- "2\"-Fluoro": {
17
- fullName: '2\'-Fluoro nucleotides',
18
- symbols: ['Af', 'Cf', 'Gf', 'Uf'],
19
- color: 'rgb(68,114,196)',
20
- },
21
- "2\"-O-Methyl": {
22
- fullName: '2\'-O-Methyl nucleotides',
23
- symbols: ['a', 'c', 'g', 'u'],
24
- color: 'rgb(166,166,166)',
25
- },
26
- "2\"-O-MOE": {
27
- fullName: '2\'-O-MOE nucleotides (including 5-Methyl C)',
28
- symbols: ['Am', 'Cm', 'Gm', 'Tm'],
29
- color: 'rgb(112,48,160)',
30
- },
31
- 'GNA': {
32
- fullName: 'Glycol nucleic acid',
33
- symbols: ['(GNA-A)', '(GNA-C)', '(GNA-G)', '(GNA-T)'],
34
- color: 'rgb(255,192,0)',
35
- },
36
- 'LNA': {
37
- fullName: 'Locked nucleic acid (including 5-Methyl C)',
38
- symbols: ['Ab', 'Cb', 'Gb', 'Tb'],
39
- color: 'rgb(54,229,238)',
40
- },
41
- 'UNA': {
42
- fullName: 'Unlocked nucleotides',
43
- symbols: ['Ao', 'Co', 'Go', 'Uo'],
44
- color: 'rgb(255,192,0)',
45
- },
46
- 'A': {
47
- fullName: 'Adenosine',
48
- symbols: ['a', 'a', 'a', 'a'],
49
- color: RNA_COLOR,
50
- },
51
- 'C': {
52
- fullName: 'Cytidine',
53
- symbols: ['c', 'c', 'c', 'c'],
54
- color: RNA_COLOR,
55
- },
56
- 'G': {
57
- fullName: 'Guanosine',
58
- symbols: ['g', 'g', 'g', 'g'],
59
- color: RNA_COLOR,
60
- },
61
- 'U': {
62
- fullName: 'Uridine',
63
- symbols: ['u', 'u', 'u', 'u'],
64
- color: RNA_COLOR,
65
- },
66
- 'X-New': {
67
- fullName: '',
68
- symbols: ['X', 'X', 'X', 'X'],
69
- color: 'rgb(108,0,0)',
70
- },
71
- 'Y-New': {
72
- fullName: '',
73
- symbols: ['Y', 'Y', 'Y', 'Y'],
74
- color: 'rgb(210,146,146)',
75
- },
76
- 'Z-New': {
77
- fullName: '',
78
- symbols: ['Z', 'Z', 'Z', 'Z'],
79
- color: 'rgb(155,108,132)',
80
- },
81
- 'InvAbasic': {
82
- fullName: 'Inverted abasic capped',
83
- symbols: ['(invabasic)', '(invabasic)', '(invabasic)', '(invabasic)'],
84
- color: INVABASIC_COLOR,
85
- },
86
- "5\"-vinylps": {
87
- fullName: '5\'-vinylphosphonate-2\'-OMe-uridine',
88
- symbols: ['(vinu)', '(vinu)', '(vinu)', '(vinu)'],
89
- color: 'rgb(0,0,139)',
90
- },
91
- 'InvAbasic(o)': {
92
- fullName: 'Inverted abasic capped (overhang)',
93
- symbols: ['(invabasic)', '(invabasic)', '(invabasic)', '(invabasic)'],
94
- color: INVABASIC_COLOR,
95
- },
96
- "2\"-OMe-U(o)": {
97
- fullName: 'Nucleotide Uridine with 2\'O-Methyl protection (overhang)',
98
- symbols: ['mU', 'mU', 'mU', 'mU'],
99
- color: 'rgb(65,233,80)',
100
- },
101
- };
@@ -1,323 +0,0 @@
1
- import {lcmsToGcrs, MODIFICATIONS} from './map';
2
- import * as DG from 'datagrok-api/dg';
3
- import {DELIMITER} from './map';
4
- import {sortByStringLengthInDescendingOrder} from '../utils/helpers';
5
- //name: gcrsToLcms
6
- //input: string nucleotides {semType: GCRS}
7
- //output: string result {semType: LCMS}
8
- export function gcrsToLcms(sequence: string): string {
9
- try {
10
- const df = DG.DataFrame.fromCsv(lcmsToGcrs);
11
- const arr1: string[] = df.getCol('GCRS').toList();
12
- const arr2: string[] = df.getCol('LCMS').toList();
13
- const obj: { [i: string]: string } = {};
14
- arr1.forEach((element, index) => obj[element] = arr2[index]);
15
- obj[DELIMITER] = DELIMITER;
16
- const codes = arr1
17
- .concat(DELIMITER)
18
- .concat(Object.keys(MODIFICATIONS));
19
- const sortedCodes = sortByStringLengthInDescendingOrder(codes);
20
- let i = 0;
21
- let r1 = '';
22
- while (i < sequence.length) {
23
- const matchedCode = sortedCodes.find((c) => c == sequence.slice(i, i + c.length))!;
24
- r1 += obj[sequence.slice(i, i + matchedCode.length)];
25
- i += matchedCode.length;
26
- }
27
- while (r1.indexOf('//') != -1)
28
- r1 = r1.replace('//', '/');
29
- return r1;
30
- } catch {
31
- return '<error>';
32
- }
33
- }
34
-
35
- //name: asoGapmersNucleotidesToBioSpring
36
- //input: string nucleotides {semType: DNA nucleotides}
37
- //output: string result {semType: BioSpring / Gapmers}
38
- export function asoGapmersNucleotidesToBioSpring(nucleotides: string): string {
39
- let count: number = -1;
40
- const objForEdges: { [index: string]: string } = {
41
- '(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'T': '5*', 'A': '6*', 'C': '7*', 'G': '8*'};
42
- const objForCenter: { [index: string]: string } = {
43
- '(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'T': 'T*', 'A': 'A*', 'C': '9*', 'G': 'G*'};
44
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|T|C|G)/g, function(x: string) {
45
- count++;
46
- return (count > 4 && count < 15) ? objForCenter[x] : objForEdges[x];
47
- }).slice(0, (nucleotides.endsWith('(invabasic)') || nucleotides.endsWith('(GalNAc-2-JNJ)')) ?
48
- nucleotides.length : 2 * count + 1);
49
- }
50
-
51
- //name: asoGapmersNucleotidesToGcrs
52
- //input: string nucleotides {semType: DNA nucleotides}
53
- //output: string result {semType: GCRS / Gapmers}
54
- export function asoGapmersNucleotidesToGcrs(nucleotides: string): string {
55
- let count: number = -1;
56
- const objForEdges: { [index: string]: string } = {
57
- '(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'T': 'moeUnps',
58
- 'A': 'moeAnps', 'C': 'moe5mCnps', 'G': 'moeGnps'};
59
- const objForCenter: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
60
- 'C': '5mCps', 'A': 'Aps', 'T': 'Tps', 'G': 'Gps'};
61
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|T|C|G)/g, function(x: string) {
62
- count++;
63
- if (count < 5) return (count == 4) ? objForEdges[x].slice(0, -3) + 'ps' : objForEdges[x];
64
- if (count < 15) return (count == 14) ? objForCenter[x].slice(0, -2) + 'nps' : objForCenter[x];
65
- return objForEdges[x];
66
- }).slice(0, (nucleotides.endsWith('(invabasic)') || nucleotides.endsWith('(GalNAc-2-JNJ)')) ?
67
- nucleotides.length : -3);
68
- }
69
-
70
- //name: asoGapmersBioSpringToNucleotides
71
- //input: string nucleotides {semType: BioSpring / Gapmers}
72
- //output: string result {semType: DNA nucleotides}
73
- export function asoGapmersBioSpringToNucleotides(nucleotides: string): string {
74
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
75
- '*': '', '5': 'T', '6': 'A', '7': 'C', '8': 'G', '9': 'C'};
76
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|\*|5|6|7|8|9)/g, function(x: string) {return obj[x];});
77
- }
78
-
79
- //name: asoGapmersBioSpringToGcrs
80
- //input: string nucleotides {semType: BioSpring / Gapmers}
81
- //output: string result {semType: GCRS / Gapmers}
82
- export function asoGapmersBioSpringToGcrs(nucleotides: string): string {
83
- let count: number = -1;
84
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
85
- '5*': 'moeUnps', '6*': 'moeAnps', '7*': 'moe5mCnps', '8*': 'moeGnps', '9*': '5mCps', 'A*': 'Aps', 'T*': 'Tps',
86
- 'G*': 'Gps', 'C*': 'Cps', '5': 'moeU', '6': 'moeA', '7': 'moe5mC', '8': 'moeG',
87
- };
88
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|5\*|6\*|7\*|8\*|9\*|A\*|T\*|G\*|C\*|5|6|7|8)/g,
89
- function(x: string) {
90
- count++;
91
- return (count == 4) ? obj[x].slice(0, -3) + 'ps' : (count == 14) ? obj[x].slice(0, -2) + 'nps' : obj[x];
92
- });
93
- }
94
-
95
-
96
- //name: asoGapmersGcrsToBioSpring
97
- //input: string nucleotides {semType: GCRS / Gapmers}
98
- //output: string result {semType: BioSpring / Gapmers}
99
- export function asoGapmersGcrsToBioSpring(nucleotides: string): string {
100
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
101
- 'fU': '1', 'fA': '2', 'fC': '3', 'fG': '4', 'mU': '5', 'mA': '6', 'mC': '7', 'mG': '8',
102
- 'moeT': '5', 'moeA': '6', 'moe5mC': '7', 'moeG': '8', 'moeU': '5', '5mC': '9', 'nps': '*', 'ps': '*', 'U': 'T',
103
- };
104
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|fU|fA|fC|fG|mU|mA|mC|mG|moeT|moeA|moe5mC|moeG|moeU|5mC|nps|ps|U)/g,
105
- function(x: string) {return obj[x];});
106
- }
107
-
108
- //name: asoGapmersGcrsToNucleotides
109
- //input: string nucleotides {semType: GCRS / Gapmers}
110
- //output: string result {semType: DNA nucleotides}
111
- export function asoGapmersGcrsToNucleotides(nucleotides: string) {
112
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
113
- 'moe': '', '5m': '', 'n': '', 'ps': '', 'U': 'T'};
114
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|moe|5m|n|ps|U)/g, function(x: string) {return obj[x];});
115
- }
116
-
117
- //name: siRnaBioSpringToNucleotides
118
- //input: string nucleotides {semType: BioSpring / siRNA}
119
- //output: string result {semType: RNA nucleotides}
120
- export function siRnaBioSpringToNucleotides(nucleotides: string) {
121
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
122
- '1': 'U', '2': 'A', '3': 'C', '4': 'G', '5': 'U', '6': 'A', '7': 'C', '8': 'G', '*': ''};
123
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|1|2|3|4|5|6|7|8|\*)/g,
124
- function(x: string) {return obj[x];});
125
- }
126
-
127
- //name: siRnaBioSpringToAxolabs
128
- //input: string nucleotides {semType: BioSpring / siRNA}
129
- //output: string result {semType: Axolabs / siRNA}
130
- export function siRnaBioSpringToAxolabs(nucleotides: string) {
131
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
132
- '1': 'Uf', '2': 'Af', '3': 'Cf', '4': 'Gf', '5': 'u', '6': 'a', '7': 'c', '8': 'g', '*': 's'};
133
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|1|2|3|4|5|6|7|8|\*)/g,
134
- function(x: string) {return obj[x];});
135
- }
136
-
137
-
138
- //name: siRnaBioSpringToGcrs
139
- //input: string nucleotides {semType: BioSpring / siRNA}
140
- //output: string result {semType: GCRS}
141
- export function siRnaBioSpringToGcrs(nucleotides: string) {
142
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
143
- '1': 'fU', '2': 'fA', '3': 'fC', '4': 'fG', '5': 'mU', '6': 'mA', '7': 'mC', '8': 'mG', '*': 'ps'};
144
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|1|2|3|4|5|6|7|8|\*)/g,
145
- function(x: string) {return obj[x];});
146
- }
147
-
148
- //name: siRnaAxolabsToGcrs
149
- //input: string nucleotides {semType: Axolabs / siRNA}
150
- //output: string result {semType: GCRS}
151
- export function siRnaAxolabsToGcrs(nucleotides: string) {
152
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
153
- 'Uf': 'fU', 'Af': 'fA', 'Cf': 'fC', 'Gf': 'fG', 'u': 'mU', 'a': 'mA', 'c': 'mC', 'g': 'mG', 's': 'ps',
154
- };
155
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|Uf|Af|Cf|Gf|u|a|c|g|s)/g,
156
- function(x: string) {return obj[x];});
157
- }
158
-
159
- //name: siRnaAxolabsToBioSpring
160
- //input: string nucleotides {semType: Axolabs / siRNA}
161
- //output: string result {semType: BioSpring / siRNA}
162
- export function siRnaAxolabsToBioSpring(nucleotides: string) {
163
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
164
- 'Uf': '1', 'Af': '2', 'Cf': '3', 'Gf': '4', 'u': '5', 'a': '6', 'c': '7', 'g': '8', 's': '*',
165
- };
166
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|Uf|Af|Cf|Gf|u|a|c|g|s)/g,
167
- function(x: string) {return obj[x];});
168
- }
169
-
170
- //name: siRnaAxolabsToNucleotides
171
- //input: string nucleotides {semType: Axolabs / siRNA}
172
- //output: string result {semType: RNA nucleotides}
173
- export function siRnaAxolabsToNucleotides(nucleotides: string) {
174
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
175
- 'Uf': 'U', 'Af': 'A', 'Cf': 'C', 'Gf': 'G', 'u': 'U', 'a': 'A', 'c': 'C', 'g': 'G', 's': '',
176
- };
177
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|Uf|Af|Cf|Gf|u|a|c|g|s)/g,
178
- function(x: string) {return obj[x];});
179
- }
180
-
181
-
182
- //name: siRnaGcrsToNucleotides
183
- //input: string nucleotides {semType: GCRS}
184
- //output: string result {semType: RNA nucleotides}
185
- export function siRnaGcrsToNucleotides(nucleotides: string) {
186
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
187
- 'fU': 'U', 'fA': 'A', 'fC': 'C', 'fG': 'G', 'mU': 'U', 'mA': 'A', 'mC': 'C', 'mG': 'G', 'ps': '',
188
- };
189
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|fU|fA|fC|fG|mU|mA|mC|mG|ps)/g,
190
- function(x: string) {return obj[x];});
191
- }
192
-
193
- //name: siRnaGcrsToBioSpring
194
- //input: string nucleotides {semType: GCRS}
195
- //output: string result {semType: BioSpring / siRNA}
196
- export function siRnaGcrsToBioSpring(nucleotides: string) {
197
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
198
- 'fU': '1', 'fA': '2', 'fC': '3', 'fG': '4', 'mU': '5', 'mA': '6', 'mC': '7', 'mG': '8', 'ps': '*',
199
- };
200
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|fU|fA|fC|fG|mU|mA|mC|mG|ps)/g,
201
- function(x: string) {return obj[x];});
202
- }
203
-
204
- //name: siRnaGcrsToAxolabs
205
- //input: string nucleotides {semType: GCRS}
206
- //output: string result {semType: Axolabs / siRNA}
207
- export function siRnaGcrsToAxolabs(nucleotides: string) {
208
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
209
- 'fU': 'Uf', 'fA': 'Af', 'fC': 'Cf', 'fG': 'Gf', 'mU': 'u', 'mA': 'a', 'mC': 'c', 'mG': 'g', 'ps': 's',
210
- };
211
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|fU|fA|fC|fG|mU|mA|mC|mG|ps)/g,
212
- function(x: string) {return obj[x];});
213
- }
214
-
215
- //name: siRnaNucleotideToBioSpringSenseStrand
216
- //input: string nucleotides {semType: RNA nucleotides}
217
- //output: string result {semType: BioSpring / siRNA}
218
- export function siRnaNucleotideToBioSpringSenseStrand(nucleotides: string) {
219
- let count: number = -1;
220
- const objForLeftEdge: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
221
- 'A': '6*', 'U': '5*', 'G': '8*', 'C': '7*'};
222
- const objForRightEdge: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
223
- 'A': '*6', 'U': '*5', 'G': '*8', 'C': '*7'};
224
- const objForOddIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
225
- 'A': '6', 'U': '5', 'G': '8', 'C': '7'};
226
- const objForEvenIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)',
227
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': '2', 'U': '1', 'G': '4', 'C': '3'};
228
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|U|G|C)/g, function(x: string) {
229
- count++;
230
- if (count < 2) return objForLeftEdge[x];
231
- if (count > nucleotides.length - 3) return objForRightEdge[x];
232
- return (count % 2 == 0) ? objForEvenIndices[x] : objForOddIndices[x];
233
- });
234
- }
235
-
236
- //name: siRnaNucleotidesToGcrs
237
- //input: string nucleotides {semType: RNA nucleotides}
238
- //output: string result {semType: GCRS}
239
- export function siRnaNucleotidesToGcrs(nucleotides: string) {
240
- let count: number = -1;
241
- const objForLeftEdge: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
242
- 'A': 'mAps', 'U': 'mUps', 'G': 'mGps', 'C': 'mCps'};
243
- const objForRightEdge: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
244
- 'A': 'psmA', 'U': 'psmU', 'G': 'psmG', 'C': 'psmC'};
245
- const objForEvenIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)',
246
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'fA', 'U': 'fU', 'G': 'fG', 'C': 'fC'};
247
- const objForOddIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)',
248
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'mA', 'U': 'mU', 'G': 'mG', 'C': 'mC'};
249
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|U|G|C)/g, function(x: string) {
250
- count++;
251
- if (count < 2) return objForLeftEdge[x];
252
- if (count > nucleotides.length - 3) return objForRightEdge[x];
253
- return (count % 2 == 0) ? objForEvenIndices[x] : objForOddIndices[x];
254
- });
255
- }
256
-
257
- //name: siRnaNucleotideToAxolabsSenseStrand
258
- //input: string nucleotides {semType: RNA nucleotides}
259
- //output: string result {semType: Axolabs}
260
- export function siRnaNucleotideToAxolabsSenseStrand(nucleotides: string) {
261
- let count: number = -1;
262
- const objForLeftEdge: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
263
- 'A': 'as', 'U': 'us', 'G': 'gs', 'C': 'cs'};
264
- const objForSomeIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)',
265
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'Af', 'U': 'Uf', 'G': 'Gf', 'C': 'Cf'};
266
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
267
- 'A': 'a', 'U': 'u', 'G': 'g', 'C': 'c'};
268
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|U|G|C)/g, function(x: string) {
269
- count++;
270
- if (count < 2) return objForLeftEdge[x];
271
- if (count == 6 || (count > 7 && count < 11)) return objForSomeIndices[x];
272
- if (count == nucleotides.length - 1) return 'a';
273
- return obj[x];
274
- });
275
- }
276
-
277
- //name: siRnaNucleotideToAxolabsAntisenseStrand
278
- //input: string nucleotides {semType: RNA nucleotides}
279
- //output: string result {semType: Axolabs}
280
- export function siRnaNucleotideToAxolabsAntisenseStrand(nucleotides: string) {
281
- let count: number = -1;
282
- const objForSmallLinkages: {[index: string]: string} = {'(invabasic)': '(invabasic)',
283
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'as', 'U': 'us', 'G': 'gs', 'C': 'cs'};
284
- const objForBigLinkages: {[index: string]: string} = {'(invabasic)': '(invabasic)',
285
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'Afs', 'U': 'Ufs', 'G': 'Gfs', 'C': 'Cfs'};
286
- const objForSomeIndices: {[index: string]: string} = {'(invabasic)': '(invabasic)',
287
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'Af', 'U': 'Uf', 'G': 'Gf', 'C': 'Cf'};
288
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)',
289
- '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)', 'A': 'a', 'U': 'u', 'G': 'g', 'C': 'c'};
290
- return nucleotides.replace(/(\(invabasic\)|\(GalNAc-2-JNJ\)|A|U|G|C)/g, function(x: string) {
291
- count++;
292
- if (count > 19 && count < 22) return objForSmallLinkages[x];
293
- if (count == 0) return 'us';
294
- if (count == 1) return objForBigLinkages[x];
295
- return (count == 5 || count == 7 || count == 8 || count == 13 || count == 15) ? objForSomeIndices[x] : obj[x];
296
- });
297
- }
298
-
299
- //name: gcrsToNucleotides
300
- //input: string nucleotides {semType: GCRS}
301
- //output: string result {semType: RNA nucleotides}
302
- export function gcrsToNucleotides(nucleotides: string) {
303
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
304
- 'mAps': 'A', 'mUps': 'U', 'mGps': 'G', 'mCps': 'C', 'fAps': 'A', 'fUps': 'U', 'fGps': 'G', 'fCps': 'C',
305
- 'fU': 'U', 'fA': 'A', 'fC': 'C', 'fG': 'G', 'mU': 'U', 'mA': 'A', 'mC': 'C', 'mG': 'G',
306
- };
307
- return nucleotides.replace(
308
- /(\(invabasic\)|\(GalNAc-2-JNJ\)|mAps|mUps|mGps|mCps|fAps|fUps|fGps|fCps|fU|fA|fC|fG|mU|mA|mC|mG)/g,
309
- function(x: string) {return obj[x];});
310
- }
311
-
312
- //name: gcrsToMermade12
313
- //input: string nucleotides {semType: GCRS}
314
- //output: string result {semType: Mermade 12 / siRNA}
315
- export function gcrsToMermade12(nucleotides: string) {
316
- const obj: {[index: string]: string} = {'(invabasic)': '(invabasic)', '(GalNAc-2-JNJ)': '(GalNAc-2-JNJ)',
317
- 'mAps': 'e', 'mUps': 'h', 'mGps': 'g', 'mCps': 'f', 'fAps': 'i', 'fUps': 'l', 'fGps': 'k', 'fCps': 'j', 'fU': 'L',
318
- 'fA': 'I', 'fC': 'J', 'fG': 'K', 'mU': 'H', 'mA': 'E', 'mC': 'F', 'mG': 'G',
319
- };
320
- return nucleotides.replace(
321
- /(\(invabasic\)|\(GalNAc-2-JNJ\)|mAps|mUps|mGps|mCps|fAps|fUps|fGps|fCps|fU|fA|fC|fG|mU|mA|mC|mG)/g,
322
- function(x: string) {return obj[x];});
323
- }