matvenus-cli 0.1.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +201 -0
  3. package/README.md +408 -0
  4. package/bin/cli.js +3 -0
  5. package/dist/client.d.ts +13 -0
  6. package/dist/client.js +62 -0
  7. package/dist/commands/alphafold_protein_folding.d.ts +2 -0
  8. package/dist/commands/alphafold_protein_folding.js +262 -0
  9. package/dist/commands/cancel_tool_result.d.ts +2 -0
  10. package/dist/commands/cancel_tool_result.js +388 -0
  11. package/dist/commands/diffdock_protein_ligand_docking.d.ts +2 -0
  12. package/dist/commands/diffdock_protein_ligand_docking.js +252 -0
  13. package/dist/commands/esmfold_protein_folding.d.ts +2 -0
  14. package/dist/commands/esmfold_protein_folding.js +219 -0
  15. package/dist/commands/get_tool_result.d.ts +2 -0
  16. package/dist/commands/get_tool_result.js +388 -0
  17. package/dist/commands/gromacs_analysis.d.ts +2 -0
  18. package/dist/commands/gromacs_analysis.js +212 -0
  19. package/dist/commands/gromacs_md.d.ts +2 -0
  20. package/dist/commands/gromacs_md.js +236 -0
  21. package/dist/commands/index.d.ts +2 -0
  22. package/dist/commands/index.js +39 -0
  23. package/dist/commands/predict_functional_residue.d.ts +2 -0
  24. package/dist/commands/predict_functional_residue.js +234 -0
  25. package/dist/commands/predict_protein_properties.d.ts +2 -0
  26. package/dist/commands/predict_protein_properties.js +228 -0
  27. package/dist/commands/proteinmpnn_sequence_design.d.ts +2 -0
  28. package/dist/commands/proteinmpnn_sequence_design.js +271 -0
  29. package/dist/commands/rfdiffusion_protein_design.d.ts +2 -0
  30. package/dist/commands/rfdiffusion_protein_design.js +333 -0
  31. package/dist/commands/upload_file_base_64.d.ts +2 -0
  32. package/dist/commands/upload_file_base_64.js +212 -0
  33. package/dist/commands/venusg_protein_function_prediction.d.ts +2 -0
  34. package/dist/commands/venusg_protein_function_prediction.js +234 -0
  35. package/dist/commands/venusmine_protein_mining.d.ts +2 -0
  36. package/dist/commands/venusmine_protein_mining.js +212 -0
  37. package/dist/commands/venusprime_multipoint_prediction.d.ts +2 -0
  38. package/dist/commands/venusprime_multipoint_prediction.js +322 -0
  39. package/dist/commands/venusrem_mutation_prediction.d.ts +2 -0
  40. package/dist/commands/venusrem_mutation_prediction.js +260 -0
  41. package/dist/commands/venusx_functional_residue_prediction.d.ts +2 -0
  42. package/dist/commands/venusx_functional_residue_prediction.js +234 -0
  43. package/dist/index.d.ts +2 -0
  44. package/dist/index.js +125 -0
  45. package/dist/types.d.ts +12 -0
  46. package/dist/types.js +6 -0
  47. package/package.json +41 -0
