pyxetabase 4.0.0.dev56__py3-none-any.whl

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.

Potentially problematic release.


This version of pyxetabase might be problematic. Click here for more details.

Files changed (36) hide show
  1. pyxetabase/__init__.py +0 -0
  2. pyxetabase/commons.py +347 -0
  3. pyxetabase/exceptions.py +8 -0
  4. pyxetabase/opencga_client.py +344 -0
  5. pyxetabase/opencga_config.py +211 -0
  6. pyxetabase/rest_clients/__init__.py +0 -0
  7. pyxetabase/rest_clients/_parent_rest_clients.py +144 -0
  8. pyxetabase/rest_clients/admin_client.py +179 -0
  9. pyxetabase/rest_clients/alignment_client.py +373 -0
  10. pyxetabase/rest_clients/clinical_analysis_client.py +1216 -0
  11. pyxetabase/rest_clients/cohort_client.py +349 -0
  12. pyxetabase/rest_clients/cvdb_client.py +2285 -0
  13. pyxetabase/rest_clients/disease_panel_client.py +345 -0
  14. pyxetabase/rest_clients/family_client.py +355 -0
  15. pyxetabase/rest_clients/federation_client.py +133 -0
  16. pyxetabase/rest_clients/file_client.py +710 -0
  17. pyxetabase/rest_clients/ga4gh_client.py +86 -0
  18. pyxetabase/rest_clients/individual_client.py +435 -0
  19. pyxetabase/rest_clients/job_client.py +416 -0
  20. pyxetabase/rest_clients/meta_client.py +85 -0
  21. pyxetabase/rest_clients/organization_client.py +216 -0
  22. pyxetabase/rest_clients/project_client.py +128 -0
  23. pyxetabase/rest_clients/sample_client.py +446 -0
  24. pyxetabase/rest_clients/study_client.py +462 -0
  25. pyxetabase/rest_clients/user_client.py +212 -0
  26. pyxetabase/rest_clients/user_tool_client.py +471 -0
  27. pyxetabase/rest_clients/variant_client.py +1378 -0
  28. pyxetabase/rest_clients/variant_operation_client.py +718 -0
  29. pyxetabase/rest_clients/workflow_client.py +263 -0
  30. pyxetabase/rest_response.py +220 -0
  31. pyxetabase/retry.py +57 -0
  32. pyxetabase-4.0.0.dev56.dist-info/METADATA +159 -0
  33. pyxetabase-4.0.0.dev56.dist-info/RECORD +36 -0
  34. pyxetabase-4.0.0.dev56.dist-info/WHEEL +5 -0
  35. pyxetabase-4.0.0.dev56.dist-info/licenses/LICENSE +202 -0
  36. pyxetabase-4.0.0.dev56.dist-info/top_level.txt +1 -0
