Skip to content

Commit

Permalink
Merge pull request #1001 from opencb/TASK-6930
Browse files Browse the repository at this point in the history
TASK-6930 - Unable to launch variant-stats-index from IVA
  • Loading branch information
jmjuanes authored Oct 29, 2024
2 parents 5218b2c + d679eec commit 2ba266f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/webcomponents/study/admin/variant/operations-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default class OperationsAdmin extends LitElement {
}
return html`
<variant-annotation-index-operation
.toolParams="${{project: opencgaSession.project.id}}"
.toolParams="${{project: opencgaSession.project.fqn}}"
.opencgaSession="${opencgaSession}">
</variant-annotation-index-operation>
`;
Expand All @@ -217,7 +217,7 @@ export default class OperationsAdmin extends LitElement {
}
return html`
<variant-secondary-annotation-index-operation
.toolParams="${{project: opencgaSession.project.id}}"
.toolParams="${{project: opencgaSession.project.fqn}}"
.opencgaSession="${opencgaSession}">
</variant-secondary-annotation-index-operation>
`;
Expand Down Expand Up @@ -265,10 +265,9 @@ export default class OperationsAdmin extends LitElement {
visibility: "private",
type: "navitem",
render: (opencgaSession, study) => {
// CAUTION: no .fqn? in toolParams property?
return html`
<variant-secondary-sample-index-operation
.toolParams="${{study: study.id}}"
.toolParams="${{study: study.fqn}}"
.opencgaSession="${opencgaSession}">
</variant-secondary-sample-index-operation>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default class VariantAnnotationIndexOperation extends LitElement {
onClear() {
this.toolParams = {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
project: this.toolParams.project || "",
};
this.config = this.getDefaultConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default class VariantIndexOperation extends LitElement {
onClear() {
this.toolParams = {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
study: this.toolParams.study || "",
};
this.config = this.getDefaultConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default class VariantSecondaryAnnotationIndexOperation extends LitElement
onClear() {
this.toolParams = {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
project: this.toolParams.project || "",
};
this.config = this.getDefaultConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export default class VariantSecondarySampleIndexOperation extends LitElement {
onClear() {
this.toolParams = {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
study: this.toolParams.study || "",
};
this.config = this.getDefaultConfig();
}
Expand Down Expand Up @@ -168,7 +169,7 @@ export default class VariantSecondarySampleIndexOperation extends LitElement {
title: "Configuration Parameters",
elements: [
{
title: "Sample",
title: "Sample IDs",
type: "custom",
required: true,
display: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default class VariantStatsIndexOperation extends LitElement {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
};

this.study = "";
this.config = this.getDefaultConfig();
}

Expand Down Expand Up @@ -84,6 +83,11 @@ export default class VariantStatsIndexOperation extends LitElement {
message: "Study is a mandatory parameter, please select one."
};
}
if (!this.toolParams.cohort) {
return {
message: "Cohort IDs is a mandatory parameter, please select some cohorts."
};
}
return null;
}

Expand All @@ -98,6 +102,7 @@ export default class VariantStatsIndexOperation extends LitElement {

onSubmit() {
const toolParams = {
cohort: this.toolParams.cohort?.split(",") || [],
overwriteStats: this.toolParams.overwriteStats || false,
resume: this.toolParams.resume || false,
};
Expand All @@ -116,6 +121,7 @@ export default class VariantStatsIndexOperation extends LitElement {
onClear() {
this.toolParams = {
...UtilsNew.objectClone(this.DEFAULT_TOOLPARAMS),
study: this.toolParams.study || "",
};
this.config = this.getDefaultConfig();
}
Expand Down Expand Up @@ -160,6 +166,22 @@ export default class VariantStatsIndexOperation extends LitElement {
{
title: "Configuration Parameters",
elements: [
{
title: "Cohort IDs",
type: "custom",
required: true,
display: {
render: toolParams => html `
<catalog-search-autocomplete
.value="${toolParams?.cohort}"
.resource="${"COHORT"}"
.opencgaSession="${this.opencgaSession}"
.config="${{multiple: true}}"
@filterChange="${e => this.onFieldChange(e, "cohort")}">
</catalog-search-autocomplete>
`,
},
},
{
title: "Overwrite Stats",
field: "overwriteStats",
Expand Down

0 comments on commit 2ba266f

Please sign in to comment.