@datagrok/peptides 0.4.1 → 0.6.0

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, 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 sketch = grok.chem.svgMol(ChemPalette.AASmiles[aar]);
27
- 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])];
28
41
  }
29
- 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);
30
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
+ }
31
65
 
32
- getColor( c: string) {
33
- const [color] = this.getColorPivot(c);
34
- 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];
35
77
  }
36
78
 
37
- getColorAAPivot(c = ''): [string, string, number] {
38
- if (c.length == 1 || c[1] == '(') {
39
- 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()!;
40
82
  return amino in this.cp?
41
- [this.cp[amino], amino, 1]:
42
- [ChemPalette.undefinedColor, '', 1];
83
+ [this.cp[amino], amino, 2]:
84
+ [ChemPalette.undefinedColor, '', 2];
43
85
  }
86
+ }
44
87
 
45
- if (c[0] == 'd' && c[1]! in this.cp) {
46
- if (c.length == 2 || c[2] == '(') {
47
- const amino = c[1]?.toUpperCase()!;
48
- return amino in this.cp?
49
- [this.cp[amino], amino, 2]:
50
- [ChemPalette.undefinedColor, '', 2];
51
- }
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];
52
94
  }
95
+ }
53
96
 
54
- if (c.substr(0, 3) in ChemPalette.AAFullNames) {
55
- if (c.length == 3 || c[3] == '(') {
56
- 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)];
57
101
  return amino in this.cp?
58
- [this.cp[amino], amino, 3]:
59
- [ChemPalette.undefinedColor, '', 3];
102
+ [this.cp[amino], amino, 4]:
103
+ [ChemPalette.undefinedColor, '', 4];
60
104
  }
61
105
  }
106
+ }
62
107
 
63
- if (c[0]?.toLowerCase() == c[0]) {
64
- if (c.substr(1, 3) in ChemPalette.AAFullNames) {
65
- if (c.length == 4 || c[4] == '(') {
66
- const amino = ChemPalette.AAFullNames[c.substr(1, 3)];
67
- return amino in this.cp?
68
- [this.cp[amino], amino, 4]:
69
- [ChemPalette.undefinedColor, '', 4];
70
- }
71
- }
72
- }
108
+ return [ChemPalette.undefinedColor, '', 0];
109
+ }
73
110
 
74
- return [ChemPalette.undefinedColor, '', 0];
75
- }
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
+ };
76
122
 
77
- getColorPivot(c = ''): [string, number] {
78
- const [color,, pivot] = this.getColorAAPivot(c);
79
- return [color, pivot];
80
- };
81
-
82
- static colourPalette: {[key: string]: string[]} = {
83
- 'orange': ['rgb(255,187,120)', 'rgb(245,167,100)', 'rgb(235,137,70)', 'rgb(205, 111, 71)'],
84
- 'all_green': ['rgb(44,160,44)', 'rgb(74,160,74)', 'rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)',
85
- 'rgb(24,110,79)', 'rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
86
- 'all_blue': ['rgb(31,119,180)', 'rgb(23,190,207)', 'rgb(122, 102, 189)', 'rgb(158,218,229)', 'rgb(141, 124, 217)',
87
- 'rgb(31, 120, 150)'],
88
- 'magenta': ['rgb(162,106,192)', 'rgb(197,165,224)', 'rgb(208,113,218)'],
89
- 'red': ['rgb(214,39,40)', 'rgb(255,152,150)'],
90
- 'st_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(31,119,180)'],
91
- 'dark_blue': ['rgb(31,119,180)', 'rgb(31, 120, 150)'],
92
- 'light_blue': ['rgb(23,190,207)', 'rgb(158,218,229)', 'rgb(108, 218, 229)', 'rgb(23,190,227)'],
93
- 'lilac_blue': ['rgb(124,102,211)', 'rgb(149,134,217)', 'rgb(97, 81, 150)'],
94
- 'dark_green': ['rgb(23,103,57)', 'rgb(30,110,96)', 'rgb(60,131,95)', 'rgb(24,110,79)'],
95
- 'green': ['rgb(44,160,44)', 'rgb(74,160,74)'],
96
- 'light_green': ['rgb(152,223,138)', 'rgb(182, 223, 138)', 'rgb(152, 193, 138)'],
97
- 'st_green': ['rgb(44,160,44)', 'rgb(152,223,138)', 'rgb(39, 174, 96)', 'rgb(74,160,74)'],
98
- 'pink': ['rgb(247,182,210)'],
99
- 'brown': ['rgb(140,86,75)', 'rgb(102, 62, 54)'],
100
- 'gray': ['rgb(127,127,127)', 'rgb(199,199,199)', 'rgb(196,156,148)', 'rgb(222, 222, 180)'],
101
- 'yellow': ['rgb(188,189,34)'],
102
- 'white': ['rgb(230,230,230)'],
103
- }
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
+ }
104
152
 
105
- // static grokGroups: [string[], string][] = [
106
- // [['C', 'U'], 'yellow'],
107
- // [['G', 'P'], 'red'],
108
- // [['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'], 'all_green'],
109
- // [['R', 'H', 'K'], 'light_blue'],
110
- // [['D', 'E'], 'dark_blue'],
111
- // [['S', 'T', 'N', 'Q'], 'orange'],
112
- // ];
113
- static grokGroups: {[key: string]: string[]} = {
114
- 'yellow': ['C', 'U'],
115
- 'red': ['G', 'P'],
116
- 'all_green': ['A', 'V', 'I', 'L', 'M', 'F', 'Y', 'W'],
117
- 'light_blue': ['R', 'H', 'K'],
118
- 'dark_blue': ['D', 'E'],
119
- 'orange': ['S', 'T', 'N', 'Q'],
120
- }
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
+ }
121
168
 
122
- static leskGroups: {[key: string]: string[]} = {
123
- 'orange': ['G', 'A', 'S', 'T'],
124
- 'all_green': ['C', 'V', 'I', 'L', 'P', 'F', 'Y', 'M', 'W'],
125
- 'magenta': ['N', 'Q', 'H'],
126
- 'red': ['D', 'E'],
127
- 'all_blue': ['K', 'R'],
128
- }
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
+ }
129
183
 
130
- static undefinedColor = 'rgb(100,100,100)';
131
-
132
- static makePalette(dt: {[key: string]: string[]}, simplified = false, grouping = false) {
133
- const palette: { [key: string]: string } = {};
134
- const groups = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
135
- let currentGroup = 0;
136
- for (const [color, monomers] of Object.entries(dt)) {
137
- monomers.forEach((monomer, index) => {
138
- palette[grouping ? groups[currentGroup] : monomer] = ChemPalette.colourPalette[color][simplified ? 0 : index];
139
- });
140
- currentGroup++;
141
- }
142
- return palette;
143
- }
184
+ /**
185
+ * Undefined color.
186
+ *
187
+ * @static
188
+ * @memberof ChemPalette
189
+ */
190
+ static undefinedColor = 'rgb(100,100,100)';
144
191
 
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',
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++;
166
209
  }
210
+ return palette;
211
+ }
167
212
 
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
- }
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
+ }
190
242
 
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
- }
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
+ }
213
272
 
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
- }
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
+ }
236
302
 
237
- static getDatagrok(grouping = false) {
238
- return ChemPalette.makePalette(ChemPalette.grokGroups, false, grouping);
239
- }
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
+ }
240
332
 
241
- static getLesk() {
242
- return ChemPalette.makePalette(ChemPalette.leskGroups);
243
- }
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
+ }
244
352
  }