@@ -0,0 +1,416 @@
1
+ """
2
+ WARNING: AUTOGENERATED CODE
3
+
4
+ This code was generated by a tool.
5
+
6
+ Manual changes to this file may cause unexpected behavior in your application.
7
+ Manual changes to this file will be overwritten if the code is regenerated.
8
+ """
9
+
10
+ from pyxetabase.rest_clients._parent_rest_clients import _ParentRestClient
11
+
12
+
13
+ class Job(_ParentRestClient):
14
+ """
15
+ This class contains methods for the 'Jobs' webservices
16
+ PATH: /{apiVersion}/jobs
17
+ """
18
+
19
+ def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
20
+ super(Job, self).__init__(configuration, token, login_handler, *args, **kwargs)
21
+
22
+ def update_acl(self, members, action, data=None, **options):
23
+ """
24
+ Update the set of permissions granted for the member.
25
+ PATH: /{apiVersion}/jobs/acl/{members}/update
26
+
27
+ :param dict data: JSON containing the parameters to add ACLs.
28
+ (REQUIRED)
29
+ :param str action: Action to be performed [ADD, SET, REMOVE or RESET].
30
+ Allowed values: ['SET ADD REMOVE RESET'] (REQUIRED)
31
+ :param str members: Comma separated list of user or group ids.
32
+ (REQUIRED)
33
+ """
34
+
35
+ options['action'] = action
36
+ return self._post(category='jobs', resource='update', subcategory='acl', second_query_id=members, data=data, **options)
37
+
38
+ def aggregation_stats(self, **options):
39
+ """
40
+ Fetch catalog job stats.
41
+ PATH: /{apiVersion}/jobs/aggregationStats
42
+
43
+ :param str study: Study [[organization@]project:]study where study and
44
+ project can be either the ID or UUID.
45
+ :param bool other_studies: Flag indicating the entries being queried
46
+ can belong to any related study, not just the primary one.
47
+ :param str id: Comma separated list of job IDs up to a maximum of 100.
48
+ Also admits basic regular expressions using the operator '~', i.e.
49
+ '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for
50
+ case insensitive search.
51
+ :param str uuid: Comma separated list of job UUIDs up to a maximum of
52
+ 100.
53
+ :param str tool_id: Tool ID executed by the job. Also admits basic
54
+ regular expressions using the operator '~', i.e. '~{perl-regex}'
55
+ e.g. '~value' for case sensitive, '~/value/i' for case insensitive
56
+ search.
57
+ :param str tool_type: Tool type executed by the job [OPERATION,
58
+ ANALYSIS].
59
+ :param str user_id: User that created the job.
60
+ :param str priority: Priority of the job.
61
+ :param str status: Filter by status.
62
+ :param str internal_status: Filter by internal status.
63
+ :param str creation_date: Creation date. Format: yyyyMMddHHmmss.
64
+ Examples: >2018, 2017-2018, <201805.
65
+ :param str modification_date: Modification date. Format:
66
+ yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
67
+ :param bool visited: Visited status of job.
68
+ :param str tags: Job tags.
69
+ :param str input: Comma separated list of file IDs used as input.
70
+ :param str output: Comma separated list of file IDs used as output.
71
+ :param str acl: Filter entries for which a user has the provided
72
+ permissions. Format: acl={user}:{permissions}. Example:
73
+ acl=john:WRITE,WRITE_ANNOTATIONS will return all entries for which
74
+ user john has both WRITE and WRITE_ANNOTATIONS permissions. Only
75
+ study owners or administrators can query by this field. .
76
+ :param str release: Release when it was created.
77
+ :param bool deleted: Boolean to retrieve deleted entries.
78
+ :param str field: Field to apply aggregation statistics to (or a list
79
+ of fields separated by semicolons), e.g.:
80
+ studies;type;numSamples[0..10]:1;format:sum(size).
81
+ """
82
+
83
+ return self._get(category='jobs', resource='aggregationStats', **options)
84
+
85
+ def create(self, data=None, **options):
86
+ """
87
+ Register an executed job with POST method.
88
+ PATH: /{apiVersion}/jobs/create
89
+
90
+ :param dict data: job. (REQUIRED)
91
+ :param str study: Study [[organization@]project:]study where study and
92
+ project can be either the ID or UUID.
93
+ """
94
+
95
+ return self._post(category='jobs', resource='create', data=data, **options)
96
+
97
+ def distinct(self, field, **options):
98
+ """
99
+ Job distinct method.
100
+ PATH: /{apiVersion}/jobs/distinct
101
+
102
+ :param str field: Comma separated list of fields for which to obtain
103
+ the distinct values. (REQUIRED)
104
+ :param str study: Study [[organization@]project:]study where study and
105
+ project can be either the ID or UUID.
106
+ :param bool other_studies: Flag indicating the entries being queried
107
+ can belong to any related study, not just the primary one.
108
+ :param str id: Comma separated list of job IDs up to a maximum of 100.
109
+ Also admits basic regular expressions using the operator '~', i.e.
110
+ '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for
111
+ case insensitive search.
112
+ :param str uuid: Comma separated list of job UUIDs up to a maximum of
113
+ 100.
114
+ :param str type: Job type (NATIVE, WORKFLOW, CUSTOM or WALKER).
115
+ :param str tool_id: Tool ID executed by the job. Also admits basic
116
+ regular expressions using the operator '~', i.e. '~{perl-regex}'
117
+ e.g. '~value' for case sensitive, '~/value/i' for case insensitive
118
+ search.
119
+ :param str tool_type: Tool type executed by the job [OPERATION,
120
+ ANALYSIS].
121
+ :param str tool.external_executor.id: Id of the external executor.
122
+ This field is only applicable for jobs executed by an external
123
+ executor.
124
+ :param str parent_id: Job id that generated this job (if any).
125
+ :param bool dry_run: Flag indicating that the job will be executed in
126
+ dry-run mode. In this mode, OpenCGA will validate that all
127
+ parameters and prerequisites are correctly set for successful
128
+ execution, but the job will not actually run.
129
+ :param bool internal.kill_job_requested: Flag indicating that the user
130
+ requested to kill the job.
131
+ :param str user_id: User that created the job.
132
+ :param str priority: Priority of the job.
133
+ :param str status: Filter by status.
134
+ :param str internal_status: Filter by internal status.
135
+ :param str creation_date: Creation date. Format: yyyyMMddHHmmss.
136
+ Examples: >2018, 2017-2018, <201805.
137
+ :param str modification_date: Modification date. Format:
138
+ yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
139
+ :param bool visited: Visited status of job.
140
+ :param str tags: Job tags.
141
+ :param str input: Comma separated list of file IDs used as input.
142
+ :param str output: Comma separated list of file IDs used as output.
143
+ :param str acl: Filter entries for which a user has the provided
144
+ permissions. Format: acl={user}:{permissions}. Example:
145
+ acl=john:WRITE,WRITE_ANNOTATIONS will return all entries for which
146
+ user john has both WRITE and WRITE_ANNOTATIONS permissions. Only
147
+ study owners or administrators can query by this field. .
148
+ :param str release: Release when it was created.
149
+ :param bool deleted: Boolean to retrieve deleted entries.
150
+ """
151
+
152
+ options['field'] = field
153
+ return self._get(category='jobs', resource='distinct', **options)
154
+
155
+ def retry(self, data=None, **options):
156
+ """
157
+ Relaunch a failed job.
158
+ PATH: /{apiVersion}/jobs/retry
159
+
160
+ :param dict data: job. (REQUIRED)
161
+ :param str job_id: Job ID. It must be a unique string within the
162
+ study. An ID will be autogenerated automatically if not provided.
163
+ :param str job_description: Job description.
164
+ :param str job_depends_on: Comma separated list of existing job IDs
165
+ the job will depend on.
166
+ :param str job_tags: Job tags.
167
+ :param str job_scheduled_start_time: Time when the job is scheduled to
168
+ start.
169
+ :param str study: Study [[organization@]project:]study where study and
170
+ project can be either the ID or UUID.
171
+ """
172
+
173
+ return self._post(category='jobs', resource='retry', data=data, **options)
174
+
175
+ def search(self, **options):
176
+ """
177
+ Job search method.
178
+ PATH: /{apiVersion}/jobs/search
179
+
180
+ :param str include: Fields included in the response, whole JSON path
181
+ must be provided.
182
+ :param str exclude: Fields excluded in the response, whole JSON path
183
+ must be provided.
184
+ :param int limit: Number of results to be returned.
185
+ :param int skip: Number of results to skip.
186
+ :param bool count: Get the total number of results matching the query.
187
+ Deactivated by default.
188
+ :param str study: Study [[organization@]project:]study where study and
189
+ project can be either the ID or UUID.
190
+ :param bool other_studies: Flag indicating the entries being queried
191
+ can belong to any related study, not just the primary one.
192
+ :param str id: Comma separated list of job IDs up to a maximum of 100.
193
+ Also admits basic regular expressions using the operator '~', i.e.
194
+ '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for
195
+ case insensitive search.
196
+ :param str uuid: Comma separated list of job UUIDs up to a maximum of
197
+ 100.
198
+ :param str type: Job type (NATIVE, WORKFLOW, CUSTOM or WALKER).
199
+ :param str tool_id: Tool ID executed by the job. Also admits basic
200
+ regular expressions using the operator '~', i.e. '~{perl-regex}'
201
+ e.g. '~value' for case sensitive, '~/value/i' for case insensitive
202
+ search.
203
+ :param str tool_type: Tool type executed by the job [OPERATION,
204
+ ANALYSIS].
205
+ :param str tool.external_executor.id: Id of the external executor.
206
+ This field is only applicable for jobs executed by an external
207
+ executor.
208
+ :param str parent_id: Job id that generated this job (if any).
209
+ :param bool dry_run: Flag indicating that the job will be executed in
210
+ dry-run mode. In this mode, OpenCGA will validate that all
211
+ parameters and prerequisites are correctly set for successful
212
+ execution, but the job will not actually run.
213
+ :param bool internal.kill_job_requested: Flag indicating that the user
214
+ requested to kill the job.
215
+ :param str user_id: User that created the job.
216
+ :param str priority: Priority of the job.
217
+ :param str status: Filter by status.
218
+ :param str internal_status: Filter by internal status.
219
+ :param str creation_date: Creation date. Format: yyyyMMddHHmmss.
220
+ Examples: >2018, 2017-2018, <201805.
221
+ :param str modification_date: Modification date. Format:
222
+ yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
223
+ :param bool visited: Visited status of job.
224
+ :param str tags: Job tags.
225
+ :param str input: Comma separated list of file IDs used as input.
226
+ :param str output: Comma separated list of file IDs used as output.
227
+ :param str acl: Filter entries for which a user has the provided
228
+ permissions. Format: acl={user}:{permissions}. Example:
229
+ acl=john:WRITE,WRITE_ANNOTATIONS will return all entries for which
230
+ user john has both WRITE and WRITE_ANNOTATIONS permissions. Only
231
+ study owners or administrators can query by this field. .
232
+ :param str release: Release when it was created.
233
+ :param bool deleted: Boolean to retrieve deleted entries.
234
+ """
235
+
236
+ return self._get(category='jobs', resource='search', **options)
237
+
238
+ def build_tool(self, data=None, **options):
239
+ """
240
+ Execute an analysis from a custom binary.
241
+ PATH: /{apiVersion}/jobs/tool/build
242
+
243
+ :param dict data: body. (REQUIRED)
244
+ :param str study: Study [[organization@]project:]study where study and
245
+ project can be either the ID or UUID.
246
+ :param str job_id: Job ID. It must be a unique string within the
247
+ study. An ID will be autogenerated automatically if not provided.
248
+ :param str job_description: Job description.
249
+ :param str job_depends_on: Comma separated list of existing job IDs
250
+ the job will depend on.
251
+ :param str job_tags: Job tags.
252
+ :param str job_scheduled_start_time: Time when the job is scheduled to
253
+ start.
254
+ :param str job_priority: Priority of the job.
255
+ :param bool job_dry_run: Flag indicating that the job will be executed
256
+ in dry-run mode. In this mode, OpenCGA will validate that all
257
+ parameters and prerequisites are correctly set for successful
258
+ execution, but the job will not actually run.
259
+ """
260
+
261
+ return self._post(category='jobs', resource='build', subcategory='tool', data=data, **options)
262
+
263
+ def run_tool(self, data=None, **options):
264
+ """
265
+ Execute an analysis from a custom binary.
266
+ PATH: /{apiVersion}/jobs/tool/run
267
+
268
+ :param dict data: Container image to be executed and its requirements.
269
+ (REQUIRED)
270
+ :param str study: Study [[organization@]project:]study where study and
271
+ project can be either the ID or UUID.
272
+ :param str job_id: Job ID. It must be a unique string within the
273
+ study. An ID will be autogenerated automatically if not provided.
274
+ :param str job_description: Job description.
275
+ :param str job_depends_on: Comma separated list of existing job IDs
276
+ the job will depend on.
277
+ :param str job_tags: Job tags.
278
+ :param str job_scheduled_start_time: Time when the job is scheduled to
279
+ start.
280
+ :param str job_priority: Priority of the job.
281
+ :param bool job_dry_run: Flag indicating that the job will be executed
282
+ in dry-run mode. In this mode, OpenCGA will validate that all
283
+ parameters and prerequisites are correctly set for successful
284
+ execution, but the job will not actually run.
285
+ """
286
+
287
+ return self._post(category='jobs', resource='run', subcategory='tool', data=data, **options)
288
+
289
+ def top(self, **options):
290
+ """
291
+ Provide a summary of the running jobs.
292
+ PATH: /{apiVersion}/jobs/top
293
+
294
+ :param int limit: Maximum number of jobs to be returned.
295
+ :param str study: Study [[organization@]project:]study where study and
296
+ project can be either the ID or UUID.
297
+ :param str internal_status: Filter by internal status.
298
+ :param str priority: Priority of the job.
299
+ :param str user_id: User that created the job.
300
+ :param str tool_id: Tool ID executed by the job. Also admits basic
301
+ regular expressions using the operator '~', i.e. '~{perl-regex}'
302
+ e.g. '~value' for case sensitive, '~/value/i' for case insensitive
303
+ search.
304
+ """
305
+
306
+ return self._get(category='jobs', resource='top', **options)
307
+
308
+ def acl(self, jobs, **options):
309
+ """
310
+ Return the acl of the job. If member is provided, it will only return
311
+ the acl for the member.
312
+ PATH: /{apiVersion}/jobs/{jobs}/acl
313
+
314
+ :param str jobs: Comma separated list of job IDs or UUIDs up to a
315
+ maximum of 100. (REQUIRED)
316
+ :param str member: User or group id.
317
+ :param bool silent: Boolean to retrieve all possible entries that are
318
+ queried for, false to raise an exception whenever one of the
319
+ entries looked for cannot be shown for whichever reason.
320
+ """
321
+
322
+ return self._get(category='jobs', resource='acl', query_id=jobs, **options)
323
+
324
+ def delete(self, jobs, **options):
325
+ """
326
+ Delete existing jobs.
327
+ PATH: /{apiVersion}/jobs/{jobs}/delete
328
+
329
+ :param str jobs: Comma separated list of job ids. (REQUIRED)
330
+ :param str study: Study [[organization@]project:]study where study and
331
+ project can be either the ID or UUID.
332
+ """
333
+
334
+ return self._delete(category='jobs', resource='delete', query_id=jobs, **options)
335
+
336
+ def info(self, jobs, **options):
337
+ """
338
+ Get job information.
339
+ PATH: /{apiVersion}/jobs/{jobs}/info
340
+
341
+ :param str jobs: Comma separated list of job IDs or UUIDs up to a
342
+ maximum of 100. (REQUIRED)
343
+ :param str include: Fields included in the response, whole JSON path
344
+ must be provided.
345
+ :param str exclude: Fields excluded in the response, whole JSON path
346
+ must be provided.
347
+ :param str study: Study [[organization@]project:]study where study and
348
+ project can be either the ID or UUID.
349
+ :param bool deleted: Boolean to retrieve deleted jobs.
350
+ """
351
+
352
+ return self._get(category='jobs', resource='info', query_id=jobs, **options)
353
+
354
+ def update(self, jobs, data=None, **options):
355
+ """
356
+ Update some job attributes.
357
+ PATH: /{apiVersion}/jobs/{jobs}/update
358
+
359
+ :param str jobs: Comma separated list of job IDs or UUIDs up to a
360
+ maximum of 100. (REQUIRED)
361
+ :param str include: Fields included in the response, whole JSON path
362
+ must be provided.
363
+ :param str exclude: Fields excluded in the response, whole JSON path
364
+ must be provided.
365
+ :param str study: Study [[organization@]project:]study where study and
366
+ project can be either the ID or UUID.
367
+ :param bool include_result: Flag indicating to include the created or
368
+ updated document result in the response.
369
+ :param dict data: body.
370
+ """
371
+
372
+ return self._post(category='jobs', resource='update', query_id=jobs, data=data, **options)
373
+
374
+ def kill(self, job, **options):
375
+ """
376
+ Send a signal to kill a pending or running job.
377
+ PATH: /{apiVersion}/jobs/{job}/kill
378
+
379
+ :param str job: Job ID or UUID. (REQUIRED)
380
+ :param str study: Study [[organization@]project:]study where study and
381
+ project can be either the ID or UUID.
382
+ """
383
+
384
+ return self._post(category='jobs', resource='kill', query_id=job, **options)
385
+
386
+ def head_log(self, job, **options):
387
+ """
388
+ Show the first lines of a log file (up to a limit).
389
+ PATH: /{apiVersion}/jobs/{job}/log/head
390
+
391
+ :param str job: Job ID or UUID. (REQUIRED)
392
+ :param str study: Study [[organization@]project:]study where study and
393
+ project can be either the ID or UUID.
394
+ :param int offset: Starting byte from which the file will be read.
395
+ :param int lines: Maximum number of lines to be returned up to a
396
+ maximum of 1000.
397
+ :param str type: Log file to be shown (stdout or stderr).
398
+ """
399
+
400
+ return self._get(category='jobs', resource='head', query_id=job, subcategory='log', **options)
401
+
402
+ def tail_log(self, job, **options):
403
+ """
404
+ Show the last lines of a log file (up to a limit).
405
+ PATH: /{apiVersion}/jobs/{job}/log/tail
406
+
407
+ :param str job: Job ID or UUID. (REQUIRED)
408
+ :param str study: Study [[organization@]project:]study where study and
409
+ project can be either the ID or UUID.
410
+ :param int lines: Maximum number of lines to be returned up to a
411
+ maximum of 1000.
412
+ :param str type: Log file to be shown (stdout or stderr).
413
+ """
414
+
415
+ return self._get(category='jobs', resource='tail', query_id=job, subcategory='log', **options)
416
+
@@ -0,0 +1,85 @@
1
+ """
2
+ WARNING: AUTOGENERATED CODE
3
+
4
+ This code was generated by a tool.
5
+
6
+ Manual changes to this file may cause unexpected behavior in your application.
7
+ Manual changes to this file will be overwritten if the code is regenerated.
8
+ """
9
+
10
+ from pyxetabase.rest_clients._parent_rest_clients import _ParentRestClient
11
+
12
+
13
+ class Meta(_ParentRestClient):
14
+ """
15
+ This class contains methods for the 'Meta' webservices
16
+ PATH: /{apiVersion}/meta
17
+ """
18
+
19
+ def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
20
+ super(Meta, self).__init__(configuration, token, login_handler, *args, **kwargs)
21
+
22
+ def about(self, **options):
23
+ """
24
+ Returns info about current OpenCGA code.
25
+ PATH: /{apiVersion}/meta/about
26
+ """
27
+
28
+ return self._get(category='meta', resource='about', **options)
29
+
30
+ def api(self, **options):
31
+ """
32
+ API.
33
+ PATH: /{apiVersion}/meta/api
34
+
35
+ :param str category: List of categories to get API from.
36
+ """
37
+
38
+ return self._get(category='meta', resource='api', **options)
39
+
40
+ def fail(self, **options):
41
+ """
42
+ Ping Opencga webservices.
43
+ PATH: /{apiVersion}/meta/fail
44
+ """
45
+
46
+ return self._get(category='meta', resource='fail', **options)
47
+
48
+ def model(self, **options):
49
+ """
50
+ Opencga model webservices.
51
+ PATH: /{apiVersion}/meta/model
52
+
53
+ :param str model: Model description.
54
+ """
55
+
56
+ return self._get(category='meta', resource='model', **options)
57
+
58
+ def openapi(self, url, **options):
59
+ """
60
+ Opencga openapi json.
61
+ PATH: /{apiVersion}/meta/openapi
62
+
63
+ :param str url: Opencga host with environment. (REQUIRED)
64
+ :param str study: Opencga study to be default in queries.
65
+ """
66
+
67
+ options['url'] = url
68
+ return self._get(category='meta', resource='openapi', **options)
69
+
70
+ def ping(self, **options):
71
+ """
72
+ Ping Opencga webservices.
73
+ PATH: /{apiVersion}/meta/ping
74
+ """
75
+
76
+ return self._get(category='meta', resource='ping', **options)
77
+
78
+ def status(self, **options):
79
+ """
80
+ Database status.
81
+ PATH: /{apiVersion}/meta/status
82
+ """
83
+
84
+ return self._get(category='meta', resource='status', **options)
85
+