@datagrok/helm 1.0.6 → 1.0.9

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.
@@ -0,0 +1,13 @@
1
+ FROM tomcat:8.0.48-jre8
2
+
3
+ RUN sed -i 's/port="8080"/port="8081"/' $CATALINA_HOME/conf/server.xml
4
+
5
+ WORKDIR $CATALINA_HOME/tmp
6
+
7
+ ENV HELM2_WEBSERVICE_VERSION=2.2.0
8
+
9
+ RUN curl -o $CATALINA_HOME/webapps/WebService.war "https://oss.sonatype.org/service/local/repositories/releases/content/org/pistoiaalliance/helm/helm2-webservice/${HELM2_WEBSERVICE_VERSION}/helm2-webservice-${HELM2_WEBSERVICE_VERSION}.war"
10
+
11
+ RUN cp -r $CATALINA_HOME/tmp $CATALINA_HOME/webapps
12
+
13
+ CMD ["catalina.sh", "run"]
package/package.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "name": "@datagrok/helm",
3
3
  "beta": false,
4
4
  "friendlyName": "Helm",
5
- "version": "1.0.6",
5
+ "version": "1.0.9",
6
6
  "description": "",
7
7
  "dependencies": {
8
8
  "datagrok-api": "^1.4.12",
9
9
  "cash-dom": "latest",
10
10
  "dayjs": "latest",
11
- "@datagrok-libraries/utils": "latest",
11
+ "@datagrok-libraries/utils": "^1.4.0",
12
12
  "@datagrok-libraries/bio": "^2.8.4",
13
13
  "ts-loader": "^9.2.5",
14
14
  "typescript": "^4.4.2"
package/src/package.ts CHANGED
@@ -26,6 +26,11 @@ export async function initHelm(): Promise<void> {
26
26
  grid.invalidate();
27
27
  }
28
28
 
29
+ //name: getLru
30
+ export async function getLru() {
31
+ return await grok.functions.call('Bio:Lru');
32
+ }
33
+
29
34
  //tags: cellEditor
30
35
  //description: Macromolecule
31
36
  //input: grid_cell cell
@@ -43,8 +48,8 @@ export function editMoleculeCell(cell: DG.GridCell): void {
43
48
  mexfilter: true
44
49
  });
45
50
  var sizes = app.calculateSizes();
46
- app.canvas.resize(sizes.rightwidth, sizes.topheight - 210);
47
- var s = {width: sizes.rightwidth + 'px', height: sizes.bottomheight + 'px'};
51
+ app.canvas.resize(sizes.rightwidth - 100, sizes.topheight - 210);
52
+ var s = {width: sizes.rightwidth - 100 + 'px', height: sizes.bottomheight + 'px'};
48
53
  //@ts-ignore
49
54
  scil.apply(app.sequence.style, s);
50
55
  //@ts-ignore
