@datagrok/peptides 0.3.0 → 0.5.6

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,243 +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) {
10
- if (scheme == 'grok') {
11
- this.cp = ChemPalette.getDatagrok();
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
- // eslint-disable-next-line no-unused-vars
19
- const [_c, aar, _p] = this.getColorAAPivot(s);
20
- if (aar in ChemPalette.AASmiles) {
21
- if (s in ChemPalette.AANames) {
22
- toDisplay = [ui.divText(ChemPalette.AANames[s])];
23
- }
24
- if (s in ChemPalette.AAFullNames) {
25
- toDisplay = [ui.divText(ChemPalette.AANames[ChemPalette.AAFullNames[s]])];
26
- }
27
- const sketch = grok.chem.svgMol(ChemPalette.AASmiles[aar]);
28
- 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])];
29
41
  }
30
- 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);
31
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
+ * @returns {string} Color.
60
+ */
61
+ getColor(c: string): string {
62
+ const [color] = this.getColorPivot(c);
63
+ return color;
64
+ }
32
65
 
33
- getColor( c: string) {
34
- // eslint-disable-next-line no-unused-vars
35
- const [color, _] = this.getColorPivot(c);
36
- return color;
66
+ /**
67
+ * Get color for the provided amino acid residue pivot
68
+ * @param {string} [c=''] Amino acid residue string.
69
+ * @returns {[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];
37
77
  }
38
78
 
39
- getColorAAPivot(c = ''): [string, string, number] {
40
- if (c.length == 1 || c[1] == '(') {
41
- 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()!;
42
82
  return amino in this.cp?
43
- [this.cp[amino], amino, 1]:
44
- [ChemPalette.undefinedColor, '', 1];
83
+ [this.cp[amino], amino, 2]:
84
+ [ChemPalette.undefinedColor, '', 2];
45
85
  }
86
+ }
46
87
 
47
- if (c[0] == 'd' && c[1]! in this.cp) {
48
- if (c.length == 2 || c[2] == '(') {
49
- const amino = c[1]?.toUpperCase()!;
50
- return amino in this.cp?
51
- [this.cp[amino], amino, 2]:
52
- [ChemPalette.undefinedColor, '', 2];
53
- }
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];
54
94
  }
95
+ }
55
96
 
56
- if (c.substr(0, 3) in ChemPalette.AAFullNames) {
57
- if (c.length == 3 || c[3] == '(') {
58
- 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)];
59
101
  return amino in this.cp?
60
- [this.cp[amino], amino, 3]:
61
- [ChemPalette.undefinedColor, '', 3];
102
+ [this.cp[amino], amino, 4]:
103
+ [ChemPalette.undefinedColor, '', 4];
62
104
  }
63
105
  }
106
+ }
64
107
 
65
- if (c[0]?.toLowerCase() == c[0]) {
66
- if (c.substr(1, 3) in ChemPalette.AAFullNames) {
67
- if (c.length == 4 || c[4] == '(') {
68
- const amino = ChemPalette.AAFullNames[c.substr(1, 3)];
69
- return amino in this.cp?
70
- [this.cp[amino], amino, 4]:
71
- [ChemPalette.undefinedColor, '', 4];
72
- }
73
- }
74
- }
108
+ return [ChemPalette.undefinedColor, '', 0];
109
+ }
75
110
 
76
- return [ChemPalette.undefinedColor, '', 0];
77
- }
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
+ };
78
122
 
79
- getColorPivot(c = ''): [string, number] {
80
- // eslint-disable-next-line no-unused-vars
81
- const [color, _, pivot] = this.getColorAAPivot(c);
82
- return [color, pivot];
83
- };
84
-
85
- static colourPalette: {[key: string]: string[]} = {
86
- 'orange': ['rgb(255,187,120)', 'rgb(245,167,100)', 'rgb(235,137,70)', 'rgb(205, 111, 71)'],
87
- 'all_green': ['rgb(44,160,44)', 'rgb(74,160,74)', 'rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)',
88
- 'rgb(24,110,79)', 'rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
89
- 'all_blue': ['rgb(31,119,180)', 'rgb(23,190,207)', 'rgb(122, 102, 189)', 'rgb(158,218,229)', 'rgb(141, 124, 217)',
90
- 'rgb(31, 120, 150)'],
91
- 'magenta': ['rgb(162,106,192)', 'rgb(197,165,224)', 'rgb(208,113,218)'],
92
- 'red': ['rgb(214,39,40)', 'rgb(255,152,150)'],
93
- 'st_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(31,119,180)'],
94
- 'dark_blue': ['rgb(31,119,180)', 'rgb(31, 120, 150)'],
95
- 'light_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(108, 218, 229)', 'rgb(23,190,227)'],
96
- 'lilac_blue': ['rgb(124,102,211)', 'rgb(149,134,217)', 'rgb(97, 81, 150)'],
97
- 'dark_green': ['rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)', 'rgb(24,110,79)'],
98
- 'green': ['rgb(44,160,44)', 'rgb(74,160,74)'],
99
- 'light_green': ['rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
100
- 'st_green': ['rgb(44,160,44)', 'rgb(152,223,138)', 'rgb(39, 174, 96)', 'rgb(74,160,74)'],
101
- 'pink': ['rgb(247,182,210)'],
102
- 'brown': ['rgb(140,86,75)', 'rgb(102, 62, 54)'],
103
- 'gray': ['rgb(127,127,127)', 'rgb(199,199,199)', 'rgb(196,156,148)', 'rgb(222, 222, 180)'],
104
- 'yellow': ['rgb(188,189,34)'],
105
- 'white': ['rgb(230,230,230)'],
106
- }
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
+ }
107
152
 
108
- // static grokGroups: [string[], string][] = [
109
- // [['C', 'U'], 'yellow'],
110
- // [['G', 'P'], 'red'],
111
- // [['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'], 'all_green'],
112
- // [['R', 'H', 'K'], 'light_blue'],
113
- // [['D', 'E'], 'dark_blue'],
114
- // [['S', 'T', 'N', 'Q'], 'orange'],
115
- // ];
116
- static grokGroups: {[key: string]: string[]} = {
117
- 'yellow': ['C', 'U'],
118
- 'red': ['G', 'P'],
119
- 'all_green': ['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'],
120
- 'light_blue': ['R', 'H', 'K'],
121
- 'dark_blue': ['D', 'E'],
122
- 'orange': ['S', 'T', 'N', 'Q'],
123
- }
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
+ }
124
168
 
125
- static leskGroups: {[key: string]: string[]} = {
126
- 'orange': ['G', 'A', 'S', 'T'],
127
- 'all_green': ['C', 'V', 'I', 'L', 'P', 'F', 'Y', 'M', 'W'],
128
- 'magenta': ['N', 'Q', 'H'],
129
- 'red': ['D', 'E'],
130
- 'all_blue': ['K', 'R'],
131
- }
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
+ }
132
183
 
133
- static undefinedColor = 'rgb(100,100,100)'
184
+ /**
185
+ * Undefined color.
186
+ *
187
+ * @static
188
+ * @memberof ChemPalette
189
+ */
190
+ static undefinedColor = 'rgb(100,100,100)';
134
191
 
135
- static makePalette(dt: {[key: string]: string[]}, simplified = false) {
136
- const palette: { [key: string]: string } = {};
137
- for (const [color, monomers] of Object.entries(dt)) {
138
- monomers.forEach((monomer, index) => {
139
- palette[monomer] = ChemPalette.colourPalette[color][simplified ? 0 : index];
140
- });
141
- }
142
- return palette;
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++;
143
209
  }
210
+ return palette;
211
+ }
144
212
 
