@datagrok/sequence-translator 0.0.1 → 0.0.5

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 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,29 +1,25 @@
1
- class SequencetranslatorPackageDetectors extends DG.Package {
1
+ class SequenceTranslatorPackageDetectors extends DG.Package {
2
2
  //tags: semTypeDetector
3
3
  //input: column col
4
4
  //output: string semType
5
5
  detectNucleotides(col) {
6
6
  if (col.type === DG.TYPE.STRING) {
7
- if (DG.Detector.sampleCategories(col, (s) => /^[ATGC]{10,}$/.test(s)))
7
+ if (DG.Detector.sampleCategories(col, (s) => isDnaNucleotides(s)))
8
8
  return 'DNA nucleotides';
9
- if (DG.Detector.sampleCategories(col, (s) => /^[AUGC]{10,}$/.test(s)))
9
+ if (DG.Detector.sampleCategories(col, (s) => isRnaNucleotides(s)))
10
10
  return 'RNA nucleotides';
11
- if (DG.Detector.sampleCategories(col, (s) => /^[5678ATGC]{10,}$/.test(s)))
12
- return 'ABI';
13
- if (DG.Detector.sampleCategories(col, (s) => /^[*56789ATGC]{30,}$/.test(s)))
11
+ if (DG.Detector.sampleCategories(col, (s) => isAsoGapmerBioSpring(s)))
14
12
  return 'BioSpring / Gapmers';
15
- if (DG.Detector.sampleCategories(col, (s) => /^(?=.*moe)(?=.*5mC)(?=.*ps){30,}/.test(s)))
13
+ if (DG.Detector.sampleCategories(col, (s) => isAsoGapmerGcrs(s)))
16
14
  return 'GCRS / Gapmers';
17
- if (DG.Detector.sampleCategories(col, (s) => /^[*1-8]{30,}$/.test(s)))
15
+ if (DG.Detector.sampleCategories(col, (s) => isSiRnaBioSpring(s)))
18
16
  return 'BioSpring / siRNA';
19
- if (DG.Detector.sampleCategories(col, (s) => /^[fsACGUacgu]{20,}$/.test(s)))
17
+ if (DG.Detector.sampleCategories(col, (s) => isSiRnaAxolabs(s)))
20
18
  return 'Axolabs / siRNA';
21
- if (DG.Detector.sampleCategories(col, (s) => /^[fmpsACGU]{30,}$/.test(s)))
19
+ if (DG.Detector.sampleCategories(col, (s) => isGcrs(s)))
22
20
  return 'GCRS';
23
- if (DG.Detector.sampleCategories(col, (s) => /^[acgu*]{10,}$/.test(s)))
24
- return 'OP100';
25
- if (DG.Detector.sampleCategories(col, (s) => /^[IiJjKkLlEeFfGgHhQq]{10,}$/.test(s)))
26
- return 'MM12';
21
+ if (DG.Detector.sampleCategories(col, (s) => isMermade12(s)))
22
+ return 'Mermade 12 / siRNA';
27
23
  }
28
24
  }
29
- }
25
+ }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@datagrok/sequence-translator",
3
3
  "friendlyName": "SequenceTranslator",
4
- "version": "0.0.1",
4
+ "version": "0.0.5",
5
5
  "description": "",
6
6
  "dependencies": {
7
+ "@datagrok-libraries/utils": "^0.1.0",
7
8
  "@types/react": "latest",
8
- "datagrok-api": "../../js-api",
9
+ "datagrok-api": ">0.94.10",
9
10
  "datagrok-tools": "^4.1.2",
10
11
  "npm": "^7.11.2",
11
12
  "save-svg-as-png": "^1.4.17",
12
13
  "ts-loader": "latest",
13
- "typescript": "latest"
14
+ "typescript": "latest",
15
+ "openchemlib": "6.0.1"
14
16
  },
15
17
  "scripts": {
18
+ "link-api": "npm link datagrok-api",
16
19
  "debug-sequencetranslator": "grok publish --rebuild",
17
20
  "release-sequencetranslator": "grok publish --rebuild --release",
18
21
  "build-sequencetranslator": "webpack",
@@ -23,7 +26,11 @@
23
26
  "release-sequencetranslator-local": "grok publish local --rebuild --release"
24
27
  },
25
28
  "devDependencies": {
29
+ "@typescript-eslint/eslint-plugin": "^4.29.1",
30
+ "@typescript-eslint/parser": "^4.29.1",
26
31
  "cash-dom": "^8.1.0",
32
+ "eslint": "^7.32.0",
33
+ "eslint-config-google": "^0.14.0",
27
34
  "webpack": "^5.31.0",
28
35
  "webpack-cli": "^4.6.0"
29
36
  }
