-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGenomeFileUtil.spec
447 lines (368 loc) · 15.4 KB
/
GenomeFileUtil.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
/*
*/
#include <KBaseGenomes.spec>
#include <workspace.spec>
module GenomeFileUtil {
/* A boolean - 0 for false, 1 for true.
@range (0, 1)
*/
typedef int boolean;
typedef structure {
string path;
string shock_id;
string ftp_url;
} File;
typedef mapping<string, string> usermeta;
/*
genome_name - becomes the name of the object
workspace_id - the immutable, numeric ID of the target workspace. Always prefer
providing the ID over the name.
workspace_name - the name of the workspace it gets saved to.
source - Source of the file typically something like RefSeq or Ensembl
taxon_ws_name - where the reference taxons are : ReferenceTaxons
taxon_id - if defined, will try to link the Genome to the specified
taxonomy id in lieu of performing the lookup during upload
release - Release or version number of the data
per example Ensembl has numbered releases of all their data: Release 31
generate_ids_if_needed - If field used for feature id is not there,
generate ids (default behavior is raising an exception)
genetic_code - Genetic code of organism. Overwrites determined GC from
taxon object
scientific_name - will be used to set the scientific name of the genome
and link to a taxon
generate_missing_genes - If the file has CDS or mRNA with no corresponding
gene, generate a spoofed gene.
use_existing_assembly - Supply an existing assembly reference
*/
typedef structure {
File file;
int workspace_id;
string genome_name;
string workspace_name;
string source;
string taxon_wsname;
string taxon_id;
string release;
string generate_ids_if_needed;
int genetic_code;
string scientific_name;
usermeta metadata;
boolean generate_missing_genes;
string use_existing_assembly;
} GenbankToGenomeParams;
typedef structure {
string genome_ref;
} GenomeSaveResult;
funcdef genbank_to_genome(GenbankToGenomeParams params)
returns (GenomeSaveResult result) authentication required;
typedef structure {
File file;
string genome_name;
string source;
string taxon_wsname;
string taxon_id;
string release;
string generate_ids_if_needed;
int genetic_code;
string scientific_name;
usermeta metadata;
boolean generate_missing_genes;
string use_existing_assembly;
} GenbankToGenomeInput;
typedef structure {
int workspace_id;
list<GenbankToGenomeInput> inputs;
} GenbanksToGenomesParams;
typedef structure {
string genome_ref;
string assembly_ref;
string assembly_path;
Workspace.object_info assembly_info;
Workspace.object_info genome_info;
} GenbankToGenomeSaveResult;
/* Results for the genbanks_to_genomes function.
results - the results of the save operation in the same order as the input.
*/
typedef structure {
list<GenbankToGenomeSaveResult> results;
} GenbanksToGenomesSaveResults;
funcdef genbanks_to_genomes(GenbanksToGenomesParams params)
returns (GenbanksToGenomesSaveResults results) authentication required;
/*
is_gtf - optional flag switching export to GTF format (default is 0,
which means GFF)
target_dir - optional target directory to create file in (default is
temporary folder with name 'gff_<timestamp>' created in scratch)
*/
typedef structure {
string genome_ref;
list <string> ref_path_to_genome;
boolean is_gtf;
string target_dir;
} GenomeToGFFParams;
/* from_cache is 1 if the file already exists and was just returned, 0 if
the file was generated during this call. */
typedef structure {
string file_path;
boolean from_cache;
} GenomeToGFFResult;
funcdef genome_to_gff(GenomeToGFFParams params)
returns (GenomeToGFFResult result) authentication required;
/*
is_gtf - optional flag switching export to GTF format (default is 0,
which means GFF)
target_dir - optional target directory to create file in (default is
temporary folder with name 'gff_<timestamp>' created in scratch)
*/
typedef structure {
string metagenome_ref;
list <string> ref_path_to_genome;
boolean is_gtf;
string target_dir;
} MetagenomeToGFFParams;
typedef structure {
string file_path;
boolean from_cache;
} MetagenomeToGFFResult;
typedef structure {
string metagenome_ref;
} MetagenomeSaveResult;
funcdef metagenome_to_gff(MetagenomeToGFFParams params)
returns (MetagenomeToGFFResult result) authentication required;
typedef structure {
string genome_ref;
list <string> ref_path_to_genome;
} GenomeToGenbankParams;
typedef structure {
string file_path;
} GBFile;
/* from_cache is 1 if the file already exists and was just returned, 0 if
the file was generated during this call. */
typedef structure {
GBFile genbank_file;
boolean from_cache;
} GenomeToGenbankResult;
funcdef genome_to_genbank(GenomeToGenbankParams params)
returns (GenomeToGenbankResult result) authentication required;
typedef structure {
string file_path;
} FASTAResult;
/*
Produce a FASTA file with the nucleotide sequences of features in a genome.
string genome_ref: reference to a genome object
list<string> feature_lists: Optional, which features lists (features, mrnas, cdss, non_coding_features) to provide sequences. Defaults to "features".
list<string> filter_ids: Optional, if provided only return sequences for matching features.
boolean include_functions: Optional, add function to header line. Defaults to True.
boolean include_aliases: Optional, add aliases to header line. Defaults to True.
*/
typedef structure {
string genome_ref;
list<string> feature_lists;
list<string> filter_ids;
boolean include_functions;
boolean include_aliases;
} GenomeFeaturesToFastaParams;
funcdef genome_features_to_fasta(GenomeFeaturesToFastaParams params)
returns (FASTAResult result) authentication required;
/*
Produce a FASTA file with the protein sequences of CDSs in a genome.
string genome_ref: reference to a genome object
list<string> filter_ids: Optional, if provided only return sequences for matching features.
boolean include_functions: Optional, add function to header line. Defaults to True.
boolean include_aliases: Optional, add aliases to header line. Defaults to True.
*/
typedef structure {
string genome_ref;
list<string> filter_ids;
boolean include_functions;
boolean include_aliases;
} GenomeProteinToFastaParams;
funcdef genome_proteins_to_fasta(GenomeProteinToFastaParams params)
returns (FASTAResult result) authentication required;
/* input and output structure functions for standard downloaders */
typedef structure {
string input_ref;
} ExportParams;
typedef structure {
string shock_id;
} ExportOutput;
funcdef export_genome_as_genbank(ExportParams params)
returns (ExportOutput output) authentication required;
funcdef export_genome_as_gff(ExportParams params)
returns (ExportOutput output) authentication required;
funcdef export_metagenome_as_gff(ExportParams params)
returns (ExportOutput output) authentication required;
/*
genome_name - becomes the name of the object
workspace_name - the name of the workspace it gets saved to.
source - Source of the file typically something like RefSeq or Ensembl
taxon_ws_name - where the reference taxons are : ReferenceTaxons
taxon_id - if defined, will try to link the Genome to the specified
taxonomy id in lieu of performing the lookup during upload
release - Release or version number of the data
per example Ensembl has numbered releases of all their data: Release 31
genetic_code - Genetic code of organism. Overwrites determined GC from
taxon object
scientific_name - will be used to set the scientific name of the genome
and link to a taxon
generate_missing_genes - If the file has CDS or mRNA with no corresponding
gene, generate a spoofed gene. Off by default
existing_assembly_ref - a KBase assembly upa, to associate the genome with.
Avoids saving a new assembly when specified.
*/
typedef structure {
File fasta_file;
File gff_file;
string genome_name;
string workspace_name;
string source;
string taxon_wsname;
string taxon_id;
string release;
int genetic_code;
string scientific_name;
usermeta metadata;
boolean generate_missing_genes;
string existing_assembly_ref;
} FastaGFFToGenomeParams;
funcdef fasta_gff_to_genome(FastaGFFToGenomeParams params)
returns (GenomeSaveResult returnVal) authentication required;
/* As above but returns the genome instead */
funcdef fasta_gff_to_genome_json(FastaGFFToGenomeParams params)
returns (UnspecifiedObject genome) authentication required;
/*
genome_name - becomes the name of the object
workspace_name - the name of the workspace it gets saved to.
source - Source of the file typically something like RefSeq or Ensembl
taxon_ws_name - where the reference taxons are : ReferenceTaxons
taxon_id - if defined, will try to link the Genome to the specified
taxonomy id in lieu of performing the lookup during upload
release - Release or version number of the data
per example Ensembl has numbered releases of all their data: Release 31
genetic_code - Genetic code of organism. Overwrites determined GC from
taxon object
scientific_name - will be used to set the scientific name of the genome
and link to a taxon
generate_missing_genes - If the file has CDS or mRNA with no corresponding
gene, generate a spoofed gene. Off by default
existing_assembly_ref - a KBase assembly upa, to associate the metagenome with.
Avoids saving a new assembly when specified.
*/
typedef structure {
File fasta_file;
File gff_file;
string genome_name;
string workspace_name;
string source;
usermeta metadata;
boolean generate_missing_genes;
string existing_assembly_ref;
} FastaGFFToMetagenomeParams;
funcdef fasta_gff_to_metagenome(FastaGFFToMetagenomeParams params)
returns (MetagenomeSaveResult returnVal) authentication required;
typedef structure {
string workspace;
string name;
KBaseGenomes.Genome data;
boolean hidden;
boolean upgrade;
} SaveOneGenomeParams;
typedef structure {
Workspace.object_info info;
} SaveGenomeResult;
funcdef save_one_genome(SaveOneGenomeParams params)
returns (SaveGenomeResult returnVal) authentication required;
/*
gff_file - object containing path to gff_file
ws_ref - input Assembly or Genome reference
genome_name - becomes the name of the object
workspace_name - the name of the workspace it gets saved to.
source - Source of the file typically something like RefSeq or Ensembl
taxon_ws_name - where the reference taxons are : ReferenceTaxons
taxon_id - if defined, will try to link the Genome to the specified
taxonomy id in lieu of performing the lookup during upload
release - Release or version number of the data
per example Ensembl has numbered releases of all their data: Release 31
genetic_code - Genetic code of organism. Overwrites determined GC from
taxon object
scientific_name - will be used to set the scientific name of the genome
and link to a taxon
metadata - any user input metadata
generate_missing_genes - If the file has CDS or mRNA with no corresponding
gene, generate a spoofed gene. Off by default
*/
typedef structure {
string ws_ref;
File gff_file;
string genome_name;
string workspace_name;
string source;
string taxon_wsname;
string taxon_id;
string release;
int genetic_code;
string scientific_name;
usermeta metadata;
boolean generate_missing_genes;
} WsObjGFFToGenomeParams;
/*
This function takes in a workspace object of type KBaseGenomes.Genome or KBaseGenomeAnnotations.Assembly and a gff file and produces a KBaseGenomes.Genome reanotated according to the the input gff file.
*/
funcdef ws_obj_gff_to_genome(WsObjGFFToGenomeParams params)
returns (GenomeSaveResult returnVal) authentication required;
/*
gff_file - object containing path to gff_file
ws_ref - input Assembly or AnnotatedMetagenomeAssembly reference
genome_name - becomes the name of the object
workspace_name - the name of the workspace it gets saved to.
source - Source of the file typically something like RefSeq or Ensembl
genetic_code - Genetic code of organism. Overwrites determined GC from
taxon object
metadata - any user input metadata
generate_missing_genes - If the file has CDS or mRNA with no corresponding
gene, generate a spoofed gene. Off by default
*/
typedef structure {
string ws_ref;
File gff_file;
string genome_name;
string workspace_name;
string source;
usermeta metadata;
boolean generate_missing_genes;
} WsObjGFFToMetagenomeParams;
/*
This function takes in a workspace object of type KBaseMetagenomes.AnnotatedMetagenomeAssembly or KBaseGenomeAnnotations.Assembly and a gff file and produces a KBaseMetagenomes.AnnotatedMetagenomeAssembly reanotated according to the the input gff file.
*/
funcdef ws_obj_gff_to_metagenome(WsObjGFFToMetagenomeParams params)
returns (MetagenomeSaveResult returnVal) authentication required;
/*
Parameters for the update_taxon_assignments function.
Fields:
workspace_id: a workspace UPA of a Genome object
taxon_assignments: an optional mapping of assignments to add or replace. This will perform a
merge on the existing assignments. Any new assignments are added, while any existing
assignments are replaced.
remove_assignments: an optional list of assignment names to remove.
@optional taxon_assignments remove_assignments
*/
typedef structure {
int workspace_id;
int object_id;
mapping<string, string> taxon_assignments;
list<string> remove_assignments;
} UpdateTaxonAssignmentsParams;
/*
Result of the update_taxon_assignments function.
Fields:
ws_obj_ref: a workspace UPA of a Genome object
*/
typedef structure {
string ws_obj_ref;
} UpdateTaxonAssignmentsResult;
/*
Add, replace, or remove taxon assignments for a Genome object.
*/
funcdef update_taxon_assignments(UpdateTaxonAssignmentsParams params)
returns (UpdateTaxonAssignmentsResult returnVal) authentication required;
};