Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-4438 - Improve Pharmacogenomics IVA user interfaces #940

Merged
merged 38 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
33669e0
Merge branch 'TASK-6133' into TASK-2523
imedina Jun 2, 2024
d833124
Initial split of clinical tables
imedina Jun 3, 2024
36ddfbf
Merge branch 'develop' into TASK-4438
imedina Jun 4, 2024
d2334d4
Add pharmacagonemics web component
imedina Jul 8, 2024
7ad6d20
Merge branch 'develop' into TASK-4438
imedina Jul 8, 2024
c879a41
Merge branch 'develop' into TASK-4438
jmjuanes Jul 9, 2024
94eb6fa
Merge branch 'TASK-6133' into TASK-4438
imedina Jul 9, 2024
a5d5f5d
Minor UI improvements
imedina Jul 10, 2024
bcb4c6a
wc: Fix lifecycle methods in annotation-clinical-view #TASK-4438
jmjuanes Jul 10, 2024
97f03f5
core: Add new groupBy method in utils module #TASK-4438
jmjuanes Jul 10, 2024
f620369
wc: Move groupBy method to utils and add trait observer #TASK-4438
jmjuanes Jul 10, 2024
c7da54b
wc: Fix generating grouped trait items in clinical view #TASK-4438
jmjuanes Jul 10, 2024
14ef7f7
wc: Minor code style fixes in clinical view #TASK-4438
jmjuanes Jul 10, 2024
81be989
Merge branch 'develop' into TASK-4438
jmjuanes Jul 10, 2024
b1c896d
Merge branch 'develop' into TASK-4438
jmjuanes Jul 10, 2024
d098c51
Check icon right margin
imedina Jul 11, 2024
5b92c8a
Merge branch 'develop' into TASK-4438
jmjuanes Jul 11, 2024
7382b18
Add tooltip to new population frequencies table
imedina Jul 15, 2024
77a4051
Merge branch 'release-3.2.x' into TASK-4438
jmjuanes Jul 19, 2024
24d02cf
test: Fix interpreter grid cnv tests #TASK-4438
jmjuanes Jul 22, 2024
399b33e
test: Fix interpreter grid snv tests #TASK-4438
jmjuanes Jul 22, 2024
5978634
test: Fix interpreter grid germline tests #TASK-4438
jmjuanes Jul 22, 2024
9753b35
iva: Enable pharmacogenomics tab in variant browser settings #TASK-66…
jmjuanes Jul 23, 2024
be97ac4
core: Update OpenCGA client #TASK-6602 #TASK-4438
jmjuanes Jul 26, 2024
8eded42
wc: Restore disabled in Edit action of job-grid #TASK-6602 #TASK-4438
jmjuanes Jul 26, 2024
eee4ac4
Merge branch 'TASK-4438' of github.com:opencb/jsorolla into TASK-4438
imedina Aug 6, 2024
c58d798
Merge branch 'release-3.2.x' into TASK-4438
jmjuanes Aug 9, 2024
826447e
wc: Fix job actions params #TASK-4438
jmjuanes Aug 12, 2024
43d58db
iva: Fix default opencga host #TASK-4438
jmjuanes Aug 12, 2024
effb111
Merge branch 'release-3.2.x' into TASK-4438
jmjuanes Aug 13, 2024
9e7740d
Merge branch 'TASK-4438' of github.com:opencb/jsorolla into TASK-4438
imedina Aug 13, 2024
af9c598
Get old populationFrequency function
imedina Aug 13, 2024
bcdd6f2
Merge branch 'release-3.2.x' into TASK-4438
jmjuanes Aug 13, 2024
7927f62
Merge 'release-3.2.x' into TASK-4438
gpveronica Aug 26, 2024
7d7c9f5
wc - Fix tiny mistake in conflict resolution
gpveronica Aug 26, 2024
ed484d9
wc - Fix format
gpveronica Aug 26, 2024
95aea96
Merge branch 'release-3.2.x' into TASK-4438
gpveronica Aug 28, 2024
8f7b2ac
Merge branch 'release-3.2.x' into TASK-4438
gpveronica Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cypress/e2e/iva/variant-interpreter-grid-cancer-cnv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,9 @@ context("Variant Interpreter Grid Cancer CNV", () => {

it("should display Cohort Stats (Population Frequencies) tooltip", () => {
cy.get("tbody tr:first > td")
.eq(10)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
.eq(13)
.find("a")
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});
Expand Down
19 changes: 8 additions & 11 deletions cypress/e2e/iva/variant-interpreter-grid-cancer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,20 @@ context("Variant Interpreter Grid Cancer", () => {
});
});

