@datagrok/sequence-translator 0.0.4 → 0.0.8
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/.eslintrc.json +39 -0
- package/detectors.js +2 -12
- package/package.json +7 -3
- package/src/axolabsMap.ts +101 -99
- package/src/defineAxolabsPattern.ts +240 -211
- package/src/drawAxolabsPattern.ts +127 -92
- package/src/package-test.ts +6 -7
- package/src/package.ts +301 -604
- package/src/salts.ts +2 -0
- package/src/structures-works/converters.ts +288 -0
- package/src/structures-works/from-monomers.ts +73 -0
- package/src/structures-works/map.ts +540 -0
- package/src/structures-works/save-sense-antisense.ts +44 -0
- package/src/structures-works/sequence-codes-tools.ts +236 -0
- package/src/tests/smiles-tests.ts +448 -7
- package/src/map.ts +0 -534
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"google"
|
|
8
|
+
],
|
|
9
|
+
"parser": "@typescript-eslint/parser",
|
|
10
|
+
"parserOptions": {
|
|
11
|
+
"ecmaVersion": 12,
|
|
12
|
+
"sourceType": "module"
|
|
13
|
+
},
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@typescript-eslint"
|
|
16
|
+
],
|
|
17
|
+
"rules": {
|
|
18
|
+
"indent": [
|
|
19
|
+
"error",
|
|
20
|
+
2
|
|
21
|
+
],
|
|
22
|
+
"max-len": [
|
|
23
|
+
"error",
|
|
24
|
+
120
|
|
25
|
+
],
|
|
26
|
+
"require-jsdoc": "off",
|
|
27
|
+
"spaced-comment": "off",
|
|
28
|
+
"linebreak-style": "off",
|
|
29
|
+
"curly": [
|
|
30
|
+
"error",
|
|
31
|
+
"multi-or-nest"
|
|
32
|
+
],
|
|
33
|
+
"brace-style": [
|
|
34
|
+
"error",
|
|
35
|
+
"1tbs",
|
|
36
|
+
{ "allowSingleLine": true }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
package/detectors.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
class SequenceTranslatorPackageDetectors extends DG.Package {
|
|
2
|
-
isDnaNucleotides(sequence) {return /^[ATGC]{6,}$/.test(sequence);}
|
|
3
|
-
isRnaNucleotides(sequence) {return /^[AUGC]{6,}$/.test(sequence);}
|
|
4
|
-
isAsoGapmerBioSpring(sequence) {return /^[*56789ATGC]{6,}$/.test(sequence);}
|
|
5
|
-
isAsoGapmerGcrs(sequence) {return /^(?=.*moe)(?=.*5mC)(?=.*ps){6,}/.test(sequence);}
|
|
6
|
-
isSiRnaBioSpring(sequence) {return /^[*1-8]{6,}$/.test(sequence);}
|
|
7
|
-
isSiRnaAxolabs(sequence) {return /^[fsACGUacgu]{6,}$/.test(sequence);}
|
|
8
|
-
isSiRnaGcrs(sequence) {return /^[fmpsACGU]{6,}$/.test(sequence);} // TODO: insert into detectNucleotides
|
|
9
|
-
isGcrs(sequence) {return /^[fmpsACGU]{6,}$/.test(sequence);}
|
|
10
|
-
isMermade12(sequence) {return /^[IiJjKkLlEeFfGgHhQq]{6,}$/.test(sequence);}
|
|
11
|
-
|
|
12
2
|
//tags: semTypeDetector
|
|
13
3
|
//input: column col
|
|
14
4
|
//output: string semType
|
|
@@ -25,11 +15,11 @@ class SequenceTranslatorPackageDetectors extends DG.Package {
|
|
|
25
15
|
if (DG.Detector.sampleCategories(col, (s) => isSiRnaBioSpring(s)))
|
|
26
16
|
return 'BioSpring / siRNA';
|
|
27
17
|
if (DG.Detector.sampleCategories(col, (s) => isSiRnaAxolabs(s)))
|
|
28
|
-
return 'Axolabs / siRNA';
|
|
18
|
+
return 'Axolabs / siRNA';
|
|
29
19
|
if (DG.Detector.sampleCategories(col, (s) => isGcrs(s)))
|
|
30
20
|
return 'GCRS';
|
|
31
21
|
if (DG.Detector.sampleCategories(col, (s) => isMermade12(s)))
|
|
32
22
|
return 'Mermade 12 / siRNA';
|
|
33
23
|
}
|
|
34
24
|
}
|
|
35
|
-
}
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/sequence-translator",
|
|
3
3
|
"friendlyName": "SequenceTranslator",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@datagrok-libraries/utils": "^0.0
|
|
7
|
+
"@datagrok-libraries/utils": "^0.1.0",
|
|
8
8
|
"@types/react": "latest",
|
|
9
9
|
"datagrok-api": ">0.94.10",
|
|
10
10
|
"datagrok-tools": "^4.1.2",
|
|
@@ -26,8 +26,12 @@
|
|
|
26
26
|
"release-sequencetranslator-local": "grok publish local --rebuild --release"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^4.29.1",
|
|
30
|
+
"@typescript-eslint/parser": "^4.29.1",
|
|
29
31
|
"cash-dom": "^8.1.0",
|
|
32
|
+
"eslint": "^7.32.0",
|
|
33
|
+
"eslint-config-google": "^0.14.0",
|
|
30
34
|
"webpack": "^5.31.0",
|
|
31
35
|
"webpack-cli": "^4.6.0"
|
|
32
36
|
}
|
|
33
|
-
}
|
|
37
|
+
}
|
package/src/axolabsMap.ts
CHANGED
|
@@ -1,99 +1,101 @@
|
|
|
1
|
-
const rnaColor =
|
|
2
|
-
const invAbasicColor =
|
|
3
|
-
export const axolabsMap:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
const rnaColor = 'rgb(255,230,153)';
|
|
2
|
+
const invAbasicColor = 'rgb(255,230,153)';
|
|
3
|
+
export const axolabsMap:
|
|
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: rnaColor,
|
|
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: 'Adenine',
|
|
48
|
+
symbols: ['a', 'a', 'a', 'a'],
|
|
49
|
+
color: rnaColor,
|
|
50
|
+
},
|
|
51
|
+
'C': {
|
|
52
|
+
fullName: 'Cytosine',
|
|
53
|
+
symbols: ['c', 'c', 'c', 'c'],
|
|
54
|
+
color: rnaColor,
|
|
55
|
+
},
|
|
56
|
+
'G': {
|
|
57
|
+
fullName: 'Guanine',
|
|
58
|
+
symbols: ['g', 'g', 'g', 'g'],
|
|
59
|
+
color: rnaColor,
|
|
60
|
+
},
|
|
61
|
+
'U': {
|
|
62
|
+
fullName: 'Uracil',
|
|
63
|
+
symbols: ['u', 'u', 'u', 'u'],
|
|
64
|
+
color: rnaColor,
|
|
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: invAbasicColor,
|
|
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: invAbasicColor,
|
|
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
|
+
};
|