package/setup.cmd ADDED
@@ -0,0 +1,11 @@
1
+ cd ../../js-api
2
+ call npm install
3
+ call npm link
4
+ cd ../libraries/utils
5
+ call npm install
6
+ call npm link
7
+ call npm link datagrok-api
8
+ cd ../../packages/SequenceTranslator
9
+ call npm install
10
+ call npm link datagrok-api @datagrok-libraries/utils
11
+ webpack
package/src/axolabsMap.ts CHANGED
@@ -1,99 +1,101 @@
1
- const rnaColor = "rgb(255,230,153)";
2
- const invAbasicColor = "rgb(203,119,211)";
3
- export const axolabsMap: {[index: string]: {fullName: string, symbols: [string, string, string, string], color: string}} = {
4
- "RNA": {
5
- fullName: "RNA nucleotides",
6
- symbols: ["A", "C", "G", "U"],
7
- color: rnaColor
8
- },
9
- "DNA": {
10
- fullName: "DNA nucleotides",
11
- symbols: ["dA", "dC", "dG", "dT"],
12
- color: "rgb(197,224,180)"
13
- },
14
- "2'-Fluoro": {
15
- fullName: "2'-Fluoro nucleotides",
16
- symbols: ["Af", "Cf", "Gf", "Uf"],
17
- color: "rgb(68,114,196)"
18
- },
19
- "2'-O-Methyl": {
20
- fullName: "2'-O-Methyl nucleotides",
21
- symbols: ["a", "c", "g", "u"],
22
- color: "rgb(166,166,166)"
23
- },
24
- "2'-O-MOE": {
25
- fullName: "2'-O-MOE nucleotides (including 5-Methyl C)",
26
- symbols: ["Am", "Cm", "Gm", "Tm"],
27
- color: "rgb(112,48,160)"
28
- },
29
- "GNA": {
30
- fullName: "Glycol nucleic acid",
31
- symbols: ["(GNA-A)", "(GNA-C)", "(GNA-G)", "(GNA-T)"],
32
- color: "rgb(255,192,0)"
33
- },
34
- "LNA": {
35
- fullName: "Locked nucleic acid (including 5-Methyl C)",
36
- symbols: ["Ab", "Cb", "Gb", "Tb"],
37
- color: "rgb(54,229,238)"
38
- },
39
- "UNA": {
40
- fullName: "Unlocked nucleotides",
41
- symbols: ["Ao", "Co", "Go", "Uo"],
42
- color: "rgb(255,192,0)"
43
- },
44
- "A": {
45
- fullName: "Adenine",
46
- symbols: ["a", "a", "a", "a"],
47
- color: rnaColor
48
- },
49
- "C": {
50
- fullName: "Cytosine",
51
- symbols: ["c", "c", "c", "c"],
52
- color: rnaColor
53
- },
54
- "G": {
55
- fullName: "Guanine",
56
- symbols: ["g", "g", "g", "g"],
57
- color: rnaColor
58
- },
59
- "U": {
60
- fullName: "Uracil",
61
- symbols: ["u", "u", "u", "u"],
62
- color: rnaColor
63
- },
64
- "X-New": {
65
- fullName: "",
66
- symbols: ["X", "X", "X", "X"],
67
- color: "rgb(108,0,0)"
68
- },
69
- "Y-New": {
70
- fullName: "",
71
- symbols: ["Y", "Y", "Y", "Y"],
72
- color: "rgb(210,146,146)"
73
- },
74
- "Z-New": {
75
- fullName: "",
76
- symbols: ["Z", "Z", "Z", "Z"],
77
- color: "rgb(155,108,132)"
78
- },
79
- "InvAbasic": {
80
- fullName: "Inverted abasic capped",
81
- symbols: ["(invabasic)", "(invabasic)", "(invabasic)", "(invabasic)"],
82
- color: invAbasicColor
83
- },
84
- "5'-vinylps": {
85
- fullName: "5'-vinylphosphonate-2'-OMe-uridine",
86
- symbols: ["(vinu)", "(vinu)", "(vinu)", "(vinu)"],
87
- color: "rgb(0,0,139)"
88
- },
89
- "InvAbasic(o)": {
90
- fullName: "Inverted abasic capped (overhang)",
91
- symbols: ["(invabasic)", "(invabasic)", "(invabasic)", "(invabasic)"],
92
- color: invAbasicColor
93
- },
94
- "2'-OMe-U(o)": {
95
- fullName: "Nucleotide Uridine with 2’O-Methyl protection (overhang)",
96
- symbols: ["mU", "mU", "mU", "mU"],
97
- color: "rgb(65,233,80)"
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
+ };