it("should display cohort stats (population frequencies) tooltip", () => {
it("should display cohort stats tooltip", () => {
cy.get("tbody tr:first > td")
.eq(10)
.within(() => {
cy.get("a").trigger("mouseover");
});
.eq(13)
.find("a")
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});

it("should reference population frequencies tooltip", () => {
it("should display reference population frequencies tooltip", () => {
cy.get("tbody tr:first > td")
.eq(11)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
.eq(14)
.find("a")
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});
Expand Down
42 changes: 7 additions & 35 deletions cypress/e2e/iva/variant-interpreter-grid-germline.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,51 +168,23 @@ context("Variant Interpreter Grid Germiline", () => {
});
});

it("should display cohort stats (Population Frequencies) tooltip", () => {
it("should display cohort stats tooltip", () => {
cy.get("tbody tr:first > td")
.eq(9)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
.eq(12)
.find("a")
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});

it("should display reference population frequencies tooltip", () => {
cy.get("tbody tr:first > td")
.eq(10)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display ACMG Prediction (Classification) tooltip", () => {
cy.get("tbody tr:first > td")
.eq(16)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display OMIM Prediction (Classification) tooltip", () => {
UtilsTest.changePage(browserInterpreterGrid,2);

cy.get("tbody tr:nth-child(6) > td:nth-child(15)")
.within(() => {
cy.get("a")
.trigger("mouseover");
});
.eq(13)
.find("a")
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});

});

context("Helpers", () => {
Expand Down
14 changes: 11 additions & 3 deletions src/core/bioinfo/bioinfo-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class BioinfoUtils {
case "GO":
return this.getGeneOntologyLink(ontologyTermId);
case "OMIM":
return this.getOmimLink(id);
return this.getOmimOntologyLink(id);
case "ORPHA":
return this.getOrphanetLink(id);
case "MONDO":
Expand Down Expand Up @@ -293,16 +293,24 @@ export default class BioinfoUtils {
return `https://hpo.jax.org/app/browse/term/${hpoTerm}`;
}

// static getOmimLink(omimEntry) {
// return `https://www.omim.org/entry/${omimEntry}`;
// }

static getSequenceOntologyLink(soTerm) {
return `http://www.sequenceontology.org/browser/current_svn/term/${soTerm}`;
}

static getOmimLink(soTerm) {
return `https://omim.org/entry/${soTerm}"`;
static getOmimOntologyLink(soTerm) {
return `https://www.omim.org/entry/${soTerm}"`;
}

static getOrphanetLink(orphaId) {
return `https://www.orpha.net/consor/cgi-bin/OC_Exp.php?lng=EN&Expert=${orphaId}`;
}

static getPharmGKBLink(pharmGKBId) {
return `https://www.pharmgkb.org/chemical/${pharmGKBId}`;
}

}
12 changes: 11 additions & 1 deletion src/core/utils-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export default class UtilsNew {
}

static initTooltip(scope) {
$("a[tooltip-title], span[tooltip-title]", scope).each(function () {
$("a[tooltip-title], span[tooltip-title], table[tooltip-title], td[tooltip-title]", scope).each(function () {
$(this).qtip({
content: {
title: $(this).attr("tooltip-title"),
Expand Down Expand Up @@ -1077,4 +1077,14 @@ export default class UtilsNew {
.filter(item => !!item);
}

// Group elements in array by the value in the given key
static groupBy(array, key) {
return array.reduce((result, currentValue) => {
const objectValue = UtilsNew.getObjectValue(currentValue, key);
// eslint-disable-next-line no-param-reassign
(result[objectValue] = result[objectValue] || []).push(currentValue);
return result;
}, {});
}

}
2 changes: 1 addition & 1 deletion src/sites/iva/conf/browsers.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const CATALOG_SETTINGS = {
},
// merge criterium: uses this array as filter for internal 1D array.
// It is supported either details[] or hiddenDetails[].
details: ["annotationSummary", "annotationConsType", "annotationPropFreq", "annotationClinical", "cohortStats", "samples", "beacon", "json-view"]
details: ["annotationSummary", "annotationConsType", "annotationPropFreq", "annotationClinical", "annotationPharmacogenomics", "cohortStats", "samples", "beacon", "json-view"]
// hiddenDetails: ["json-view"]
},
DISEASE_PANEL_BROWSER: {
Expand Down
2 changes: 1 addition & 1 deletion src/sites/iva/conf/opencga-variant-browser.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ const OPENCGA_VARIANT_BROWSER_SETTINGS = {
},
// merge criterium: uses this array as filter for internal 1D array.
// It is supported either details[] or hiddenDetails[].
details: ["annotationSummary", "annotationConsType", "annotationPropFreq", "annotationClinical", "cohortStats", "samples", "beacon", "json-view"]
details: ["annotationSummary", "annotationConsType", "annotationPropFreq", "annotationClinical", "annotationPharmacogenomics", "cohortStats", "samples", "beacon", "json-view"]
// hiddenDetails: ["json-view"]
};
6 changes: 3 additions & 3 deletions src/webcomponents/clinical/clinical-analysis-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export default class ClinicalAnalysisGrid extends LitElement {
// const btnClassName = "d-inline-flex align-items-center btn btn-light dropdown-toggle";
const btnClassName = "d-flex justify-content-between align-items-center btn btn-light dropdown-toggle w-100";
// const btnStyle = "display:inline-flex;align-items:center;";

debugger
return `
<div class="dropdown">
<button class="${btnClassName}" type="button" data-bs-toggle="dropdown" ${!isEditable ? "disabled=\"disabled\"" : ""}>
Expand Down Expand Up @@ -651,7 +651,7 @@ export default class ClinicalAnalysisGrid extends LitElement {
const session = this.opencgaSession;
const url = `#interpreter/${session.project.id}/${session.study.id}/${row.id}`;
const hasWriteAccess = OpencgaCatalogUtils.checkPermissions(session.study, session.user.id, "WRITE_CLINICAL_ANALYSIS");
const hasAdminAccess = hasWriteAccess || "disabled";
const hasAdminAccess = hasWriteAccess ? "" : "disabled";
const lockActionIcon = row.locked ? "fa-unlock" : "fa-lock";
const lockActionText = row.locked ? "Unlock" : "Lock";
const isOwnOrIsLocked = row.locked || !row.analysts?.some(analyst => analyst.id === this.opencgaSession?.user?.id) ? "disabled" : "";
Expand Down Expand Up @@ -687,7 +687,7 @@ export default class ClinicalAnalysisGrid extends LitElement {
<!-- Edit the case -->
<li>
<a data-action="edit" class="btn force-text-left ${hasAdminAccess}">
<i class="fas fa-edit icon-padding" aria-hidden="true"></i> Edit ...
<i class="fas fa-edit me-1" aria-hidden="true"></i> Edit ...
</a>
</li>
<!-- Delete the case -->
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/clinical/clinical-analysis-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export default class ClinicalAnalysisView extends LitElement {
template: "${disorder.name} (${disorder.id})",
link: {
"disorder.id": id => id.startsWith("OMIM:") ?
BioinfoUtils.getOmimLink(id) :
BioinfoUtils.getOmimOntologyLink(id) :
"",
},
},
Expand Down
7 changes: 4 additions & 3 deletions src/webcomponents/cohort/cohort-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,14 @@ export default class CohortGrid extends LitElement {
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a data-action="edit" class="dropdown-item ${OpencgaCatalogUtils.checkPermissions(this.opencgaSession.study, this.opencgaSession.user.id, this.permissionID) || "disabled" }">
<i class="fas fa-edit icon-padding" aria-hidden="true"></i> Edit ...
<a data-action="edit" class="dropdown-item ${OpencgaCatalogUtils.checkPermissions(this.opencgaSession.study, this.opencgaSession.user.id, this.permissionID) ? "" : "disabled"}"
href="javascript: void 0">
<i class="fas fa-edit me-1" aria-hidden="true"></i> Edit ...
</a>
</li>
<li>
<a data-action="delete" href="javascript: void 0" class="dropdown-item btn force-text-left disabled">
<i class="fas fa-trash icon-padding" aria-hidden="true"></i> Delete
<i class="fas fa-trash me-1" aria-hidden="true"></i> Delete
</a>
</li>
</ul>
Expand Down
12 changes: 6 additions & 6 deletions src/webcomponents/commons/filters/clinical-annotation-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import {LitElement, html} from "lit";
import {html, LitElement} from "lit";
import "../../commons/forms/select-field-filter.js";
import "../../commons/forms/checkbox-field-filter.js";

Expand All @@ -24,7 +24,7 @@ export default class ClinicalAnnotationFilter extends LitElement {
super();

// Set status and init private properties
this._init();
this.#init();
}

createRenderRoot() {
Expand All @@ -48,7 +48,7 @@ export default class ClinicalAnnotationFilter extends LitElement {
};
}

_init() {
#init() {
this.query = {};
}

Expand Down Expand Up @@ -98,7 +98,7 @@ export default class ClinicalAnnotationFilter extends LitElement {

render() {
return html`
<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Select Clinical Database
</label>
Expand All @@ -112,7 +112,7 @@ export default class ClinicalAnnotationFilter extends LitElement {
</div>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Select Clinical Significance
</label>
Expand All @@ -126,7 +126,7 @@ export default class ClinicalAnnotationFilter extends LitElement {
</div>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Check Status
</label>
Expand Down
16 changes: 8 additions & 8 deletions src/webcomponents/commons/filters/disease-panel-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class DiseasePanelFilter extends LitElement {
super();

// Set status and init private properties
this._init();
this.#init();
}

createRenderRoot() {
Expand Down Expand Up @@ -97,7 +97,7 @@ export default class DiseasePanelFilter extends LitElement {
};
}

_init() {
#init() {
this.query = {};
this.genes = [];
// this.panelFeatureType = "";
Expand Down Expand Up @@ -203,7 +203,7 @@ export default class DiseasePanelFilter extends LitElement {
return html`
<!-- Only show the title when all filters are displayed -->
<div class="mb-3">
<div class="mb-2">
<div class="mb-3">
${this.showExtendedFilters ? html`
<label class="form-label">
Select Disease Panels
Expand Down Expand Up @@ -233,7 +233,7 @@ export default class DiseasePanelFilter extends LitElement {
}

${this.showExtendedFilters ? html`
<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Panel Intersection
</label>
Expand All @@ -250,7 +250,7 @@ export default class DiseasePanelFilter extends LitElement {
</div>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Filter by Feature Type
</label>
Expand All @@ -265,7 +265,7 @@ export default class DiseasePanelFilter extends LitElement {
</select-field-filter>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Filter Genes by Mode of Inheritance
</label>
Expand All @@ -280,7 +280,7 @@ export default class DiseasePanelFilter extends LitElement {
</select-field-filter>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Filter Genes by Confidence
</label>
Expand All @@ -295,7 +295,7 @@ export default class DiseasePanelFilter extends LitElement {
</select-field-filter>
</div>

<div class="mb-2">
<div class="mb-3">
<label class="form-label">
Filter Genes by Role in Cancer
</label>
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/commons/opencb-grid-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class OpencbGridToolbar extends LitElement {

return html`
<div class="opencb-grid-toolbar">
<div class="row mb-3">
<div class="row mb-2">
<div id="${this._prefix}ToolbarLeft" class="col-md-6">
<!-- Display components on the LEFT -->
</div>
Expand Down
Loading
Loading