145
- static AANames: {[key: string]: string} = {
146
- 'G': 'Glycine',
147
- 'L': 'Leucine',
148
- 'Y': 'Tyrosine',
149
- 'S': 'Serine',
150
- 'E': 'Glutamic acid',
151
- 'Q': 'Glutamine',
152
- 'D': 'Aspartic acid',
153
- 'N': 'Asparagine',
154
- 'F': 'Phenylalanine',
155
- 'A': 'Alanine',
156
- 'K': 'Lysine',
157
- 'R': 'Arginine',
158
- 'H': 'Histidine',
159
- 'C': 'Cysteine',
160
- 'V': 'Valine',
161
- 'P': 'Proline',
162
- 'W': 'Tryptophan',
163
- 'I': 'Isoleucine',
164
- 'M': 'Methionine',
165
- 'T': 'Threonine',
166
- }
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
+ }
167
242
 
168
- static AASmiles: {[key: string]: string} = {
169
- 'G': 'NCC(=O)O',
170
- 'L': 'N[C@H](CC(C)C)C(=O)O',
171
- 'Y': 'NC(CC1=CC=C(O)C=C1)C(=O)O',
172
- 'S': 'NC(CO)C(=O)O',
173
- 'E': 'N[C@@H](CCC(O)=O)C(=O)O',
174
- 'Q': 'N[C@@H](CCC(N)=O)C(=O)O',
175
- 'D': 'N[C@@H](CC(O)=O)C(=O)O',
176
- 'N': 'N[C@@H](CC(N)=O)C(=O)O',
177
- 'F': 'NC(CC1=CC=CC=C1)C(=O)O',
178
- 'A': 'N[C@H](C)C(=O)O',
179
- 'K': 'NC(CCCCN)C(=O)O',
180
- 'R': 'N[C@H](CCCNC(=N)C)C(=O)O',
181
- 'H': 'NC(CC1=CN=C[N]1)C(=O)O',
182
- 'C': 'N[C@@H](CS)C(=O)O',
183
- 'V': 'NC(C(C)C)C(=O)O',
184
- 'P': 'N(CCC1)C1C(=O)O',
185
- 'W': 'N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O',
186
- 'I': 'N[C@H]([C@H](C)CC)C(=O)O',
187
- 'M': 'NC(CCSC)C(=O)O',
188
- 'T': 'NC(C(O)C)C(=O)O',
189
- }
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
+ }
190
272
 