@@ -84,8 +89,8 @@ export function editMoleculeCell(cell: DG.GridCell): void {
84
89
  //tags: panel, widgets
85
90
  //input: string helmString {semType: Macromolecule}
86
91
  //output: widget result
87
- export function detailsPanel(helmString: string) {
88
- //return new DG.Widget(ui.divText(lru.get(helmString)));
92
+ export async function detailsPanel(helmString: string) {
93
+ const lru = await getLru();
89
94
  const result = lru.get(helmString).split(',');
90
95
  return new DG.Widget(
91
96
  ui.tableFromMap({
@@ -103,11 +108,7 @@ export function detailsPanel(helmString: string) {
103
108
 
104
109
 
105
110
  async function loadDialog() {
106
- //@ts-ignore
107
- let res = await grok.dapi.files.list('System:AppData/Helm/libraries', false, '');
108
- //@ts-ignore
109
- res = res.map((e) => e.path);
110
- //@ts-ignore
111
+ let res = (await _package.files.list(`${LIB_PATH}`, false, '')).map(it => it.fileName);
111
112
  let FilesList = await ui.choiceInput('Monomer Libraries', ' ', res);
112
113
  let grid = grok.shell.tv.grid;
113
114
  ui.dialog('Load library from file')
@@ -128,7 +129,7 @@ export async function libraryPanel(helmColumn: DG.Column) {
128
129
  //@ts-ignore
129
130
  let loadButton = ui.button('Load Library');
130
131
  loadButton.addEventListener('click', loadDialog);
131
- let list = (await grok.dapi.files.list('System:AppData/Helm/libraries', false, '')).toString().split(',');
132
+ let list = (await _package.files.list(`${LIB_PATH}`, false, '')).map(it => it.fileName);
132
133
  let usedLibraries = [];
133
134
  for (let j = 0; j <= i; j++) {
134
135
  usedLibraries.push(await grok.dapi.userDataStorage.getValue(STORAGE_NAME, j.toString(), true));
@@ -216,14 +217,12 @@ function getRS(smiles: string) {
216
217
 
217
218
  async function monomerManager(value: string) {
218
219
  let df: any[];
219
- const libName = value.substring(value.lastIndexOf('/') + 1);
220
220
  if (value.endsWith('.sdf')) {
221
- const file = await _package.files.readAsBytes(`${LIB_PATH}${libName}`);
221
+ const file = await _package.files.readAsBytes(`${LIB_PATH}${value}`);
222
222
  const dfSdf = await grok.functions.call('Chem:importSdf', {bytes: file});
223
223
  df = createJsonMonomerLibFromSdf(dfSdf[0]);
224
-
225
224
  } else {
226
- const file = await _package.files.readAsText(`${LIB_PATH}${libName}`);
225
+ const file = await _package.files.readAsText(`${LIB_PATH}${value}`);
227
226
  df = JSON.parse(file);
228
227
  }
229
228
 
package/npmignore DELETED
@@ -1,26 +0,0 @@
1
- # Developer keys
2
- upload.keys.json
3
-
4
- # Dependency directories
5
- node_modules/
6
-
7
- # IDEs
8
- # VS Code (https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore)
9
- .vscode/*
10
- !.vscode/settings.json
11
- !.vscode/tasks.json
12
- !.vscode/launch.json
13
- !.vscode/extensions.json
14
- *.code-workspace
15
- .history/
16
-
17
- # Intellij IDEA/WebStorm (https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore)
18
- .idea/inspectionProfiles/
19
- .idea/**/compiler.xml
20
- .idea/**/encodings.xml
21
- .idea/**/workspace.xml
22
- .idea/**/tasks.xml
23
- .idea/**/usage.statistics.xml
24
- .idea/**/dictionaries
25
- .idea/**/shelf
26
- .idea/codeStyles/
@@ -1,251 +0,0 @@
1
- <html><head><meta charset="utf-8"/><title>Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 7d82c3f3.</title><style type="text/css">html,
2
- body {
3
- font-family: Arial, Helvetica, sans-serif;
4
- font-size: 1rem;
5
- margin: 0;
6
- padding: 0;
7
- color: #333;
8
- }
9
- body {
10
- padding: 2rem 1rem;
11
- font-size: 0.85rem;
12
- }
13
- #jesthtml-content {
14
- margin: 0 auto;
15
- max-width: 70rem;
16
- }
17
- header {
18
- display: flex;
19
- align-items: center;
20
- }
21
- #title {
22
- margin: 0;
23
- flex-grow: 1;
24
- }
25
- #logo {
26
- height: 4rem;
27
- }
28
- #timestamp {
29
- color: #777;
30
- margin-top: 0.5rem;
31
- }
32
-
33
- /** SUMMARY */
34
- #summary {
35
- color: #333;
36
- margin: 2rem 0;
37
- display: flex;
38
- font-family: monospace;
39
- font-size: 1rem;
40
- }
41
- #summary > div {
42
- margin-right: 2rem;
43
- background: #eee;
44
- padding: 1rem;
45
- min-width: 15rem;
46
- }
47
- #summary > div:last-child {
48
- margin-right: 0;
49
- }
50
- @media only screen and (max-width: 720px) {
51
- #summary {
52
- flex-direction: column;
53
- }
54
- #summary > div {
55
- margin-right: 0;
56
- margin-top: 2rem;
57
- }
58
- #summary > div:first-child {
59
- margin-top: 0;
60
- }
61
- }
62
-
63
- .summary-total {
64
- font-weight: bold;
65
- margin-bottom: 0.5rem;
66
- }
67
- .summary-passed {
68
- color: #4f8a10;
69
- border-left: 0.4rem solid #4f8a10;
70
- padding-left: 0.5rem;
71
- }
72
- .summary-failed,
73
- .summary-obsolete-snapshots {
74
- color: #d8000c;
75
- border-left: 0.4rem solid #d8000c;
76
- padding-left: 0.5rem;
77
- }
78
- .summary-pending {
79
- color: #9f6000;
80
- border-left: 0.4rem solid #9f6000;
81
- padding-left: 0.5rem;
82
- }
83
- .summary-empty {
84
- color: #999;
85
- border-left: 0.4rem solid #999;
86
- }
87
-
88
- .test-result {
89
- padding: 1rem;
90
- margin-bottom: 0.25rem;
91
- }
92
- .test-result:last-child {
93
- border: 0;
94
- }
95
- .test-result.passed {
96
- background-color: #dff2bf;
97
- color: #4f8a10;
98
- }
99
- .test-result.failed {
100
- background-color: #ffbaba;
101
- color: #d8000c;
102
- }
103
- .test-result.pending {
104
- background-color: #ffdf61;
105
- color: #9f6000;
106
- }
107
-
108
- .test-info {
109
- display: flex;
110
- justify-content: space-between;
111
- }
112
- .test-suitename {
113
- width: 20%;
114
- text-align: left;
115
- font-weight: bold;
116
- word-break: break-word;
117
- }
118
- .test-title {
119
- width: 40%;
120
- text-align: left;
121
- font-style: italic;
122
- }
123
- .test-status {
124
- width: 20%;
125
- text-align: right;
126
- }
127
- .test-duration {
128
- width: 10%;
129
- text-align: right;
130
- font-size: 0.75rem;
131
- }
132
-
133
- .failureMessages {
134
- padding: 0 1rem;
135
- margin-top: 1rem;
136
- border-top: 1px dashed #d8000c;
137
- }
138
- .failureMessages.suiteFailure {
139
- border-top: none;
140
- }
141
- .failureMsg {
142
- white-space: pre-wrap;
143
- white-space: -moz-pre-wrap;
144
- white-space: -pre-wrap;
145
- white-space: -o-pre-wrap;
146
- word-wrap: break-word;
147
- }
148
-
149
- .suite-container {
150
- margin-bottom: 2rem;
151
- }
152
- .suite-info {
153
- padding: 1rem;
154
- background-color: #eee;
155
- color: #777;
156
- display: flex;
157
- align-items: center;
158
- margin-bottom: 0.25rem;
159
- }
160
- .suite-info .suite-path {
161
- word-break: break-all;
162
- flex-grow: 1;
163
- font-family: monospace;
164
- font-size: 1rem;
165
- }
166
- .suite-info .suite-time {
167
- margin-left: 0.5rem;
168
- padding: 0.2rem 0.3rem;
169
- font-size: 0.75rem;
170
- }
171
- .suite-info .suite-time.warn {
172
- background-color: #d8000c;
173
- color: #fff;
174
- }
175
-
176
- /* CONSOLE LOGS */
177
- .suite-consolelog {
178
- margin-bottom: 0.25rem;
179
- padding: 1rem;
180
- background-color: #efefef;
181
- }
182
- .suite-consolelog-header {
183
- font-weight: bold;
184
- }
185
- .suite-consolelog-item {
186
- padding: 0.5rem;
187
- }
188
- .suite-consolelog-item pre {
189
- margin: 0.5rem 0;
190
- white-space: pre-wrap;
191
- white-space: -moz-pre-wrap;
192
- white-space: -pre-wrap;
193
- white-space: -o-pre-wrap;
194
- word-wrap: break-word;
195
- }
196
- .suite-consolelog-item-origin {
197
- color: #777;
198
- font-weight: bold;
199
- }
200
- .suite-consolelog-item-message {
201
- color: #000;
202
- font-size: 1rem;
203
- padding: 0 0.5rem;
204
- }
205
-
206
- /* OBSOLETE SNAPSHOTS */
207
- .suite-obsolete-snapshots {
208
- margin-bottom: 0.25rem;
209
- padding: 1rem;
210
- background-color: #ffbaba;
211
- color: #d8000c;
212
- }
213
- .suite-obsolete-snapshots-header {
214
- font-weight: bold;
215
- }
216
- .suite-obsolete-snapshots-item {
217
- padding: 0.5rem;
218
- }
219
- .suite-obsolete-snapshots-item pre {
220
- margin: 0.5rem 0;
221
- white-space: pre-wrap;
222
- white-space: -moz-pre-wrap;
223
- white-space: -pre-wrap;
224
- white-space: -o-pre-wrap;
225
- word-wrap: break-word;
226
- }
227
- .suite-obsolete-snapshots-item-message {
228
- color: #000;
229
- font-size: 1rem;
230
- padding: 0 0.5rem;
231
- }
232
- </style></head><body><div id="jesthtml-content"><header><h1 id="title">Helm Test Report. Datagrok version datagrok/datagrok:latest SHA=34f75e5127b8. Commit 7d82c3f3.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-07-15 17:15:38</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed summary-empty">0 passed</div><div class="summary-failed">1 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts</div><div class="suite-time warn">14.146s</div></div><div class="suite-tests"><div class="test-result failed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">failed</div><div class="test-duration">1.721s</div></div><div class="failureMessages"> <pre class="failureMsg">Error: Test result : Helm.Helm.detectMacromolecule : Error: Expected "Macromolecule", got "null"
233
- Test result : Helm.Helm.detectHelm : Error: Expected "HELM", got "null"
234
-
235
- at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:67:20
236
- at Generator.next (&lt;anonymous&gt;)
237
- at fulfilled (/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:31:58)
238
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Helm/src/__jest__/test-node.ts:61:11)
239
- at Generator.next (&lt;anonymous&gt;)
240
- at fulfilled (/home/runner/work/public/public/packages/Helm/src/__jest__/test-node.ts:28:58)
241
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:40:11
242
- at Generator.next (&lt;anonymous&gt;)
243
- at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:34:71
244
- at new Promise (&lt;anonymous&gt;)
245
- at Object.&lt;anonymous&gt;.__awaiter (/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:30:12)
246
- at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:38:23)
247
- at Promise.then.completed (/home/runner/work/public/public/packages/Helm/node_modules/jest-circus/build/utils.js:391:28)
248
- at new Promise (&lt;anonymous&gt;)</pre><pre class="suite-consolelog-item-message">Testing Helm package</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:65:11
249
- at Generator.next (&lt;anonymous&gt;)
250
- at fulfilled (/home/runner/work/public/public/packages/Helm/src/__jest__/remote.test.ts:31:58)
251
- at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message"/></div></div></div></div></body></html>