@@ -0,0 +1,322 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.register = register;
4
+ const client_1 = require("../client");
5
+ function register(program, baseUrl) {
6
+ program
7
+ .command('venusprime-multipoint-prediction')
8
+ .description('Venusprime Multipoint')
9
+ .option('--body <json>', 'Request body as JSON string', (value) => value)
10
+ .option('--base-url <url>', 'Override base URL')
11
+ .option('--output <format>', 'Output format: json, table', 'json')
12
+ .option('--schema', 'Show API schema and exit')
13
+ .action(async (options) => {
14
+ if (options.schema) {
15
+ console.log(JSON.stringify({
16
+ "method": "post",
17
+ "operationId": "venusprime_multipoint_prediction",
18
+ "summary": "Venusprime Multipoint",
19
+ "tags": [
20
+ "tools-predict"
21
+ ],
22
+ "parameters": [],
23
+ "requestBody": {
24
+ "required": true,
25
+ "contentType": "application/json",
26
+ "schema": {
27
+ "properties": {
28
+ "mode": {
29
+ "type": "string",
30
+ "title": "Mode",
31
+ "description": "Operation mode: 'train' to train models from experimental data, 'inference' to predict multi-point mutations using trained models",
32
+ "default": "inference"
33
+ },
34
+ "venus_mode": {
35
+ "type": "string",
36
+ "title": "Venus Mode",
37
+ "description": "Model mode: 'light' for ridge regression (default), 'pro' for sesnet (not implemented yet)",
38
+ "default": "light"
39
+ },
40
+ "sequence": {
41
+ "anyOf": [
42
+ {
43
+ "type": "string"
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ],
49
+ "title": "Sequence",
50
+ "description": "Wild-type protein sequence (required for train mode if fasta_file not provided)"
51
+ },
52
+ "fasta_file": {
53
+ "anyOf": [
54
+ {
55
+ "type": "string"
56
+ },
57
+ {
58
+ "type": "null"
59
+ }
60
+ ],
61
+ "title": "Fasta File",
62
+ "description": "OSS URL to FASTA file with wild-type sequence (required for train mode if sequence not provided)"
63
+ },
64
+ "experiment_file": {
65
+ "anyOf": [
66
+ {
67
+ "type": "string"
68
+ },
69
+ {
70
+ "type": "null"
71
+ }
72
+ ],
73
+ "title": "Experiment File",
74
+ "description": "OSS URL to CSV file with 'mutant' and 'score' columns for training (required for train mode)"
75
+ },
76
+ "score_col_name": {
77
+ "type": "string",
78
+ "title": "Score Col Name",
79
+ "description": "Name of score column in experiment_file to train"
80
+ },
81
+ "model_path_list": {
82
+ "anyOf": [
83
+ {
84
+ "items": {
85
+ "type": "string"
86
+ },
87
+ "type": "array"
88
+ },
89
+ {
90
+ "type": "null"
91
+ }
92
+ ],
93
+ "title": "Model Path List",
94
+ "description": "List of trained model file paths or OSS URLs (required for inference mode)"
95
+ },
96
+ "site": {
97
+ "anyOf": [
98
+ {
99
+ "items": {
100
+ "type": "integer"
101
+ },
102
+ "type": "array"
103
+ },
104
+ {
105
+ "type": "null"
106
+ }
107
+ ],
108
+ "title": "Site",
109
+ "description": "Mutation site numbers for combination mutations in inference mode (default: [2, 3, 4])",
110
+ "default": [
111
+ 2,
112
+ 3,
113
+ 4
114
+ ]
115
+ },
116
+ "model_num": {
117
+ "type": "integer",
118
+ "title": "Model Num",
119
+ "description": "Number of ensemble models to train (for train mode, default: 5)",
120
+ "default": 5
121
+ },
122
+ "batch_size": {
123
+ "type": "integer",
124
+ "title": "Batch Size",
125
+ "description": "Batch size for embedding extraction during training (for train mode, default: 4)",
126
+ "default": 4
127
+ },
128
+ "inference_batch_size": {
129
+ "type": "integer",
130
+ "title": "Inference Batch Size",
131
+ "description": "Batch size for embedding extraction during inference (for inference mode, default: 32)",
132
+ "default": 32
133
+ },
134
+ "config": {
135
+ "anyOf": [
136
+ {
137
+ "type": "string"
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ],
143
+ "title": "Config",
144
+ "description": "Path to VenusPrime config YAML file (optional, default: venusprime_config.yaml in script directory)"
145
+ },
146
+ "target_server": {
147
+ "type": "string",
148
+ "title": "Target Server",
149
+ "description": "Target server for job submission: 'slurm' or 'paracloud'",
150
+ "default": "slurm"
151
+ }
152
+ },
153
+ "type": "object",
154
+ "title": "VenusPrimeInput",
155
+ "description": "Input for VenusPrime multi-point combination mutation prediction (light=ridge regression, pro=reserved)"
156
+ },
157
+ "isBinary": false
158
+ },
159
+ "responses": [
160
+ {
161
+ "statusCode": "200",
162
+ "description": "Successful Response",
163
+ "contentType": "application/json",
164
+ "schema": {
165
+ "properties": {
166
+ "tool_call_id": {
167
+ "type": "string",
168
+ "title": "Tool Call Id",
169
+ "description": "系统生成的调用唯一ID"
170
+ },
171
+ "status": {
172
+ "description": "调用状态: running, success, error 等",
173
+ "type": "string",
174
+ "enum": [
175
+ "pending",
176
+ "running",
177
+ "success",
178
+ "error"
179
+ ],
180
+ "title": "ToolResultStatus"
181
+ },
182
+ "result": {
183
+ "anyOf": [
184
+ {},
185
+ {
186
+ "type": "null"
187
+ }
188
+ ],
189
+ "title": "Result",
190
+ "description": "如果即时成功,这里是工具的返回结果字典"
191
+ },
192
+ "error_message": {
193
+ "anyOf": [
194
+ {
195
+ "type": "string"
196
+ },
197
+ {
198
+ "type": "null"
199
+ }
200
+ ],
201
+ "title": "Error Message",
202
+ "description": "如果有错误,提供错误信息"
203
+ },
204
+ "credits_cost": {
205
+ "anyOf": [
206
+ {
207
+ "type": "number"
208
+ },
209
+ {
210
+ "type": "null"
211
+ }
212
+ ],
213
+ "title": "Credits Cost",
214
+ "description": "消费积分"
215
+ },
216
+ "tool_name": {
217
+ "type": "string",
218
+ "title": "Tool Name",
219
+ "description": "执行的工具名"
220
+ }
221
+ },
222
+ "type": "object",
223
+ "required": [
224
+ "tool_call_id",
225
+ "status",
226
+ "tool_name"
227
+ ],
228
+ "title": "ToolInvokeResponse"
229
+ },
230
+ "isBinary": false
231
+ },
232
+ {
233
+ "statusCode": "422",
234
+ "description": "Validation Error",
235
+ "contentType": "application/json",
236
+ "schema": {
237
+ "properties": {
238
+ "detail": {
239
+ "items": {
240
+ "properties": {
241
+ "loc": {
242
+ "items": {
243
+ "anyOf": [
244
+ {
245
+ "type": "string"
246
+ },
247
+ {
248
+ "type": "integer"
249
+ }
250
+ ]
251
+ },
252
+ "type": "array",
253
+ "title": "Location"
254
+ },
255
+ "msg": {
256
+ "type": "string",
257
+ "title": "Message"
258
+ },
259
+ "type": {
260
+ "type": "string",
261
+ "title": "Error Type"
262
+ }
263
+ },
264
+ "type": "object",
265
+ "required": [
266
+ "loc",
267
+ "msg",
268
+ "type"
269
+ ],
270
+ "title": "ValidationError"
271
+ },
272
+ "type": "array",
273
+ "title": "Detail"
274
+ }
275
+ },
276
+ "type": "object",
277
+ "title": "HTTPValidationError"
278
+ },
279
+ "isBinary": false
280
+ }
281
+ ],
282
+ "security": [
283
+ "HTTPBearer"
284
+ ]
285
+ }, null, 2));
286
+ return;
287
+ }
288
+ try {
289
+ const currentBaseUrl = options.baseUrl || baseUrl;
290
+ const config = { baseUrl: currentBaseUrl };
291
+ const path = '/api/tools/predict/venusprime-multipoint';
292
+ const url = path;
293
+ const body = options.body ? JSON.parse(options.body) : undefined;
294
+ const response = await (0, client_1.request)(config, {
295
+ method: 'post',
296
+ path: url,
297
+ headers: undefined,
298
+ body: body,
299
+ isBinary: false,
300
+ });
301
+ const data = response;
302
+ if (options.output === 'json') {
303
+ console.log(JSON.stringify(data, null, 2));
304
+ }
305
+ else {
306
+ console.log(data);
307
+ }
308
+ }
309
+ catch (error) {
310
+ if (error.status) {
311
+ console.error('API Error:', error.status, error.message);
312
+ if (error.data) {
313
+ console.error(JSON.stringify(error.data, null, 2));
314
+ }
315
+ }
316
+ else {
317
+ console.error('Error:', error.message);
318
+ }
319
+ process.exit(1);
320
+ }
321
+ });
322
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function register(program: Command, baseUrl: string): void;
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.register = register;
4
+ const client_1 = require("../client");
5
+ function register(program, baseUrl) {
6
+ program
7
+ .command('venusrem-mutation-prediction')
8
+ .description('Venusrem Mutation')
9
+ .option('--body <json>', 'Request body as JSON string', (value) => value)
10
+ .option('--base-url <url>', 'Override base URL')
11
+ .option('--output <format>', 'Output format: json, table', 'json')
12
+ .option('--schema', 'Show API schema and exit')
13
+ .action(async (options) => {
14
+ if (options.schema) {
15
+ console.log(JSON.stringify({
16
+ "method": "post",
17
+ "operationId": "venusrem_mutation_prediction",
18
+ "summary": "Venusrem Mutation",
19
+ "tags": [
20
+ "tools-predict"
21
+ ],
22
+ "parameters": [],
23
+ "requestBody": {
24
+ "required": true,
25
+ "contentType": "application/json",
26
+ "schema": {
27
+ "properties": {
28
+ "task": {
29
+ "type": "string",
30
+ "title": "Task",
31
+ "description": "Prediction task: activity, binding, stability, expression, general (see venusrem_config.yaml)"
32
+ },
33
+ "mode": {
34
+ "type": "string",
35
+ "title": "Mode",
36
+ "description": "Model mode: pro for structure-based multi-model, light for sequence-based multi-model"
37
+ },
38
+ "structure_file": {
39
+ "anyOf": [
40
+ {
41
+ "type": "string"
42
+ },
43
+ {
44
+ "type": "null"
45
+ }
46
+ ],
47
+ "title": "Structure File",
48
+ "description": "OSS URL to structure file (required when mode=pro)"
49
+ },
50
+ "sequence": {
51
+ "anyOf": [
52
+ {
53
+ "type": "string"
54
+ },
55
+ {
56
+ "type": "null"
57
+ }
58
+ ],
59
+ "title": "Sequence",
60
+ "description": "Protein sequence in single letter amino acid code (for mode=light)"
61
+ },
62
+ "fasta_file": {
63
+ "anyOf": [
64
+ {
65
+ "type": "string"
66
+ },
67
+ {
68
+ "type": "null"
69
+ }
70
+ ],
71
+ "title": "Fasta File",
72
+ "description": "OSS URL to FASTA file (for mode=light)"
73
+ },
74
+ "config": {
75
+ "anyOf": [
76
+ {
77
+ "type": "string"
78
+ },
79
+ {
80
+ "type": "null"
81
+ }
82
+ ],
83
+ "title": "Config",
84
+ "description": "Path to venusrem_config.yaml file (optional)"
85
+ }
86
+ },
87
+ "type": "object",
88
+ "required": [
89
+ "task",
90
+ "mode"
91
+ ],
92
+ "title": "VenusREMInput",
93
+ "description": "Input for VenusREM multi-model mutation prediction (pro/light)"
94
+ },
95
+ "isBinary": false
96
+ },
97
+ "responses": [
98
+ {
99
+ "statusCode": "200",
100
+ "description": "Successful Response",
101
+ "contentType": "application/json",
102
+ "schema": {
103
+ "properties": {
104
+ "tool_call_id": {
105
+ "type": "string",
106
+ "title": "Tool Call Id",
107
+ "description": "系统生成的调用唯一ID"
108
+ },
109
+ "status": {
110
+ "description": "调用状态: running, success, error 等",
111
+ "type": "string",
112
+ "enum": [
113
+ "pending",
114
+ "running",
115
+ "success",
116
+ "error"
117
+ ],
118
+ "title": "ToolResultStatus"
119
+ },
120
+ "result": {
121
+ "anyOf": [
122
+ {},
123
+ {
124
+ "type": "null"
125
+ }
126
+ ],
127
+ "title": "Result",
128
+ "description": "如果即时成功,这里是工具的返回结果字典"
129
+ },
130
+ "error_message": {
131
+ "anyOf": [
132
+ {
133
+ "type": "string"
134
+ },
135
+ {
136
+ "type": "null"
137
+ }
138
+ ],
139
+ "title": "Error Message",
140
+ "description": "如果有错误,提供错误信息"
141
+ },
142
+ "credits_cost": {
143
+ "anyOf": [
144
+ {
145
+ "type": "number"
146
+ },
147
+ {
148
+ "type": "null"
149
+ }
150
+ ],
151
+ "title": "Credits Cost",
152
+ "description": "消费积分"
153
+ },
154
+ "tool_name": {
155
+ "type": "string",
156
+ "title": "Tool Name",
157
+ "description": "执行的工具名"
158
+ }
159
+ },
160
+ "type": "object",
161
+ "required": [
162
+ "tool_call_id",
163
+ "status",
164
+ "tool_name"
165
+ ],
166
+ "title": "ToolInvokeResponse"
167
+ },
168
+ "isBinary": false
169
+ },
170
+ {
171
+ "statusCode": "422",
172
+ "description": "Validation Error",
173
+ "contentType": "application/json",
174
+ "schema": {
175
+ "properties": {
176
+ "detail": {
177
+ "items": {
178
+ "properties": {
179
+ "loc": {
180
+ "items": {
181
+ "anyOf": [
182
+ {
183
+ "type": "string"
184
+ },
185
+ {
186
+ "type": "integer"
187
+ }
188
+ ]
189
+ },
190
+ "type": "array",
191
+ "title": "Location"
192
+ },
193
+ "msg": {
194
+ "type": "string",
195
+ "title": "Message"
196
+ },
197
+ "type": {
198
+ "type": "string",
199
+ "title": "Error Type"
200
+ }
201
+ },
202
+ "type": "object",
203
+ "required": [
204
+ "loc",
205
+ "msg",
206
+ "type"
207
+ ],
208
+ "title": "ValidationError"
209
+ },
210
+ "type": "array",
211
+ "title": "Detail"
212
+ }
213
+ },
214
+ "type": "object",
215
+ "title": "HTTPValidationError"
216
+ },
217
+ "isBinary": false
218
+ }
219
+ ],
220
+ "security": [
221
+ "HTTPBearer"
222
+ ]
223
+ }, null, 2));
224
+ return;
225
+ }
226
+ try {
227
+ const currentBaseUrl = options.baseUrl || baseUrl;
228
+ const config = { baseUrl: currentBaseUrl };
229
+ const path = '/api/tools/predict/venusrem-mutation';
230
+ const url = path;
231
+ const body = options.body ? JSON.parse(options.body) : undefined;
232
+ const response = await (0, client_1.request)(config, {
233
+ method: 'post',
234
+ path: url,
235
+ headers: undefined,
236
+ body: body,
237
+ isBinary: false,
238
+ });
239
+ const data = response;
240
+ if (options.output === 'json') {
241
+ console.log(JSON.stringify(data, null, 2));
242
+ }
243
+ else {
244
+ console.log(data);
245
+ }
246
+ }
247
+ catch (error) {
248
+ if (error.status) {
249
+ console.error('API Error:', error.status, error.message);
250
+ if (error.data) {
251
+ console.error(JSON.stringify(error.data, null, 2));
252
+ }
253
+ }
254
+ else {
255
+ console.error('Error:', error.message);
256
+ }
257
+ process.exit(1);
258
+ }
259
+ });
260
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function register(program: Command, baseUrl: string): void;