pyopencga 5.0.0.dev0__tar.gz → 6.0.0__tar.gz
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.
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/PKG-INFO +1 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/_parent_rest_clients.py +47 -13
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/admin_client.py +30 -12
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/alignment_client.py +10 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/clinical_analysis_client.py +123 -52
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/cohort_client.py +11 -0
- pyopencga-6.0.0/pyopencga/rest_clients/cvdb_client.py +2404 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/disease_panel_client.py +6 -13
- pyopencga-6.0.0/pyopencga/rest_clients/ehds_client.py +101 -0
- pyopencga-6.0.0/pyopencga/rest_clients/federation_client.py +133 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/file_client.py +33 -14
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/individual_client.py +27 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/job_client.py +55 -28
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/meta_client.py +9 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/study_client.py +148 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/user_client.py +54 -1
- pyopencga-6.0.0/pyopencga/rest_clients/user_tool_client.py +446 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/variant_client.py +686 -13
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/variant_operation_client.py +37 -27
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/workflow_client.py +1 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga.egg-info/PKG-INFO +1 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga.egg-info/SOURCES.txt +4 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/setup.py +1 -1
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/LICENSE +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/README.rst +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/__init__.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/commons.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/exceptions.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/opencga_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/opencga_config.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/__init__.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/family_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/ga4gh_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/organization_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/project_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_clients/sample_client.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/rest_response.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga/retry.py +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga.egg-info/dependency_links.txt +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga.egg-info/requires.txt +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/pyopencga.egg-info/top_level.txt +0 -0
- {pyopencga-5.0.0.dev0 → pyopencga-6.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import os
|
|
2
|
+
import requests
|
|
2
3
|
|
|
3
|
-
from pyopencga.commons import execute
|
|
4
|
+
from pyopencga.commons import execute, _create_rest_url, snake_to_camel_case
|
|
4
5
|
from pyopencga.rest_response import RestResponse
|
|
5
6
|
from pyopencga.retry import retry
|
|
6
7
|
|
|
@@ -87,18 +88,23 @@ class _ParentRestClient(object):
|
|
|
87
88
|
def _post(self, category, resource, data=None, query_id=None, subcategory=None,
|
|
88
89
|
second_query_id=None, **options):
|
|
89
90
|
"""Queries the REST service and returns the result"""
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
data=data, **options
|
|
95
|
-
)
|
|
91
|
+
# Special treatment for the "/{apiVersion}/files/upload" endpoint
|
|
92
|
+
if category == 'files' and resource == 'upload':
|
|
93
|
+
response = self._upload(category=category, resource=resource, **options)
|
|
94
|
+
return RestResponse(response)
|
|
96
95
|
else:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
if data is not None:
|
|
97
|
+
return self._rest_retry(
|
|
98
|
+
method='post', category=category, resource=resource, query_id=query_id,
|
|
99
|
+
subcategory=subcategory, second_query_id=second_query_id,
|
|
100
|
+
data=data, **options
|
|
101
|
+
)
|
|
102
|
+
else:
|
|
103
|
+
return self._rest_retry(
|
|
104
|
+
method='post', category=category, resource=resource, query_id=query_id,
|
|
105
|
+
subcategory=subcategory, second_query_id=second_query_id,
|
|
106
|
+
**options
|
|
107
|
+
)
|
|
102
108
|
|
|
103
109
|
def _delete(self, category, resource, query_id=None, subcategory=None,
|
|
104
110
|
second_query_id=None, **options):
|
|
@@ -108,3 +114,31 @@ class _ParentRestClient(object):
|
|
|
108
114
|
subcategory=subcategory, second_query_id=second_query_id,
|
|
109
115
|
**options
|
|
110
116
|
)
|
|
117
|
+
|
|
118
|
+
def _upload(self, category, resource, **options):
|
|
119
|
+
"""Upload files"""
|
|
120
|
+
|
|
121
|
+
# Checking that the parameter file contains the file path to upload
|
|
122
|
+
if 'file' not in options or not isinstance(options['file'], str):
|
|
123
|
+
raise ValueError('To upload a file, please specify the file path as the "file" parameter.')
|
|
124
|
+
|
|
125
|
+
# Creating URL and headers
|
|
126
|
+
url, header = _create_rest_url(host=self._cfg.host, version=self._cfg.version, sid=self.token,
|
|
127
|
+
category=category, resource=resource, options=options)
|
|
128
|
+
|
|
129
|
+
# Creating data
|
|
130
|
+
data = {}
|
|
131
|
+
for k, v in options.items():
|
|
132
|
+
if k == 'file': # Param "file" is not included in data
|
|
133
|
+
continue
|
|
134
|
+
data[snake_to_camel_case(k)] = v
|
|
135
|
+
|
|
136
|
+
# Uploading
|
|
137
|
+
fpath = os.path.realpath(os.path.expanduser(options['file']))
|
|
138
|
+
with open(fpath, "rb") as f:
|
|
139
|
+
fhand = {"file": (fpath, f, "application/octet-stream")}
|
|
140
|
+
response = requests.post(url, headers=header, files=fhand, data=data or None)
|
|
141
|
+
if response.status_code != 200:
|
|
142
|
+
raise Exception(response.content)
|
|
143
|
+
|
|
144
|
+
return response.json()
|
|
@@ -27,8 +27,8 @@ class Admin(_ParentRestClient):
|
|
|
27
27
|
:param str entity: Entity to be grouped by. Allowed values: ['AUDIT
|
|
28
28
|
NOTE ORGANIZATION USER PROJECT STUDY FILE SAMPLE JOB INDIVIDUAL
|
|
29
29
|
COHORT DISEASE_PANEL FAMILY CLINICAL_ANALYSIS INTERPRETATION
|
|
30
|
-
VARIANT ALIGNMENT CLINICAL EXPRESSION RGA FUNCTIONAL
|
|
31
|
-
RESOURCE'] (REQUIRED)
|
|
30
|
+
VARIANT ALIGNMENT CLINICAL EXPRESSION RGA FUNCTIONAL EHDS
|
|
31
|
+
EXTERNAL_TOOL BATCH RESOURCE'] (REQUIRED)
|
|
32
32
|
:param str fields: Comma separated list of fields by which to group
|
|
33
33
|
by. (REQUIRED)
|
|
34
34
|
:param bool count: Count the number of elements matching the group.
|
|
@@ -54,24 +54,31 @@ class Admin(_ParentRestClient):
|
|
|
54
54
|
|
|
55
55
|
return self._post(category='admin', resource='install', subcategory='catalog', data=data, **options)
|
|
56
56
|
|
|
57
|
-
def
|
|
57
|
+
def update_catalog_workspace(self, data=None, **options):
|
|
58
58
|
"""
|
|
59
|
-
|
|
60
|
-
PATH: /{apiVersion}/admin/catalog/
|
|
59
|
+
Update the OpenCGA Catalog workspace.
|
|
60
|
+
PATH: /{apiVersion}/admin/catalog/workspace/update
|
|
61
61
|
|
|
62
|
-
:param dict data: JSON containing the parameters. (REQUIRED)
|
|
63
|
-
|
|
62
|
+
:param dict data: JSON containing the workspace parameters. (REQUIRED)
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
return self._post(category='admin', resource='update', subcategory='catalog/workspace', data=data, **options)
|
|
66
|
+
|
|
67
|
+
def list_organizations(self, **options):
|
|
68
|
+
"""
|
|
69
|
+
List current Organizations.
|
|
70
|
+
PATH: /{apiVersion}/admin/organizations/list
|
|
64
71
|
"""
|
|
65
72
|
|
|
66
|
-
return self.
|
|
73
|
+
return self._get(category='admin', resource='list', subcategory='organizations', **options)
|
|
67
74
|
|
|
68
|
-
def
|
|
75
|
+
def fetch_resources(self, data=None, **options):
|
|
69
76
|
"""
|
|
70
77
|
Fetch resources from the public server and save them into the OpenCGA
|
|
71
78
|
local installation.
|
|
72
|
-
PATH: /{apiVersion}/admin/
|
|
79
|
+
PATH: /{apiVersion}/admin/resources/fetch
|
|
73
80
|
|
|
74
|
-
:param dict data:
|
|
81
|
+
:param dict data: Fetch-resources tool parameters. (REQUIRED)
|
|
75
82
|
:param str job_id: Job ID. It must be a unique string within the
|
|
76
83
|
study. An ID will be autogenerated automatically if not provided.
|
|
77
84
|
:param str job_description: Job description.
|
|
@@ -87,7 +94,18 @@ class Admin(_ParentRestClient):
|
|
|
87
94
|
execution, but the job will not actually run.
|
|
88
95
|
"""
|
|
89
96
|
|
|
90
|
-
return self._post(category='admin', resource='fetch', subcategory='
|
|
97
|
+
return self._post(category='admin', resource='fetch', subcategory='resources', data=data, **options)
|
|
98
|
+
|
|
99
|
+
def tree_resources(self, **options):
|
|
100
|
+
"""
|
|
101
|
+
Obtain a tree view of the on-disk installation resources folder.
|
|
102
|
+
PATH: /{apiVersion}/admin/resources/tree
|
|
103
|
+
|
|
104
|
+
:param int max_depth: Maximum depth to descend into the resources
|
|
105
|
+
folder, capped at 10.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
return self._get(category='admin', resource='tree', subcategory='resources', **options)
|
|
91
109
|
|
|
92
110
|
def create_users(self, data=None, **options):
|
|
93
111
|
"""
|
|
@@ -154,16 +154,25 @@ class Alignment(_ParentRestClient):
|
|
|
154
154
|
|
|
155
155
|
def stats_coverage(self, file, gene, **options):
|
|
156
156
|
"""
|
|
157
|
-
Compute coverage stats per transcript for a list of genes.
|
|
157
|
+
Compute coverage stats per transcript for a list of genes. Only the
|
|
158
|
+
MANE and canonical transcripts of each gene are reported, or all of
|
|
159
|
+
them when the gene has none. Coverage is measured over the coding
|
|
160
|
+
part of each exon plus a flank, or over whole exons plus the flank
|
|
161
|
+
for a non-coding transcript.
|
|
158
162
|
PATH: /{apiVersion}/analysis/alignment/coverage/stats
|
|
159
163
|
|
|
160
164
|
:param str gene: Comma separated list of genes, e.g.: BCRA2,TP53.
|
|
161
165
|
(REQUIRED)
|
|
162
166
|
:param str file: File ID. (REQUIRED)
|
|
167
|
+
:param str coverage_file: Coverage file (BIGWIG) to read the depths
|
|
168
|
+
from. By default, the coverage file registered for the alignment
|
|
169
|
+
file, or the alignment file itself when it has none.
|
|
163
170
|
:param str study: Study [[organization@]project:]study where study and
|
|
164
171
|
project can be either the ID or UUID.
|
|
165
172
|
:param int threshold: Only regions whose coverage depth is under this
|
|
166
173
|
threshold will be reported.
|
|
174
|
+
:param int flank: Bases added either side of each measured exon, e.g.
|
|
175
|
+
to cover the splice sites.
|
|
167
176
|
"""
|
|
168
177
|
|
|
169
178
|
options['file'] = file
|
|
@@ -211,6 +211,19 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
211
211
|
options['field'] = field
|
|
212
212
|
return self._get(category='analysis', resource='distinct', subcategory='clinical', **options)
|
|
213
213
|
|
|
214
|
+
def import_emedgene(self, data=None, **options):
|
|
215
|
+
"""
|
|
216
|
+
Import a clinical analysis from an Emedgene HL7 v2 JSON file.
|
|
217
|
+
PATH: /{apiVersion}/analysis/clinical/emedgene/import
|
|
218
|
+
|
|
219
|
+
:param dict data: Parameters to import a clinical analysis from an
|
|
220
|
+
Emedgene HL7 v2 JSON file. (REQUIRED)
|
|
221
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
222
|
+
project can be either the ID or UUID.
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
return self._post(category='analysis', resource='import', subcategory='clinical/emedgene', data=data, **options)
|
|
226
|
+
|
|
214
227
|
def aggregation_stats_interpretation(self, **options):
|
|
215
228
|
"""
|
|
216
229
|
Fetch catalog interpretation aggregation stats.
|
|
@@ -281,12 +294,38 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
281
294
|
Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
|
|
282
295
|
:param str status: Filter by status.
|
|
283
296
|
:param str internal_status: Filter by internal status.
|
|
297
|
+
:param str internal_annotation_review_status: Filter by internal
|
|
298
|
+
annotation review status.
|
|
299
|
+
:param str internal_annotation_external_status: Filter by internal
|
|
300
|
+
annotation external phenopacket review status.
|
|
284
301
|
:param str release: Release when it was created.
|
|
285
302
|
"""
|
|
286
303
|
|
|
287
304
|
options['field'] = field
|
|
288
305
|
return self._get(category='analysis', resource='distinct', subcategory='clinical/interpretation', **options)
|
|
289
306
|
|
|
307
|
+
def report_interpretation(self, **options):
|
|
308
|
+
"""
|
|
309
|
+
Generate a tabular report (one row per ClinicalAnalysis) with reported
|
|
310
|
+
variants grouped by tier. Provide either a 'batchId' or a list of
|
|
311
|
+
'clinicalAnalysisId'.
|
|
312
|
+
PATH: /{apiVersion}/analysis/clinical/interpretation/report
|
|
313
|
+
|
|
314
|
+
:param str study: [[organization@]project:]study id.
|
|
315
|
+
:param str batch_id: Batch ID. The batch's samples are resolved to
|
|
316
|
+
proband case IDs.
|
|
317
|
+
:param str clinical_analysis_id: Comma-separated list of
|
|
318
|
+
ClinicalAnalysis IDs (maximum 100).
|
|
319
|
+
:param str format: Output format: TSV (default) or JSON. Allowed
|
|
320
|
+
values: ['TSV', 'JSON']
|
|
321
|
+
:param str additional_columns: Optional comma-separated list of
|
|
322
|
+
ClinicalAnalysis data-model paths to add as extra columns, each
|
|
323
|
+
optionally suffixed with ':alias' for the header. Example:
|
|
324
|
+
proband.samples[0].attributes.OPENCGA_CARRIER_AFFY_SMN_STATUS:SMN.
|
|
325
|
+
"""
|
|
326
|
+
|
|
327
|
+
return self._get(category='analysis', resource='report', subcategory='clinical/interpretation', **options)
|
|
328
|
+
|
|
290
329
|
def search_interpretation(self, **options):
|
|
291
330
|
"""
|
|
292
331
|
Search clinical interpretations.
|
|
@@ -324,6 +363,10 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
324
363
|
Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
|
|
325
364
|
:param str status: Filter by status.
|
|
326
365
|
:param str internal_status: Filter by internal status.
|
|
366
|
+
:param str internal_annotation_review_status: Filter by internal
|
|
367
|
+
annotation review status.
|
|
368
|
+
:param str internal_annotation_external_status: Filter by internal
|
|
369
|
+
annotation external phenopacket review status.
|
|
327
370
|
:param str release: Release when it was created.
|
|
328
371
|
"""
|
|
329
372
|
|
|
@@ -350,13 +393,12 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
350
393
|
|
|
351
394
|
return self._get(category='analysis', resource='info', subcategory='clinical/interpretation', second_query_id=interpretations, **options)
|
|
352
395
|
|
|
353
|
-
def
|
|
396
|
+
def run_interpreter_exomiser(self, data=None, **options):
|
|
354
397
|
"""
|
|
355
|
-
Run
|
|
356
|
-
PATH: /{apiVersion}/analysis/clinical/interpreter/
|
|
398
|
+
Run exomiser interpretation analysis.
|
|
399
|
+
PATH: /{apiVersion}/analysis/clinical/interpreter/exomiser/run
|
|
357
400
|
|
|
358
|
-
:param dict data:
|
|
359
|
-
(REQUIRED)
|
|
401
|
+
:param dict data: Exomiser interpretation analysis params. (REQUIRED)
|
|
360
402
|
:param str study: Study [[organization@]project:]study where study and
|
|
361
403
|
project can be either the ID or UUID.
|
|
362
404
|
:param str job_id: Job ID. It must be a unique string within the
|
|
@@ -374,39 +416,33 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
374
416
|
execution, but the job will not actually run.
|
|
375
417
|
"""
|
|
376
418
|
|
|
377
|
-
return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/
|
|
419
|
+
return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/exomiser', data=data, **options)
|
|
378
420
|
|
|
379
|
-
def
|
|
421
|
+
def rd_interpreter(self, **options):
|
|
380
422
|
"""
|
|
381
|
-
|
|
382
|
-
PATH: /{apiVersion}/analysis/clinical/interpreter/
|
|
423
|
+
Rare disease interpretation analysis.
|
|
424
|
+
PATH: /{apiVersion}/analysis/clinical/interpreter/rd
|
|
383
425
|
|
|
384
|
-
:param
|
|
426
|
+
:param str clinical_analysis_id: Clinical analysis ID.
|
|
427
|
+
:param str proband_id: Proband ID.
|
|
428
|
+
:param str family_id: Family ID.
|
|
429
|
+
:param str panel_ids: List of panel IDs (separated by commas).
|
|
430
|
+
:param str disorder_id: Disorder ID.
|
|
431
|
+
:param str config_file: RD interpretation configuration file
|
|
432
|
+
(otherwise the default one will be used).
|
|
385
433
|
:param str study: Study [[organization@]project:]study where study and
|
|
386
434
|
project can be either the ID or UUID.
|
|
387
|
-
:param str job_id: Job ID. It must be a unique string within the
|
|
388
|
-
study. An ID will be autogenerated automatically if not provided.
|
|
389
|
-
:param str job_description: Job description.
|
|
390
|
-
:param str job_depends_on: Comma separated list of existing job IDs
|
|
391
|
-
the job will depend on.
|
|
392
|
-
:param str job_tags: Job tags.
|
|
393
|
-
:param str job_scheduled_start_time: Time when the job is scheduled to
|
|
394
|
-
start.
|
|
395
|
-
:param str job_priority: Priority of the job.
|
|
396
|
-
:param bool job_dry_run: Flag indicating that the job will be executed
|
|
397
|
-
in dry-run mode. In this mode, OpenCGA will validate that all
|
|
398
|
-
parameters and prerequisites are correctly set for successful
|
|
399
|
-
execution, but the job will not actually run.
|
|
400
435
|
"""
|
|
401
436
|
|
|
402
|
-
return self.
|
|
437
|
+
return self._get(category='analysis', resource='rd', subcategory='clinical/interpreter', **options)
|
|
403
438
|
|
|
404
|
-
def
|
|
439
|
+
def run_interpreter_rd(self, data=None, **options):
|
|
405
440
|
"""
|
|
406
|
-
Run
|
|
407
|
-
PATH: /{apiVersion}/analysis/clinical/interpreter/
|
|
441
|
+
Run interpretation analysis for rare diseases.
|
|
442
|
+
PATH: /{apiVersion}/analysis/clinical/interpreter/rd/run
|
|
408
443
|
|
|
409
|
-
:param dict data:
|
|
444
|
+
:param dict data: Parameters to execute the rare disease
|
|
445
|
+
interpretation analysis. (REQUIRED)
|
|
410
446
|
:param str study: Study [[organization@]project:]study where study and
|
|
411
447
|
project can be either the ID or UUID.
|
|
412
448
|
:param str job_id: Job ID. It must be a unique string within the
|
|
@@ -424,14 +460,15 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
424
460
|
execution, but the job will not actually run.
|
|
425
461
|
"""
|
|
426
462
|
|
|
427
|
-
return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/
|
|
463
|
+
return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/rd', data=data, **options)
|
|
428
464
|
|
|
429
|
-
def
|
|
465
|
+
def load(self, data=None, **options):
|
|
430
466
|
"""
|
|
431
|
-
|
|
432
|
-
PATH: /{apiVersion}/analysis/clinical/
|
|
467
|
+
Load clinical analyses from a file.
|
|
468
|
+
PATH: /{apiVersion}/analysis/clinical/load
|
|
433
469
|
|
|
434
|
-
:param dict data:
|
|
470
|
+
:param dict data: Parameters to load clinical analysis in OpenCGA
|
|
471
|
+
catalog from a file. (REQUIRED)
|
|
435
472
|
:param str study: Study [[organization@]project:]study where study and
|
|
436
473
|
project can be either the ID or UUID.
|
|
437
474
|
:param str job_id: Job ID. It must be a unique string within the
|
|
@@ -449,14 +486,16 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
449
486
|
execution, but the job will not actually run.
|
|
450
487
|
"""
|
|
451
488
|
|
|
452
|
-
return self._post(category='analysis', resource='
|
|
489
|
+
return self._post(category='analysis', resource='load', subcategory='clinical', data=data, **options)
|
|
453
490
|
|
|
454
|
-
def
|
|
491
|
+
def run_pharmacogenomics_ngs(self, data=None, **options):
|
|
455
492
|
"""
|
|
456
|
-
|
|
457
|
-
|
|
493
|
+
NGS pharmacogenomics analysis: run PharmCAT on a VCF and optionally
|
|
494
|
+
annotate with CPIC. Produces one result per sample.
|
|
495
|
+
PATH: /{apiVersion}/analysis/clinical/pharmacogenomics/ngs/run
|
|
458
496
|
|
|
459
|
-
:param dict data:
|
|
497
|
+
:param dict data: NGS pharmacogenomics analysis params (PharmCAT from
|
|
498
|
+
a VCF). (REQUIRED)
|
|
460
499
|
:param str study: Study [[organization@]project:]study where study and
|
|
461
500
|
project can be either the ID or UUID.
|
|
462
501
|
:param str job_id: Job ID. It must be a unique string within the
|
|
@@ -474,15 +513,17 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
474
513
|
execution, but the job will not actually run.
|
|
475
514
|
"""
|
|
476
515
|
|
|
477
|
-
return self._post(category='analysis', resource='run', subcategory='clinical/
|
|
516
|
+
return self._post(category='analysis', resource='run', subcategory='clinical/pharmacogenomics/ngs', data=data, **options)
|
|
478
517
|
|
|
479
|
-
def
|
|
518
|
+
def run_pharmacogenomics_openarray(self, data=None, **options):
|
|
480
519
|
"""
|
|
481
|
-
|
|
482
|
-
|
|
520
|
+
OpenArray pharmacogenomics analysis: infer star alleles from
|
|
521
|
+
ThermoFisher OpenArray genotyping data and optionally annotate with
|
|
522
|
+
CPIC.
|
|
523
|
+
PATH: /{apiVersion}/analysis/clinical/pharmacogenomics/openarray/run
|
|
483
524
|
|
|
484
|
-
:param dict data:
|
|
485
|
-
|
|
525
|
+
:param dict data: OpenArray pharmacogenomics analysis params.
|
|
526
|
+
(REQUIRED)
|
|
486
527
|
:param str study: Study [[organization@]project:]study where study and
|
|
487
528
|
project can be either the ID or UUID.
|
|
488
529
|
:param str job_id: Job ID. It must be a unique string within the
|
|
@@ -500,7 +541,7 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
500
541
|
execution, but the job will not actually run.
|
|
501
542
|
"""
|
|
502
543
|
|
|
503
|
-
return self._post(category='analysis', resource='
|
|
544
|
+
return self._post(category='analysis', resource='run', subcategory='clinical/pharmacogenomics/openarray', data=data, **options)
|
|
504
545
|
|
|
505
546
|
def aggregation_stats_rga(self, field, **options):
|
|
506
547
|
"""
|
|
@@ -861,6 +902,20 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
861
902
|
|
|
862
903
|
return self._get(category='analysis', resource='search', subcategory='clinical', **options)
|
|
863
904
|
|
|
905
|
+
def import_sophia_genetics(self, data=None, **options):
|
|
906
|
+
"""
|
|
907
|
+
Import a clinical analysis from a Sophia Genetics clinical report JSON
|
|
908
|
+
file.
|
|
909
|
+
PATH: /{apiVersion}/analysis/clinical/sophiaGenetics/import
|
|
910
|
+
|
|
911
|
+
:param dict data: Parameters to import a clinical analysis from a
|
|
912
|
+
Sophia Genetics clinical report JSON file. (REQUIRED)
|
|
913
|
+
:param str study: Study [[organization@]project:]study where study and
|
|
914
|
+
project can be either the ID or UUID.
|
|
915
|
+
"""
|
|
916
|
+
|
|
917
|
+
return self._post(category='analysis', resource='import', subcategory='clinical/sophiaGenetics', data=data, **options)
|
|
918
|
+
|
|
864
919
|
def query_variant(self, **options):
|
|
865
920
|
"""
|
|
866
921
|
Fetch clinical variants.
|
|
@@ -998,9 +1053,21 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
998
1053
|
:param str functional_score: Functional score:
|
|
999
1054
|
{functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 ,
|
|
1000
1055
|
cadd_raw<=0.3.
|
|
1001
|
-
:param str clinical: Clinical source
|
|
1056
|
+
:param str clinical: Clinical source filter (e.g. clinvar, cosmic,
|
|
1057
|
+
acmg). Forms: bare source ('clinvar' = any significance);
|
|
1058
|
+
per-source significance ('clinvar:pathogenic'); a significance set
|
|
1059
|
+
joined with ',' (OR) or ';' (AND, for conflicting interpretations),
|
|
1060
|
+
e.g. 'clinvar:pathogenic,likely_pathogenic'; 'source:any' (present,
|
|
1061
|
+
synonym of bare source and 'source:') and 'source:none' (absent,
|
|
1062
|
+
equivalent to '!source'); negation '!source' /
|
|
1063
|
+
'!source:significance'. Sources are combined with ',' (OR) or ';'
|
|
1064
|
+
(AND). Excluded sources must be combined with ';' (e.g.
|
|
1065
|
+
'!clinvar;!cosmic') — ',' between excluded sources is rejected. The
|
|
1066
|
+
merged 'source:significance' form cannot be combined with the
|
|
1067
|
+
'clinicalSignificance' parameter.
|
|
1002
1068
|
:param str clinical_significance: Clinical significance: benign,
|
|
1003
|
-
likely_benign, likely_pathogenic,
|
|
1069
|
+
likely_benign, uncertain_significance, likely_pathogenic,
|
|
1070
|
+
pathogenic.
|
|
1004
1071
|
:param bool clinical_confirmed_status: Clinical confirmed status.
|
|
1005
1072
|
:param str custom_annotation: Custom annotation:
|
|
1006
1073
|
{key}[<|>|<=|>=]{number} or {key}[~=|=]{text}.
|
|
@@ -1092,6 +1159,9 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
1092
1159
|
analysts is being updated. Allowed values: ['ADD SET REMOVE']
|
|
1093
1160
|
:param str files_action: Action to be performed if the array of files
|
|
1094
1161
|
is being updated. Allowed values: ['ADD SET REMOVE']
|
|
1162
|
+
:param str reported_files_action: Action to be performed if the array
|
|
1163
|
+
of reported files is being updated. Allowed values: ['ADD SET
|
|
1164
|
+
REMOVE']
|
|
1095
1165
|
:param str panels_action: Action to be performed if the array of
|
|
1096
1166
|
panels is being updated. Allowed values: ['ADD SET REMOVE']
|
|
1097
1167
|
:param str annotation_sets_action: Action to be performed if the array
|
|
@@ -1266,11 +1336,12 @@ class ClinicalAnalysis(_ParentRestClient):
|
|
|
1266
1336
|
project can be either the ID or UUID.
|
|
1267
1337
|
:param str comments_action: Action to be performed if the array of
|
|
1268
1338
|
comments is being updated. Allowed values: ['ADD REMOVE REPLACE']
|
|
1269
|
-
:param str
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1339
|
+
:param str signatures_action: Action to be performed if the array of
|
|
1340
|
+
signatures is being updated. Allowed values: ['ADD REMOVE REPLACE']
|
|
1341
|
+
:param str references_action: Action to be performed if the array of
|
|
1342
|
+
references is being updated. Allowed values: ['ADD SET REMOVE']
|
|
1343
|
+
:param str images_action: Action to be performed if the array of
|
|
1344
|
+
images is being updated. Allowed values: ['ADD SET REMOVE']
|
|
1274
1345
|
:param bool include_result: Flag indicating to include the created or
|
|
1275
1346
|
updated document result in the response.
|
|
1276
1347
|
"""
|
|
@@ -61,6 +61,9 @@ class Cohort(_ParentRestClient):
|
|
|
61
61
|
:param str status: status.
|
|
62
62
|
:param str internal_status: internalStatus.
|
|
63
63
|
:param str annotation: Cohort annotation.
|
|
64
|
+
:param str tags: Tags. Also admits basic regular expressions using the
|
|
65
|
+
operator '~', i.e. '~{perl-regex}' e.g. '~value' for case
|
|
66
|
+
sensitive, '~/value/i' for case insensitive search.
|
|
64
67
|
:param str acl: acl.
|
|
65
68
|
:param str samples: Cohort sample IDs.
|
|
66
69
|
:param str num_samples: Number of samples.
|
|
@@ -137,6 +140,9 @@ class Cohort(_ParentRestClient):
|
|
|
137
140
|
:param str uuid: Comma separated list of cohort IDs up to a maximum of
|
|
138
141
|
100.
|
|
139
142
|
:param str type: Cohort type.
|
|
143
|
+
:param str tags: Tags. Also admits basic regular expressions using the
|
|
144
|
+
operator '~', i.e. '~{perl-regex}' e.g. '~value' for case
|
|
145
|
+
sensitive, '~/value/i' for case insensitive search.
|
|
140
146
|
:param str creation_date: creationDate.
|
|
141
147
|
:param str modification_date: modificationDate.
|
|
142
148
|
:param bool deleted: deleted.
|
|
@@ -223,6 +229,9 @@ class Cohort(_ParentRestClient):
|
|
|
223
229
|
:param str uuid: Comma separated list of cohort IDs up to a maximum of
|
|
224
230
|
100.
|
|
225
231
|
:param str type: Cohort type.
|
|
232
|
+
:param str tags: Tags. Also admits basic regular expressions using the
|
|
233
|
+
operator '~', i.e. '~{perl-regex}' e.g. '~value' for case
|
|
234
|
+
sensitive, '~/value/i' for case insensitive search.
|
|
226
235
|
:param str creation_date: creationDate.
|
|
227
236
|
:param str modification_date: modificationDate.
|
|
228
237
|
:param bool deleted: deleted.
|
|
@@ -303,6 +312,8 @@ class Cohort(_ParentRestClient):
|
|
|
303
312
|
:param str annotation_sets_action: Action to be performed if the array
|
|
304
313
|
of annotationSets is being updated. Allowed values: ['ADD SET
|
|
305
314
|
REMOVE']
|
|
315
|
+
:param str tags_action: Action to be performed if the array of tags is
|
|
316
|
+
being updated. Allowed values: ['ADD SET REMOVE']
|
|
306
317
|
:param bool include_result: Flag indicating to include the created or
|
|
307
318
|
updated document result in the response.
|
|
308
319
|
:param dict data: body.
|