191
- static AASmilesTruncated: {[key: string]: string} = {
192
- 'G': '*C*',
193
- 'L': 'CC(C)C[C@H](*)*',
194
- 'Y': 'C1=CC(=CC=C1CC(*)*)O',
195
- 'S': 'OCC(*)C*',
196
- 'E': '*[C@@H](CCC(O)=O)*',
197
- 'Q': '*N[C@@H](CCC(N)=O)*',
198
- 'D': '*[C@@H](CC(O)=O)*',
199
- 'N': '*[C@@H](CC(N)=O)*',
200
- 'F': 'C1=CC=C(C=C1)CC(*)*',
201
- 'A': 'C[C@H](*)*',
202
- 'K': 'C(CCN)CC(*)*',
203
- 'R': '*[C@H](CCCNC(=N)C)*',
204
- 'H': 'C1=C(NC=N1)CC(*)*',
205
- 'C': 'C([C@@H](*)*)S',
206
- 'V': 'CC(C)C(*)*',
207
- 'P': 'C1CCN(*)C1*',
208
- 'W': '*[C@@H](Cc1c2ccccc2n([H])c1)*',
209
- 'I': 'CC[C@H](C)[C@H](*)*',
210
- 'M': 'CSCCC(*)*',
211
- 'T': 'CC(O)C(*)*',
212
- }
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
+ }
213
302
 
214
- static AAFullNames: {[key: string]: string} = {
215
- 'Ala': 'A',
216
- 'Arg': 'R',
217
- 'Asn': 'N',
218
- 'Asp': 'D',
219
- 'Cys': 'C',
220
- 'Gln': 'Q',
221
- 'Glu': 'E',
222
- 'Gly': 'G',
223
- 'His': 'H',
224
- 'Ile': 'I',
225
- 'Leu': 'L',
226
- 'Lys': 'K',
227
- 'Met': 'M',
228
- 'Phe': 'F',
229
- 'Pro': 'P',
230
- 'Ser': 'S',
231
- 'Thr': 'T',
232
- 'Trp': 'W',
233
- 'Tyr': 'Y',
234
- 'Val': 'V',
235
- }
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
+ }
236
332
 
237
- static getDatagrok() {
238
- return ChemPalette.makePalette(ChemPalette.grokGroups);
239
- }
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
+ }
240
342
 
241
- static getLesk() {
242
- return ChemPalette.makePalette(ChemPalette.leskGroups);
243
- }
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
+ }
244
352
  }