Skip to content

Commit 11bf466

Browse files
authored
Merge pull request #1050 from opencb/TASK-7983
TASK-7983 - Fix the clinical interpretation analysis tool
2 parents 08efcc0 + dbe0e7c commit 11bf466

File tree

13 files changed

+231
-304
lines changed

13 files changed

+231
-304
lines changed

src/core/clients/opencga/api/Admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default class Admin extends OpenCGAParentClass {
134134
return this._get("admin", null, "users", null, "search", params);
135135
}
136136

137-
/** Synchronise a group of users from an authentication origin with a group in a study from catalog
137+
/** [DEPRECATED] Moved to /users/sync
138138
* @param {Object} data - JSON containing the parameters.
139139
* @param {Object} [params] - The Object containing the following optional parameters:
140140
* @param {String} [params.organization] - Organization id.

src/core/clients/opencga/api/ClinicalAnalysis.js

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -273,25 +273,6 @@ export default class ClinicalAnalysis extends OpenCGAParentClass {
273273
return this._get("analysis", null, "clinical/interpretation", interpretations, "info", params);
274274
}
275275

276-
/** Run cancer tiering interpretation analysis
277-
* @param {Object} data - Cancer tiering interpretation analysis params.
278-
* @param {Object} [params] - The Object containing the following optional parameters:
279-
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
280-
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
281-
* provided.
282-
* @param {String} [params.jobDescription] - Job description.
283-
* @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on.
284-
* @param {String} [params.jobTags] - Job tags.
285-
* @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start.
286-
* @param {String} [params.jobPriority] - Priority of the job.
287-
* @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will
288-
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
289-
* @returns {Promise} Promise object in the form of RestResponse instance.
290-
*/
291-
runInterpreterCancerTiering(data, params) {
292-
return this._post("analysis", null, "clinical/interpreter/cancerTiering", null, "run", data, params);
293-
}
294-
295276
/** Run exomiser interpretation analysis
296277
* @param {Object} data - Exomiser interpretation analysis params.
297278
* @param {Object} [params] - The Object containing the following optional parameters:
@@ -311,46 +292,8 @@ export default class ClinicalAnalysis extends OpenCGAParentClass {
311292
return this._post("analysis", null, "clinical/interpreter/exomiser", null, "run", data, params);
312293
}
313294

314-
/** Run TEAM interpretation analysis
315-
* @param {Object} data - TEAM interpretation analysis params.
316-
* @param {Object} [params] - The Object containing the following optional parameters:
317-
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
318-
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
319-
* provided.
320-
* @param {String} [params.jobDescription] - Job description.
321-
* @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on.
322-
* @param {String} [params.jobTags] - Job tags.
323-
* @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start.
324-
* @param {String} [params.jobPriority] - Priority of the job.
325-
* @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will
326-
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
327-
* @returns {Promise} Promise object in the form of RestResponse instance.
328-
*/
329-
runInterpreterTeam(data, params) {
330-
return this._post("analysis", null, "clinical/interpreter/team", null, "run", data, params);
331-
}
332-
333-
/** Run tiering interpretation analysis
334-
* @param {Object} data - Tiering interpretation analysis params.
335-
* @param {Object} [params] - The Object containing the following optional parameters:
336-
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
337-
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
338-
* provided.
339-
* @param {String} [params.jobDescription] - Job description.
340-
* @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on.
341-
* @param {String} [params.jobTags] - Job tags.
342-
* @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start.
343-
* @param {String} [params.jobPriority] - Priority of the job.
344-
* @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will
345-
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
346-
* @returns {Promise} Promise object in the form of RestResponse instance.
347-
*/
348-
runInterpreterTiering(data, params) {
349-
return this._post("analysis", null, "clinical/interpreter/tiering", null, "run", data, params);
350-
}
351-
352-
/** Run Zetta interpretation analysis
353-
* @param {Object} data - Zetta interpretation analysis params.
295+
/** Run clinical interpretation analysis for rare diseases
296+
* @param {Object} data - Parameters to execute the rare disease interpretation analysis.
354297
* @param {Object} [params] - The Object containing the following optional parameters:
355298
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
356299
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
@@ -364,8 +307,8 @@ export default class ClinicalAnalysis extends OpenCGAParentClass {
364307
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
365308
* @returns {Promise} Promise object in the form of RestResponse instance.
366309
*/
367-
runInterpreterZetta(data, params) {
368-
return this._post("analysis", null, "clinical/interpreter/zetta", null, "run", data, params);
310+
runInterpreterRd(data, params) {
311+
return this._post("analysis", null, "clinical/interpreter/rd", null, "run", data, params);
369312
}
370313

371314
/** Load clinical analyses from a file

src/core/clients/opencga/api/DiseasePanel.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,6 @@ export default class DiseasePanel extends OpenCGAParentClass {
145145
* @param {Object} [data] - Panel parameters.
146146
* @param {Object} [params] - The Object containing the following optional parameters:
147147
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.
148-
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
149-
* provided.
150-
* @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on.
151-
* @param {String} [params.jobDescription] - Job description.
152-
* @param {String} [params.jobTags] - Job tags.
153-
* @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start.
154-
* @param {String} [params.jobPriority] - Priority of the job.
155-
* @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will
156-
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
157148
* @returns {Promise} Promise object in the form of RestResponse instance.
158149
*/
159150
importPanels(data, params) {

src/core/clients/opencga/api/File.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ export default class File extends OpenCGAParentClass {
305305
* JSON AVRO PARQUET PDF IMAGE PLAIN BINARY NONE UNKNOWN"} [params.fileFormat] - [DEPRECATED] File format.
306306
* @param {"MICROARRAY_EXPRESSION_ONECHANNEL_AGILENT MICROARRAY_EXPRESSION_ONECHANNEL_AFFYMETRIX MICROARRAY_EXPRESSION_ONECHANNEL_GENEPIX
307307
* MICROARRAY_EXPRESSION_TWOCHANNELS_AGILENT MICROARRAY_EXPRESSION_TWOCHANNELS_GENEPIX DATAMATRIX_EXPRESSION IDLIST IDLIST_RANKED
308-
* ANNOTATION_GENEVSANNOTATION OTHER_NEWICK OTHER_BLAST OTHER_INTERACTION OTHER_GENOTYPE OTHER_PLINK OTHER_VCF OTHER_PED VCF4 VARIANT
309-
* ALIGNMENT COVERAGE SEQUENCE PEDIGREE REFERENCE_GENOME NONE UNKNOWN"} [params.bioformat] - File bioformat.
308+
* ANNOTATION_GENEVSANNOTATION OTHER_NEWICK OTHER_BLAST OTHER_INTERACTION OTHER_GENOTYPE OTHER_PLINK OTHER_VCF OTHER_PED VCF4 CVDB
309+
* VARIANT ALIGNMENT COVERAGE SEQUENCE PEDIGREE REFERENCE_GENOME NONE UNKNOWN"} [params.bioformat] - File bioformat.
310310
* @param {String} [params.checksum] - Expected MD5 file checksum.
311311
* @param {Boolean} [params.resource] - Boolean field indicating whether the file is a resource or not.
312312
* @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID.

src/core/clients/opencga/api/Meta.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ export default class Meta extends OpenCGAParentClass {
6969
}
7070

7171
/** Opencga openapi json
72+
* @param {String} url - Opencga host with environment.
7273
* @param {Object} [params] - The Object containing the following optional parameters:
73-
* @param {String} [params.token] - List of categories to get API from.
74+
* @param {String} [params.study] - Opencga study to be default in queries.
7475
* @returns {Promise} Promise object in the form of RestResponse instance.
7576
*/
76-
openapi(params) {
77-
return this._get("meta", null, null, null, "openapi", params);
77+
openapi(url, params) {
78+
return this._get("meta", null, null, null, "openapi", {url, ...params});
7879
}
7980

8081
/** Ping Opencga webservices.

src/core/clients/opencga/api/Study.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ export default class Study extends OpenCGAParentClass {
142142
return this._get("studies", study, null, null, "groups", params);
143143
}
144144

145+
/** Associate a remote group from an authentication origin with a local group in a study
146+
* @param {String} study - Study [[organization@]project:]study where study and project can be either the ID or UUID.
147+
* @param {Object} data - JSON containing the parameters.
148+
* @returns {Promise} Promise object in the form of RestResponse instance.
149+
*/
150+
syncGroups(study, data) {
151+
return this._post("studies", study, "groups", null, "sync", data);
152+
}
153+
145154
/** Add or remove a group
146155
* @param {String} study - Study [[organization@]project:]study where study and project can be either the ID or UUID.
147156
* @param {Object} data - JSON containing the parameters.
@@ -308,6 +317,15 @@ export default class Study extends OpenCGAParentClass {
308317
return this._post("studies", study, null, null, "update", data, params);
309318
}
310319

320+
/** Synchronize all users from the remote groups of a given authentication origin
321+
* @param {String} study - Study [[organization@]project:]study where study and project can be either the ID or UUID.
322+
* @param {String} authenticationOriginId - Authentication origin ID.
323+
* @returns {Promise} Promise object in the form of RestResponse instance.
324+
*/
325+
syncUsers(study, authenticationOriginId) {
326+
return this._post("studies", study, "users", null, "sync", null, authenticationOriginId);
327+
}
328+
311329
/** Fetch variableSets from a study
312330
* @param {String} study - Study [[organization@]project:]study where study and project can be either the ID or UUID.
313331
* @param {Object} [params] - The Object containing the following optional parameters:

src/core/clients/opencga/api/VariantOperation.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,25 @@ export default class VariantOperation extends OpenCGAParentClass {
8484
return this._delete("operation", null, "variant/annotation", null, "delete", params);
8585
}
8686

87+
/** Install a variant annotation extension and configure the project to use it
88+
* @param {Object} [data] - Parameters to configure a variant annotation extension.
89+
* @param {Object} [params] - The Object containing the following optional parameters:
90+
* @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not
91+
* provided.
92+
* @param {String} [params.jobDescription] - Job description.
93+
* @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on.
94+
* @param {String} [params.jobTags] - Job tags.
95+
* @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start.
96+
* @param {String} [params.jobPriority] - Priority of the job.
97+
* @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will
98+
* validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.
99+
* @param {String} [params.project] - project.
100+
* @returns {Promise} Promise object in the form of RestResponse instance.
101+
*/
102+
variantAnnotationExtensionConfigure(data, params) {
103+
return this._post("operation", null, "variant/annotation/extension", null, "configure", data, params);
104+
}
105+
87106
/** Create and load variant annotations into the database
88107
* @param {Object} [data] - Variant annotation index params.
89108
* @param {Object} [params] - The Object containing the following optional parameters:
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/*
2+
* Copyright 2015-2016 OpenCB
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import {LitElement, html} from "lit";
18+
import AnalysisUtils from "../../commons/analysis/analysis-utils.js";
19+
import UtilsNew from "../../../core/utils-new.js";
20+
import "../../commons/forms/data-form.js";
21+
import "../../commons/filters/catalog-search-autocomplete.js";
22+
23+
export default class RdInterpreterAnalysis extends LitElement {
24+
25+
constructor() {
26+
super();
27+
28+
this.#init();
29+
}
30+
31+
createRenderRoot() {
32+
return this;
33+
}
34+
35+
static get properties() {
36+
return {
37+
toolParams: {
38+
type: Object,
39+
},
40+
opencgaSession: {
41+
type: Object,
42+
},
43+
displayConfig: {
44+
type: Object,
45+
},
46+
};
47+
}
48+
49+
#init() {
50+
this.ANALYSIS_TOOL = "rd-interpreter";
51+
this.ANALYSIS_TITLE = "RD Interpreter";
52+
this.ANALYSIS_DESCRIPTION = "Executes an RD Interpreter analysis job";
53+
this.DEFAULT_TOOLPARAMS = {};
54+
55+
this._toolParams = UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS);
56+
this._config = this.getDefaultConfig();
57+
}
58+
59+
update(changedProperties) {
60+
if (changedProperties.has("toolParams")) {
61+
this._toolParams = {
62+
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
63+
...this.toolParams,
64+
};
65+
}
66+
67+
if(changedProperties.has("displayConfig") || changedProperties.has("toolParams")) {
68+
this._config = this.getDefaultConfig();
69+
}
70+
71+
super.update(changedProperties);
72+
}
73+
74+
check() {
75+
return null;
76+
}
77+
78+
onFieldChange() {
79+
this._toolParams = {...this._toolParams};
80+
this.requestUpdate();
81+
}
82+
83+
onSubmit() {
84+
const toolParams = {
85+
clinicalAnalysisId: this._toolParams.clinicalAnalysisId || "",
86+
};
87+
88+
AnalysisUtils.submit(
89+
this.ANALYSIS_TITLE,
90+
this.opencgaSession.opencgaClient.clinical()
91+
.runInterpreterRd(toolParams, {
92+
study: this.opencgaSession.study.fqn,
93+
...AnalysisUtils.fillJobParams(this._toolParams, this.ANALYSIS_TOOL),
94+
}),
95+
this,
96+
);
97+
}
98+
99+
onClear() {
100+
this._toolParams = {
101+
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
102+
...this.toolParams,
103+
};
104+
this._config = this.getDefaultConfig();
105+
this.requestUpdate();
106+
}
107+
108+
render() {
109+
return html`
110+
<data-form
111+
.data="${this._toolParams}"
112+
.config="${this._config}"
113+
@fieldChange="${event => this.onFieldChange(event)}"
114+
@clear="${event => this.onClear(event)}"
115+
@submit="${event => this.onSubmit(event)}">
116+
</data-form>
117+
`;
118+
}
119+
120+
getDefaultConfig() {
121+
const params = [
122+
{
123+
title: "Input Parameters",
124+
elements: [
125+
{
126+
title: "Clinical Analysis ID",
127+
field: "clinicalAnalysisId",
128+
type: "custom",
129+
display: {
130+
render: (clinicalAnalysisId, onFieldChange) => html`
131+
<catalog-search-autocomplete
132+
.value="${clinicalAnalysisId}"
133+
.resource="${"CLINICAL_ANALYSIS"}"
134+
.opencgaSession="${this.opencgaSession}"
135+
.config="${{
136+
multiple: false,
137+
disabled: !!this.toolParams?.clinicalAnalysisId,
138+
}}"
139+
@filterChange="${event => onFieldChange(event.detail.value)}">
140+
</catalog-search-autocomplete>
141+
`,
142+
},
143+
},
144+
],
145+
},
146+
];
147+
148+
return AnalysisUtils.getAnalysisConfiguration(
149+
this.ANALYSIS_TOOL,
150+
this.ANALYSIS_TITLE,
151+
this.ANALYSIS_DESCRIPTION,
152+
params,
153+
this.check(),
154+
{
155+
display: {
156+
...this.displayConfig,
157+
},
158+
},
159+
);
160+
}
161+
162+
}
163+
164+
customElements.define("rd-interpreter-analysis", RdInterpreterAnalysis);

0 commit comments

Comments
 (0)