@datagrok/peptides 0.4.3 → 0.7.1

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.
@@ -2,240 +2,351 @@ import * as grok from 'datagrok-api/grok';
2
2
  import * as ui from 'datagrok-api/ui';
3
3
  import * as DG from 'datagrok-api/dg';
4
4
 
5
-
5
+ /**
6
+ * Chem palette class.
7
+ *
8
+ * @export
9
+ * @class ChemPalette
10
+ */
6
11
  export class ChemPalette {
7
- cp: {[key: string]: string} = {};
12
+ cp: {[key: string]: string} = {};
8
13
 
9
- constructor(scheme: string, grouping = false) {
10
- if (scheme == 'grok') {
11
- this.cp = ChemPalette.getDatagrok(grouping);
12
- }
14
+ /**
15
+ * Creates an instance of ChemPalette.
16
+ *
17
+ * @param {string} scheme Color scheme to use.
18
+ * @param {boolean} [grouping=false] Is grouping enabled.
19
+ * @memberof ChemPalette
20
+ */
21
+ constructor(scheme: string, grouping = false) {
22
+ if (scheme == 'grok') {
23
+ this.cp = ChemPalette.getDatagrok(grouping);
13
24
  }
25
+ }
14
26
 
15
- showTooltip(cell:DG.GridCell, x:number, y:number) {
16
- const s = cell.cell.value as string;
17
- let toDisplay = [ui.divText(s)];
18
- const [, aar] = this.getColorAAPivot(s);
19
- if (aar in ChemPalette.AASmiles) {
20
- if (s in ChemPalette.AANames) {
21
- toDisplay = [ui.divText(ChemPalette.AANames[s])];
22
- }
23
- if (s in ChemPalette.AAFullNames) {
24
- toDisplay = [ui.divText(ChemPalette.AANames[ChemPalette.AAFullNames[s]])];
25
- }
26
- const options = {
27
- autoCrop: true,
28
- autoCropMargin: 0,
29
- suppressChiralText: true,
30
- };
31
- const sketch = grok.chem.svgMol(ChemPalette.AASmiles[aar], undefined, undefined, options);
32
- toDisplay.push(sketch);
27
+ /**
28
+ * Renders 2D representation of a amino acid residue in a tooltip.
29
+ *
30
+ * @param {DG.GridCell} cell Grid cell to show tooltip over.
31
+ * @param {number} x x coordinate of the mouse pointer.
32
+ * @param {number} y y coordinate of the mouse pointer.
33
+ */
34
+ showTooltip(cell: DG.GridCell, x: number, y: number) {
35
+ const s = cell.cell.value as string;
36
+ let toDisplay = [ui.divText(s)];
37
+ const [, aar] = this.getColorAAPivot(s);
38
+ if (aar in ChemPalette.AASmiles) {
39
+ if (s in ChemPalette.AANames) {
40
+ toDisplay = [ui.divText(ChemPalette.AANames[s])];
33
41
  }
34
- ui.tooltip.show(ui.divV(toDisplay), x, y);
42
+ if (s in ChemPalette.AAFullNames) {
43
+ toDisplay = [ui.divText(ChemPalette.AANames[ChemPalette.AAFullNames[s]])];
44
+ }
45
+ const options = {
46
+ autoCrop: true,
47
+ autoCropMargin: 0,
48
+ suppressChiralText: true,
49
+ };
50
+ const sketch = grok.chem.svgMol(ChemPalette.AASmiles[aar], undefined, undefined, options);
51
+ toDisplay.push(sketch);
35
52
  }
53
+ ui.tooltip.show(ui.divV(toDisplay), x, y);
54
+ }
55
+
56
+ /**
57
+ * Get color for the provided amino acid residue.
58
+ * @param {string} c Amino acid residue string.
59
+ * @return {string} Color.
60
+ */
61
+ getColor(c: string): string {
62
+ const [color] = this.getColorPivot(c);
63
+ return color;
64
+ }
36
65
 
37
- getColor( c: string) {
38
- const [color] = this.getColorPivot(c);
39
- return color;
66
+ /**
67
+ * Get color for the provided amino acid residue pivot
68
+ * @param {string} [c=''] Amino acid residue string.
69
+ * @return {[string, string, number]}
70
+ */
71
+ getColorAAPivot(c: string = ''): [string, string, number] {
72
+ if (c.length == 1 || c[1] == '(') {
73
+ const amino = c[0]?.toUpperCase()!;
74
+ return amino in this.cp?
75
+ [this.cp[amino], amino, 1]:
76
+ [ChemPalette.undefinedColor, '', 1];
40
77
  }
41
78
 
42
- getColorAAPivot(c = ''): [string, string, number] {
43
- if (c.length == 1 || c[1] == '(') {
44
- const amino = c[0]?.toUpperCase()!;
79
+ if (c[0] == 'd' && c[1]! in this.cp) {
80
+ if (c.length == 2 || c[2] == '(') {
81
+ const amino = c[1]?.toUpperCase()!;
45
82
  return amino in this.cp?
46
- [this.cp[amino], amino, 1]:
47
- [ChemPalette.undefinedColor, '', 1];
83
+ [this.cp[amino], amino, 2]:
84
+ [ChemPalette.undefinedColor, '', 2];
48
85
  }
86
+ }
49
87
 
50
- if (c[0] == 'd' && c[1]! in this.cp) {
51
- if (c.length == 2 || c[2] == '(') {
52
- const amino = c[1]?.toUpperCase()!;
53
- return amino in this.cp?
54
- [this.cp[amino], amino, 2]:
55
- [ChemPalette.undefinedColor, '', 2];
56
- }
88
+ if (c.substr(0, 3) in ChemPalette.AAFullNames) {
89
+ if (c.length == 3 || c[3] == '(') {
90
+ const amino = ChemPalette.AAFullNames[c.substr(0, 3)];
91
+ return amino in this.cp?
92
+ [this.cp[amino], amino, 3]:
93
+ [ChemPalette.undefinedColor, '', 3];
57
94
  }
95
+ }
58
96
 
59
- if (c.substr(0, 3) in ChemPalette.AAFullNames) {
60
- if (c.length == 3 || c[3] == '(') {
61
- const amino = ChemPalette.AAFullNames[c.substr(0, 3)];
97
+ if (c[0]?.toLowerCase() == c[0]) {
98
+ if (c.substr(1, 3) in ChemPalette.AAFullNames) {
99
+ if (c.length == 4 || c[4] == '(') {
100
+ const amino = ChemPalette.AAFullNames[c.substr(1, 3)];
62
101
  return amino in this.cp?
63
- [this.cp[amino], amino, 3]:
64
- [ChemPalette.undefinedColor, '', 3];
102
+ [this.cp[amino], amino, 4]:
103
+ [ChemPalette.undefinedColor, '', 4];
65
104
  }
66
105
  }
106
+ }
67
107
 
68
- if (c[0]?.toLowerCase() == c[0]) {
69
- if (c.substr(1, 3) in ChemPalette.AAFullNames) {
70
- if (c.length == 4 || c[4] == '(') {
71
- const amino = ChemPalette.AAFullNames[c.substr(1, 3)];
72
- return amino in this.cp?
73
- [this.cp[amino], amino, 4]:
74
- [ChemPalette.undefinedColor, '', 4];
75
- }
76
- }
77
- }
108
+ return [ChemPalette.undefinedColor, '', 0];
109
+ }
78
110
 
79
- return [ChemPalette.undefinedColor, '', 0];
80
- }
111
+ /**
112
+ * Get color pivot.
113
+ *
114
+ * @param c
115
+ * @returns
116
+ */
117
+ getColorPivot(c = ''): [string, number] {
118
+ //TODO: merge with getColorAAPivot?
119
+ const [color,, pivot] = this.getColorAAPivot(c);
120
+ return [color, pivot];
121
+ };
81
122
 
82
- getColorPivot(c = ''): [string, number] {
83
- const [color,, pivot] = this.getColorAAPivot(c);
84
- return [color, pivot];
85
- };
86
-
87
- static colourPalette: {[key: string]: string[]} = {
88
- 'orange': ['rgb(255,187,120)', 'rgb(245,167,100)', 'rgb(235,137,70)', 'rgb(205, 111, 71)'],
89
- 'all_green': ['rgb(44,160,44)', 'rgb(74,160,74)', 'rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)',
90
- 'rgb(24,110,79)', 'rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
91
- 'all_blue': ['rgb(31,119,180)', 'rgb(23,190,207)', 'rgb(122, 102, 189)', 'rgb(158,218,229)', 'rgb(141, 124, 217)',
92
- 'rgb(31, 120, 150)'],
93
- 'magenta': ['rgb(162,106,192)', 'rgb(197,165,224)', 'rgb(208,113,218)'],
94
- 'red': ['rgb(214,39,40)', 'rgb(255,152,150)'],
95
- 'st_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(31,119,180)'],
96
- 'dark_blue': ['rgb(31,119,180)', 'rgb(31, 120, 150)'],
97
- 'light_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(108, 218, 229)', 'rgb(23,190,227)'],
98
- 'lilac_blue': ['rgb(124,102,211)', 'rgb(149,134,217)', 'rgb(97, 81, 150)'],
99
- 'dark_green': ['rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)', 'rgb(24,110,79)'],
100
- 'green': ['rgb(44,160,44)', 'rgb(74,160,74)'],
101
- 'light_green': ['rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
102
- 'st_green': ['rgb(44,160,44)', 'rgb(152,223,138)', 'rgb(39, 174, 96)', 'rgb(74,160,74)'],
103
- 'pink': ['rgb(247,182,210)'],
104
- 'brown': ['rgb(140,86,75)', 'rgb(102, 62, 54)'],
105
- 'gray': ['rgb(127,127,127)', 'rgb(199,199,199)', 'rgb(196,156,148)', 'rgb(222, 222, 180)'],
106
- 'yellow': ['rgb(188,189,34)'],
107
- 'white': ['rgb(230,230,230)'],
108
- }
123
+ /**
124
+ * Color palette
125
+ *
126
+ * @static
127
+ * @type {{[key: string]: string[]}}
128
+ * @memberof ChemPalette
129
+ */
130
+ static colourPalette: {[key: string]: string[]} = {
131
+ 'orange': ['rgb(255,187,120)', 'rgb(245,167,100)', 'rgb(235,137,70)', 'rgb(205, 111, 71)'],
132
+ 'all_green': ['rgb(44,160,44)', 'rgb(74,160,74)', 'rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)',
133
+ 'rgb(24,110,79)', 'rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
134
+ 'all_blue': ['rgb(31,119,180)', 'rgb(23,190,207)', 'rgb(122, 102, 189)', 'rgb(158,218,229)', 'rgb(141, 124, 217)',
135
+ 'rgb(31, 120, 150)'],
136
+ 'magenta': ['rgb(162,106,192)', 'rgb(197,165,224)', 'rgb(208,113,218)'],
137
+ 'red': ['rgb(214,39,40)', 'rgb(255,152,150)'],
138
+ 'st_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(31,119,180)'],
139
+ 'dark_blue': ['rgb(31,119,180)', 'rgb(31, 120, 150)'],
140
+ 'light_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(108, 218, 229)', 'rgb(23,190,227)'],
141
+ 'lilac_blue': ['rgb(124,102,211)', 'rgb(149,134,217)', 'rgb(97, 81, 150)'],
142
+ 'dark_green': ['rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)', 'rgb(24,110,79)'],
143
+ 'green': ['rgb(44,160,44)', 'rgb(74,160,74)'],
144
+ 'light_green': ['rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
145
+ 'st_green': ['rgb(44,160,44)', 'rgb(152,223,138)', 'rgb(39, 174, 96)', 'rgb(74,160,74)'],
146
+ 'pink': ['rgb(247,182,210)'],
147
+ 'brown': ['rgb(140,86,75)', 'rgb(102, 62, 54)'],
148
+ 'gray': ['rgb(127,127,127)', 'rgb(199,199,199)', 'rgb(196,156,148)', 'rgb(222, 222, 180)'],
149
+ 'yellow': ['rgb(188,189,34)'],
150
+ 'white': ['rgb(230,230,230)'],
151
+ }
109
152
 
110
- static grokGroups: {[key: string]: string[]} = {
111
- 'yellow': ['C', 'U'],
112
- 'red': ['G', 'P'],
113
- 'all_green': ['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'],
114
- 'light_blue': ['R', 'H', 'K'],
115
- 'dark_blue': ['D', 'E'],
116
- 'orange': ['S', 'T', 'N', 'Q'],
117
- }
153
+ /**
154
+ * Grok color scheme groups.
155
+ *
156
+ * @static
157
+ * @type {{[key: string]: string[]}}
158
+ * @memberof ChemPalette
159
+ */
160
+ static grokGroups: {[key: string]: string[]} = {
161
+ 'yellow': ['C', 'U'],
162
+ 'red': ['G', 'P'],
163
+ 'all_green': ['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'],
164
+ 'light_blue': ['R', 'H', 'K'],
165
+ 'dark_blue': ['D', 'E'],
166
+ 'orange': ['S', 'T', 'N', 'Q'],
167
+ }
118
168
 
119
- static leskGroups: {[key: string]: string[]} = {
120
- 'orange': ['G', 'A', 'S', 'T'],
121
- 'all_green': ['C', 'V', 'I', 'L', 'P', 'F', 'Y', 'M', 'W'],
122
- 'magenta': ['N', 'Q', 'H'],
123
- 'red': ['D', 'E'],
124
- 'all_blue': ['K', 'R'],
125
- }
169
+ /**
170
+ * Lesk color scheme groups.
171
+ *
172
+ * @static
173
+ * @type {{[key: string]: string[]}}
174
+ * @memberof ChemPalette
175
+ */
176
+ static leskGroups: {[key: string]: string[]} = {
177
+ 'orange': ['G', 'A', 'S', 'T'],
178
+ 'all_green': ['C', 'V', 'I', 'L', 'P', 'F', 'Y', 'M', 'W'],
179
+ 'magenta': ['N', 'Q', 'H'],
180
+ 'red': ['D', 'E'],
181
+ 'all_blue': ['K', 'R'],
182
+ }
126
183
 
127
- static undefinedColor = 'rgb(100,100,100)';
128
-
129
- static makePalette(dt: {[key: string]: string[]}, simplified = false, grouping = false) {
130
- const palette: { [key: string]: string } = {};
131
- const groups = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
132
- let currentGroup = 0;
133
- for (const [color, monomers] of Object.entries(dt)) {
134
- monomers.forEach((monomer, index) => {
135
- palette[grouping ? groups[currentGroup] : monomer] = ChemPalette.colourPalette[color][simplified ? 0 : index];
136
- });
137
- currentGroup++;
138
- }
139
- return palette;
140
- }
184
+ /**
185
+ * Undefined color.
186
+ *
187
+ * @static
188
+ * @memberof ChemPalette
189
+ */
190
+ static undefinedColor = 'rgb(100,100,100)';
141
191
 
142
- static AANames: {[key: string]: string} = {
143
- 'G': 'Glycine',
144
- 'L': 'Leucine',
145
- 'Y': 'Tyrosine',
146
- 'S': 'Serine',
147
- 'E': 'Glutamic acid',
148
- 'Q': 'Glutamine',
149
- 'D': 'Aspartic acid',
150
- 'N': 'Asparagine',
151
- 'F': 'Phenylalanine',
152
- 'A': 'Alanine',
153
- 'K': 'Lysine',
154
- 'R': 'Arginine',
155
- 'H': 'Histidine',
156
- 'C': 'Cysteine',
157
- 'V': 'Valine',
158
- 'P': 'Proline',
159
- 'W': 'Tryptophan',
160
- 'I': 'Isoleucine',
161
- 'M': 'Methionine',
162
- 'T': 'Threonine',
192
+ /**
193
+ * Create palette.
194
+ *
195
+ * @param dt
196
+ * @param simplified Is simplified.
197
+ * @param grouping Is grouping enabled.
198
+ * @returns
199
+ */
200
+ static makePalette(dt: {[key: string]: string[]}, simplified = false, grouping = false) {
201
+ const palette: { [key: string]: string } = {};
202
+ const groups = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
203
+ let currentGroup = 0;
204
+ for (const [color, monomers] of Object.entries(dt)) {
205
+ monomers.forEach((monomer, index) => {
206
+ palette[grouping ? groups[currentGroup] : monomer] = ChemPalette.colourPalette[color][simplified ? 0 : index];
207
+ });
208
+ currentGroup++;
163
209
  }
210
+ return palette;
211
+ }
164
212
 
165
- static AASmiles: {[key: string]: string} = {
166
- 'G': 'NCC(=O)O',
167
- 'L': 'N[C@H](CC(C)C)C(=O)O',
168
- 'Y': 'NC(CC1=CC=C(O)C=C1)C(=O)O',
169
- 'S': 'NC(CO)C(=O)O',
170
- 'E': 'N[C@@H](CCC(O)=O)C(=O)O',
171
- 'Q': 'N[C@@H](CCC(N)=O)C(=O)O',
172
- 'D': 'N[C@@H](CC(O)=O)C(=O)O',
173
- 'N': 'N[C@@H](CC(N)=O)C(=O)O',
174
- 'F': 'NC(CC1=CC=CC=C1)C(=O)O',
175
- 'A': 'N[C@H](C)C(=O)O',
176
- 'K': 'NC(CCCCN)C(=O)O',
177
- 'R': 'N[C@H](CCCNC(=N)C)C(=O)O',
178
- 'H': 'NC(CC1=CN=C[N]1)C(=O)O',
179
- 'C': 'N[C@@H](CS)C(=O)O',
180
- 'V': 'NC(C(C)C)C(=O)O',
181
- 'P': 'N(CCC1)C1C(=O)O',
182
- 'W': 'N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O',
183
- 'I': 'N[C@H]([C@H](C)CC)C(=O)O',
184
- 'M': 'NC(CCSC)C(=O)O',
185
- 'T': 'NC(C(O)C)C(=O)O',
186
- }
213
+ /**
214
+ * Amino acid residue names.
215
+ *
216
+ * @static
217
+ * @type {{[key: string]: string}}
218
+ * @memberof ChemPalette
219
+ */
220
+ static AANames: {[key: string]: string} = {
221
+ 'G': 'Glycine',
222
+ 'L': 'Leucine',
223
+ 'Y': 'Tyrosine',
224
+ 'S': 'Serine',
225
+ 'E': 'Glutamic acid',
226
+ 'Q': 'Glutamine',
227
+ 'D': 'Aspartic acid',
228
+ 'N': 'Asparagine',
229
+ 'F': 'Phenylalanine',
230
+ 'A': 'Alanine',
231
+ 'K': 'Lysine',
232
+ 'R': 'Arginine',
233
+ 'H': 'Histidine',
234
+ 'C': 'Cysteine',
235
+ 'V': 'Valine',
236
+ 'P': 'Proline',
237
+ 'W': 'Tryptophan',
238
+ 'I': 'Isoleucine',
239
+ 'M': 'Methionine',
240
+ 'T': 'Threonine',
241
+ }
187
242
 
188
- static AASmilesTruncated: {[key: string]: string} = {
189
- 'G': '*C*',
190
- 'L': 'CC(C)C[C@H](*)*',
191
- 'Y': 'C1=CC(=CC=C1CC(*)*)O',
192
- 'S': 'OCC(*)C*',
193
- 'E': '*[C@@H](CCC(O)=O)*',
194
- 'Q': '*N[C@@H](CCC(N)=O)*',
195
- 'D': '*[C@@H](CC(O)=O)*',
196
- 'N': '*[C@@H](CC(N)=O)*',
197
- 'F': 'C1=CC=C(C=C1)CC(*)*',
198
- 'A': 'C[C@H](*)*',
199
- 'K': 'C(CCN)CC(*)*',
200
- 'R': '*[C@H](CCCNC(=N)C)*',
201
- 'H': 'C1=C(NC=N1)CC(*)*',
202
- 'C': 'C([C@@H](*)*)S',
203
- 'V': 'CC(C)C(*)*',
204
- 'P': 'C1CCN(*)C1*',
205
- 'W': '*[C@@H](Cc1c2ccccc2n([H])c1)*',
206
- 'I': 'CC[C@H](C)[C@H](*)*',
207
- 'M': 'CSCCC(*)*',
208
- 'T': 'CC(O)C(*)*',
209
- }
243
+ /**
244
+ * Amino acid residue SMILES.
245
+ *
246
+ * @static
247
+ * @type {{[key: string]: string}}
248
+ * @memberof ChemPalette
249
+ */
250
+ static AASmiles: {[key: string]: string} = {
251
+ 'G': 'NCC(=O)O',
252
+ 'L': 'N[C@H](CC(C)C)C(=O)O',
253
+ 'Y': 'NC(CC1=CC=C(O)C=C1)C(=O)O',
254
+ 'S': 'NC(CO)C(=O)O',
255
+ 'E': 'N[C@@H](CCC(O)=O)C(=O)O',
256
+ 'Q': 'N[C@@H](CCC(N)=O)C(=O)O',
257
+ 'D': 'N[C@@H](CC(O)=O)C(=O)O',
258
+ 'N': 'N[C@@H](CC(N)=O)C(=O)O',
259
+ 'F': 'NC(CC1=CC=CC=C1)C(=O)O',
260
+ 'A': 'N[C@H](C)C(=O)O',
261
+ 'K': 'NC(CCCCN)C(=O)O',
262
+ 'R': 'N[C@H](CCCNC(=N)C)C(=O)O',
263
+ 'H': 'NC(CC1=CN=C[N]1)C(=O)O',
264
+ 'C': 'N[C@@H](CS)C(=O)O',
265
+ 'V': 'NC(C(C)C)C(=O)O',
266
+ 'P': 'N(CCC1)C1C(=O)O',
267
+ 'W': 'N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O',
268
+ 'I': 'N[C@H]([C@H](C)CC)C(=O)O',
269
+ 'M': 'NC(CCSC)C(=O)O',
270
+ 'T': 'NC(C(O)C)C(=O)O',
271
+ }
210
272
 
211
- static AAFullNames: {[key: string]: string} = {
212
- 'Ala': 'A',
213
- 'Arg': 'R',
214
- 'Asn': 'N',
215
- 'Asp': 'D',
216
- 'Cys': 'C',
217
- 'Gln': 'Q',
218
- 'Glu': 'E',
219
- 'Gly': 'G',
220
- 'His': 'H',
221
- 'Ile': 'I',
222
- 'Leu': 'L',
223
- 'Lys': 'K',
224
- 'Met': 'M',
225
- 'Phe': 'F',
226
- 'Pro': 'P',
227
- 'Ser': 'S',
228
- 'Thr': 'T',
229
- 'Trp': 'W',
230
- 'Tyr': 'Y',
231
- 'Val': 'V',
232
- }
273
+ /**
274
+ * Amino acid residue truncated SMILES.
275
+ *
276
+ * @static
277
+ * @type {{[key: string]: string}}
278
+ * @memberof ChemPalette
279
+ */
280
+ static AASmilesTruncated: {[key: string]: string} = {
281
+ 'G': '*C*',
282
+ 'L': 'CC(C)C[C@H](*)*',
283
+ 'Y': 'C1=CC(=CC=C1CC(*)*)O',
284
+ 'S': 'OCC(*)C*',
285
+ 'E': '*[C@@H](CCC(O)=O)*',
286
+ 'Q': '*N[C@@H](CCC(N)=O)*',
287
+ 'D': '*[C@@H](CC(O)=O)*',
288
+ 'N': '*[C@@H](CC(N)=O)*',
289
+ 'F': 'C1=CC=C(C=C1)CC(*)*',
290
+ 'A': 'C[C@H](*)*',
291
+ 'K': 'C(CCN)CC(*)*',
292
+ 'R': '*[C@H](CCCNC(=N)C)*',
293
+ 'H': 'C1=C(NC=N1)CC(*)*',
294
+ 'C': 'C([C@@H](*)*)S',
295
+ 'V': 'CC(C)C(*)*',
296
+ 'P': 'C1CCN(*)C1*',
297
+ 'W': '*[C@@H](Cc1c2ccccc2n([H])c1)*',
298
+ 'I': 'CC[C@H](C)[C@H](*)*',
299
+ 'M': 'CSCCC(*)*',
300
+ 'T': 'CC(O)C(*)*',
301
+ }
233
302
 
234
- static getDatagrok(grouping = false) {
235
- return ChemPalette.makePalette(ChemPalette.grokGroups, false, grouping);
236
- }
303
+ /**
304
+ * Amino acid residue full names.
305
+ *
306
+ * @static
307
+ * @type {{[key: string]: string}}
308
+ * @memberof ChemPalette
309
+ */
310
+ static AAFullNames: {[key: string]: string} = {
311
+ 'Ala': 'A',
312
+ 'Arg': 'R',
313
+ 'Asn': 'N',
314
+ 'Asp': 'D',
315
+ 'Cys': 'C',
316
+ 'Gln': 'Q',
317
+ 'Glu': 'E',
318
+ 'Gly': 'G',
319
+ 'His': 'H',
320
+ 'Ile': 'I',
321
+ 'Leu': 'L',
322
+ 'Lys': 'K',
323
+ 'Met': 'M',
324
+ 'Phe': 'F',
325
+ 'Pro': 'P',
326
+ 'Ser': 'S',
327
+ 'Thr': 'T',
328
+ 'Trp': 'W',
329
+ 'Tyr': 'Y',
330
+ 'Val': 'V',
331
+ }
237
332
 
238
- static getLesk() {
239
- return ChemPalette.makePalette(ChemPalette.leskGroups);
240
- }
333
+ /**
334
+ * Get Datagrok palette.
335
+ *
336
+ * @param grouping Is grouping enabled?
337
+ * @returns
338
+ */
339
+ static getDatagrok(grouping = false) {
340
+ return ChemPalette.makePalette(ChemPalette.grokGroups, false, grouping);
341
+ }
342
+
343
+ /**
344
+ * Get Lesk palette.
345
+ *
346
+ * @param grouping Is grouping enabled?
347
+ * @returns
348
+ */
349
+ static getLesk() {
350
+ return ChemPalette.makePalette(ChemPalette.leskGroups);
351
+ }
241
352
  }