forked from kbaseapps/GenericsAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenericsAPI.spec
552 lines (462 loc) · 17.9 KB
/
GenericsAPI.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
/*
A KBase module: GenericsAPI
*/
#include <KBaseExperiments.spec>
module GenericsAPI {
/* A boolean - 0 for false, 1 for true.
*/
typedef int boolean;
/* An X/Y/Z style reference
*/
typedef string obj_ref;
/* workspace name of the object */
typedef string workspace_name;
/* Input of the fetch_data function
obj_ref: generics object reference
Optional arguments:
generics_module: the generics data module to be retrieved from
e.g. for an given data type like below:
typedef structure {
FloatMatrix2D data;
condition_set_ref condition_set_ref;
} SomeGenericsMatrix;
generics_module should be
{'data': 'FloatMatrix2D',
'condition_set_ref': 'condition_set_ref'}
*/
typedef structure {
obj_ref obj_ref;
mapping<string, string> generics_module;
} FetchDataParams;
/* Ouput of the fetch_data function
data_matrix: a pandas dataframe in json format
*/
typedef structure {
string data_matrix;
} FetchDataReturn;
/* fetch_data: fetch generics data as pandas dataframe for a generics data object*/
funcdef fetch_data(FetchDataParams params) returns(FetchDataReturn returnVal) authentication required;
/* Input of the export_matrix function
obj_ref: generics object reference
Optional arguments:
generics_module: select the generics data to be retrieved from
e.g. for an given data type like below:
typedef structure {
FloatMatrix2D data;
condition_set_ref condition_set_ref;
} SomeGenericsMatrix;
and only 'FloatMatrix2D' is needed
generics_module should be
{'data': FloatMatrix2D'}
*/
typedef structure {
obj_ref obj_ref;
mapping<string, string> generics_module;
} ExportParams;
typedef structure {
string shock_id;
} ExportOutput;
funcdef export_matrix (ExportParams params) returns (ExportOutput returnVal) authentication required;
/* Input of the validate_data function
obj_type: obj type e.g.: 'KBaseMatrices.ExpressionMatrix-1.1'
data: data to be validated
*/
typedef structure {
string obj_type;
mapping<string, string> data;
} ValidateParams;
typedef structure {
boolean validated;
mapping<string, string> failed_constraint;
} ValidateOutput;
/* validate_data: validate data*/
funcdef validate_data (ValidateParams params) returns (ValidateOutput returnVal) authentication required;
/* Input of the import_matrix_from_excel function
obj_type: a type in KBaseMatrices
input_shock_id: file shock id
input_file_path: absolute file path
input_staging_file_path: staging area file path
matrix_name: matrix object name
description: optional, a description of the matrix
workspace_name: workspace name matrix object to be saved to
optional:
col_attributemapping_ref: column AttributeMapping reference
row_attributemapping_ref: row AttributeMapping reference
genome_ref: genome reference
diff_expr_matrix_ref: DifferentialExpressionMatrix reference
biochemistry_ref: (for ChemicalAbundanceMatrix)
reads_set_ref: (raw data for AmpliconMatrix)
sample_set_ref: SampleSet object reference
*/
typedef structure {
string obj_type;
string input_shock_id;
string input_file_path;
string input_staging_file_path;
string matrix_name;
string amplicon_set_name;
string scale;
string description;
workspace_name workspace_name;
obj_ref genome_ref;
obj_ref col_attributemapping_ref;
obj_ref row_attributemapping_ref;
obj_ref diff_expr_matrix_ref;
obj_ref biochemistry_ref;
obj_ref reads_set_ref;
obj_ref sample_set_ref;
string unit;
string type;
} ImportMatrixParams;
typedef structure {
string report_name;
string report_ref;
obj_ref matrix_obj_ref;
} ImportMatrixOutput;
/* import_matrix_from_excel: import matrix object from excel*/
funcdef import_matrix_from_excel (ImportMatrixParams params) returns (ImportMatrixOutput returnVal) authentication required;
typedef structure {
string obj_type;
string taxonomic_abundance_tsv;
string taxonomic_fasta;
string input_local_file;
string matrix_name;
string amplicon_set_name;
string scale;
string description;
workspace_name workspace_name;
obj_ref genome_ref;
obj_ref col_attributemapping_ref;
obj_ref row_attributemapping_ref;
obj_ref diff_expr_matrix_ref;
obj_ref biochemistry_ref;
obj_ref reads_set_ref;
obj_ref sample_set_ref;
list<string> metadata_keys;
string extraction_kit;
string amplicon_type;
string target_gene_region;
string forward_primer_sequence;
string reverse_primer_sequence;
string sequencing_platform;
string sequencing_run;
string sequencing_kit;
string sequencing_quality_filter_cutoff;
float clustering_cutoff;
string clustering_method;
} ImportOTUParams;
/* import_matrix_from_biom: import matrix object from BIOM file format*/
funcdef import_matrix_from_biom (ImportOTUParams params) returns (ImportMatrixOutput returnVal) authentication required;
/* Input of the import_matrix_from_excel function
obj_type: saving object data type
obj_name: saving object name
data: data to be saved
workspace_name: workspace name matrix object to be saved to
*/
typedef structure {
string obj_type;
string obj_name;
mapping<string, string> data;
workspace_name workspace_name;
} SaveObjectParams;
typedef structure {
obj_ref obj_ref;
} SaveObjectOutput;
/* save_object: validate data constraints and save matrix object*/
funcdef save_object (SaveObjectParams params) returns (SaveObjectOutput returnVal) authentication required;
/* Input of the search_matrix function
matrix_obj_ref: object reference of a matrix
workspace_name: workspace name objects to be saved to
*/
typedef structure {
obj_ref matrix_obj_ref;
workspace_name workspace_name;
} MatrixSelectorParams;
typedef structure {
string report_name;
string report_ref;
} MatrixSelectorOutput;
/* search_matrix: generate a HTML report that allows users to select feature ids*/
funcdef search_matrix (MatrixSelectorParams params) returns (MatrixSelectorOutput returnVal) authentication required;
/* Input of the filter_matrix function
matrix_obj_ref: object reference of a matrix
workspace_name: workspace name objects to be saved to
filter_ids: string of column or row ids that result matrix contains
filtered_matrix_name: name of newly created filtered matrix object
*/
typedef structure {
obj_ref matrix_obj_ref;
workspace_name workspace_name;
string filtered_matrix_name;
string remove_ids;
string dimension;
} MatrixFilterParams;
typedef structure {
string report_name;
string report_ref;
list<obj_ref> matrix_obj_refs;
} MatrixFilterOutput;
/* filter_matrix: create sub-matrix based on input filter_ids*/
funcdef filter_matrix (MatrixFilterParams params) returns (MatrixFilterOutput returnVal) authentication required;
/* Input of the standardize_matrix function
input_matrix_ref: object reference of a matrix
workspace_name: workspace name objects to be saved to
with_mean: center data before scaling
with_std: scale data to unit variance
new_matrix_name: name of newly created matrix object
*/
typedef structure {
obj_ref input_matrix_ref;
workspace_name workspace_name;
boolean with_mean;
boolean with_std;
string dimension;
string new_matrix_name;
} StandardizeMatrixParams;
typedef structure {
string report_name;
string report_ref;
obj_ref new_matrix_obj_ref;
} StandardizeMatrixOutput;
/* standardize_matrix: standardize a matrix*/
funcdef standardize_matrix (StandardizeMatrixParams params) returns (StandardizeMatrixOutput returnVal) authentication required;
typedef structure {
obj_ref input_matrix_ref;
workspace_name workspace_name;
int workspace_id;
string new_matrix_name;
mapping<string, string> abundance_filtering_params;
mapping<string, string> standardization_params;
mapping<string, string> ratio_transformation_params;
boolean perform_relative_abundance;
} TransformMatrixParams;
typedef structure {
string report_name;
string report_ref;
obj_ref new_matrix_obj_ref;
} TransformMatrixOutput;
funcdef transform_matrix (TransformMatrixParams params) returns (TransformMatrixOutput returnVal) authentication required;
typedef structure {
obj_ref input_matrix_ref;
int workspace_id;
string new_matrix_name;
int seed_number;
string dimension;
} RarefyMatrixParams;
typedef structure {
string report_name;
string report_ref;
obj_ref new_matrix_obj_ref;
} RarefyMatrixOutput;
funcdef perform_rarefy (RarefyMatrixParams params) returns (RarefyMatrixOutput returnVal) authentication required;
typedef structure {
obj_ref input_matrix_ref;
obj_ref attribute_mapping_obj_ref;
int workspace_id;
string dist_metric;
string dimension;
string grouping;
int permutations;
boolean perform_anosim;
boolean perform_permanova;
boolean perform_permdisp;
} VariableStatsParams;
typedef structure {
string report_name;
string report_ref;
} VariableStatsOutput;
funcdef perform_variable_stats_matrix (VariableStatsParams params) returns (VariableStatsOutput returnVal) authentication required;
typedef structure {
list<obj_ref> input_matrix_refs;
int workspace_id;
string dist_metric;
string dimension;
string correlation_method;
int permutations;
string alternative_hypothesis;
} MantelTestParams;
typedef structure {
string report_name;
string report_ref;
} MantelTestOutput;
funcdef perform_mantel_test (MantelTestParams params) returns (MantelTestOutput returnVal) authentication required;
/* ATTRIBUTE MAPPING */
/*
input_shock_id and input_file_path - alternative input params,
*/
typedef structure {
string input_shock_id;
string input_file_path;
string output_ws_id;
string output_obj_name;
} FileToAttributeMappingParams;
typedef structure {
obj_ref attribute_mapping_ref;
} FileToAttributeMappingOutput;
funcdef file_to_attribute_mapping(FileToAttributeMappingParams params)
returns (FileToAttributeMappingOutput result) authentication required;
funcdef file_to_fbamodel_attribute_mapping(FileToAttributeMappingParams params)
returns (FileToAttributeMappingOutput result) authentication required;
typedef structure {
string staging_file_subdir_path;
string dimension;
obj_ref input_matrix_ref;
string workspace_name;
string output_am_obj_name;
string output_matrix_obj_name;
} UpdateMatrixAMParams;
typedef structure {
string report_name;
string report_ref;
obj_ref new_matrix_obj_ref;
obj_ref new_attribute_mapping_ref;
} UpdateMatrixAMOutput;
funcdef update_matrix_attribute_mapping(UpdateMatrixAMParams params)
returns (UpdateMatrixAMOutput returnVal) authentication required;
typedef structure {
obj_ref input_ref;
string destination_dir;
} AttributeMappingToTsvFileParams;
typedef structure {
string file_path;
} AttributeMappingToTsvFileOutput;
funcdef attribute_mapping_to_tsv_file(AttributeMappingToTsvFileParams params)
returns (AttributeMappingToTsvFileOutput result) authentication required;
typedef structure {
obj_ref input_ref;
} ExportObjectParams;
funcdef export_attribute_mapping_tsv(ExportObjectParams params)
returns (ExportOutput result) authentication required;
funcdef export_attribute_mapping_excel(ExportObjectParams params)
returns (ExportOutput result) authentication required;
funcdef export_cluster_set_excel(ExportObjectParams params)
returns (ExportOutput result) authentication required;
funcdef export_corr_matrix_excel(ExportObjectParams params)
returns (ExportOutput result) authentication required;
funcdef export_pca_matrix_excel(ExportObjectParams params)
returns (ExportOutput result) authentication required;
funcdef export_amplicon_set_tsv(ExportObjectParams params)
returns (ExportOutput result) authentication required;
/* Input of the compute_correlation_matrix function
input_obj_ref: object reference of a matrix
workspace_name: workspace name objects to be saved to
corr_matrix_name: correlation matrix object name
dimension: compute correlation on column or row, one of ['col', 'row']
method: correlation method, one of ['pearson', 'kendall', 'spearman']
plot_corr_matrix: plot correlation matrix in report, default False
plot_scatter_matrix: plot scatter matrix in report, default False
compute_significance: also compute Significance in addition to correlation matrix
*/
typedef structure {
obj_ref input_obj_ref;
workspace_name workspace_name;
string corr_matrix_name;
string dimension;
string method;
boolean plot_corr_matrix;
boolean plot_scatter_matrix;
boolean compute_significance;
} CompCorrParams;
typedef structure {
string report_name;
string report_ref;
obj_ref corr_matrix_obj_ref;
} CompCorrOutput;
/* compute_correlation_matrix: create sub-matrix based on input filter_ids*/
funcdef compute_correlation_matrix (CompCorrParams params) returns (CompCorrOutput returnVal) authentication required;
/* Input of the compute_correlation_across_matrices function
matrix_ref_1: object reference of a matrix
matrix_ref_2: object reference of a matrix
workspace_name: workspace name objects to be saved to
corr_matrix_name: correlation matrix object name
dimension: compute correlation on column or row, one of ['col', 'row']
method: correlation method, one of ['pearson', 'kendall', 'spearman']
plot_corr_matrix: plot correlation matrix in report, default False
compute_significance: also compute Significance in addition to correlation matrix
*/
typedef structure {
obj_ref matrix_ref_1;
obj_ref matrix_ref_2;
workspace_name workspace_name;
string corr_matrix_name;
string dimension;
string method;
boolean plot_corr_matrix;
boolean compute_significance;
float corr_threshold;
} CompCorrMetriceParams;
/* compute_correlation_across_matrices: compute correlation matrix across matrices*/
funcdef compute_correlation_across_matrices (CompCorrMetriceParams params) returns (CompCorrOutput returnVal) authentication required;
/* Input of the build_network function
corr_matrix_ref: CorrelationMatrix object
workspace_name: workspace name objects to be saved to
network_obj_name: Network object name
filter_on_threshold: Dictory holder that holds filter on thredshold params
params in filter_on_threshold:
coefficient_threshold: correlation coefficient threshold (select pairs with greater correlation coefficient)
*/
typedef structure {
obj_ref corr_matrix_ref;
workspace_name workspace_name;
string network_obj_name;
mapping<string, string> filter_on_threshold;
} BuildNetworkParams;
typedef structure {
string report_name;
string report_ref;
obj_ref network_obj_ref;
} BuildNetworkOutput;
/* build_network: filter correlation matrix and build network*/
funcdef build_network (BuildNetworkParams params) returns (BuildNetworkOutput returnVal) authentication required;
/* Input of the run_pca function
input_obj_ref: object reference of a matrix
workspace_name: the name of the workspace
pca_matrix_name: name of PCA (KBaseExperiments.PCAMatrix) object
dimension: compute PCA on column or row, one of ['col', 'row']
n_components - number of components (default 2)
attribute_mapping_obj_ref - associated attribute_mapping_obj_ref
scale_size_by - used for PCA plot to scale data size
color_marker_by - used for PCA plot to group data
*/
typedef structure {
obj_ref input_obj_ref;
string workspace_name;
string pca_matrix_name;
string dimension;
int n_components;
obj_ref attribute_mapping_obj_ref;
mapping<string, string> scale_size_by;
mapping<string, string> color_marker_by;
} PCAParams;
/* Ouput of the run_pca function
pca_ref: PCA object reference (as KBaseExperiments.PCAMatrix data type)
report_name: report name generated by KBaseReport
report_ref: report reference generated by KBaseReport
*/
typedef structure {
obj_ref pca_ref;
string report_name;
string report_ref;
} PCAOutput;
/* run_pca: PCA analysis on matrix*/
funcdef run_pca (PCAParams params) returns (PCAOutput returnVal) authentication required;
typedef structure {
obj_ref input_matrix_ref;
string workspace_name;
boolean with_attribute_info;
} ViewMatrixParams;
typedef structure {
string report_name;
string report_ref;
} ViewMatrixOutput;
/* view_matrix: generate a report for matrix viewer*/
funcdef view_matrix (ViewMatrixParams params) returns (ViewMatrixOutput returnVal) authentication required;
typedef structure {
string workspace_name;
int workspace_id;
obj_ref sample_set_ref;
mapping<string, int> chemical_data_included;
mapping<string, int> chemical_ids_included;
} ChemAbunTempParams;
funcdef build_chemical_abundance_template(ChemAbunTempParams params) returns (ViewMatrixOutput returnVal) authentication required;
};