Skip to content

Commit

Permalink
Merge pull request #798 from opencb/TASK-4547
Browse files Browse the repository at this point in the history
TASK-4547
  • Loading branch information
jmjuanes authored Jul 25, 2023
2 parents eb0849d + bebc79d commit 7854469
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 55 deletions.
1 change: 0 additions & 1 deletion src/sites/iva/iva-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import UtilsNew from "../../core/utils-new.js";
import NotificationUtils from "../../webcomponents/commons/utils/notification-utils.js";
import NotificationManager from "../../core/notification-manager.js";

import AnalysisRegistry from "../../webcomponents/variant/analysis/analysis-registry.js";
import "../../webcomponents/clinical/clinical-analysis-browser.js";
import "../../webcomponents/clinical/clinical-analysis-portal.js";
import "../../webcomponents/variant/variant-browser.js";
Expand Down
5 changes: 3 additions & 2 deletions src/webcomponents/job/job-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import {LitElement, html} from "lit";
import UtilsNew from "../../core/utils-new.js";
import AnalysisRegistry from "../variant/analysis/analysis-registry.js";
import LitUtils from "../commons/utils/lit-utils.js";
import "../commons/forms/data-form.js";
import "./job-detail-log.js";
Expand Down Expand Up @@ -345,6 +344,7 @@ export default class JobView extends LitElement {
},
],
},
/*
{
title: "Results",
display: {
Expand All @@ -355,11 +355,12 @@ export default class JobView extends LitElement {
type: "custom",
display: {
defaultLayout: "vertical",
render: () => AnalysisRegistry.get(this.job.tool.id)?.result(this.job, this.opencgaSession)
render: () => {}
},
},
],
},
*/
{
title: "Job Dependencies",
display: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OpencgaKnockoutAnalysis from "./deprecated/opencga-knockout-analysis.js";
import OpencgaRecessiveGeneAnalysis from "./deprecated/opencga-recessive-gene-analysis.js";
import OpencgaKnockoutAnalysis from "./opencga-knockout-analysis.js";
import OpencgaRecessiveGeneAnalysis from "./opencga-recessive-gene-analysis.js";

export default class AnalysisRegistry {

Expand All @@ -17,18 +17,18 @@ export default class AnalysisRegistry {
}

static get(id) {
const ar = this.registry[id];
const AR = this.registry[id];
// override the class default result config
if (ar) {
if (ar.result) {
ar.class.result = ar.result;
if (AR) {
if (AR.result) {
AR.class.result = AR.result;
}

if (ar.config) {
ar.class.config = {...ar.class.config, ...ar.config};
if (AR.config) {
AR.class.config = {...AR.class.config, ...AR.config};
}
// return Reflect.constructor(ar.class, ar.config)
return new ar.class(ar.config);
return new AR.class(AR.config);
} else {
console.warn("Analysis Class not found:" + id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import {classMap} from "lit/directives/class-map.js";
import GridCommons from "../../../commons/grid-commons.js";
import UtilsNew from "../../../../core/utils-new.js";
import "../../../commons/analysis/opencga-analysis-tool.js";
import AnalysisRegistry from "../analysis-registry.js";
import AnalysisRegistry from "./analysis-registry.js";
import "../../../commons/forms/select-field-filter.js";
import "../opencga-knockout-analysis/knockout-gene-grid.js";
import "../opencga-knockout-analysis/knockout-individual-view.js";
import "../opencga-knockout-analysis/knockout-variant-view.js";
import "./opencga-knockout-analysis/knockout-gene-grid.js";
import "./opencga-knockout-analysis/knockout-individual-view.js";
import "./opencga-knockout-analysis/knockout-variant-view.js";


export default class OpencgaKnockoutAnalysisResult extends LitElement {
Expand Down Expand Up @@ -71,8 +71,6 @@ export default class OpencgaKnockoutAnalysisResult extends LitElement {
}

updated(changedProperties) {
if (changedProperties.has("opencgaSession")) {
}
if (changedProperties.has("config")) {
this._config = {...this.getDefaultConfig(), ...this.config};
this.requestUpdate();
Expand All @@ -82,7 +80,7 @@ export default class OpencgaKnockoutAnalysisResult extends LitElement {
_changeTab(e) {
e.preventDefault();
const tabId = e.currentTarget.dataset.id;
//the selectors are strictly defined to avoid conflics in tabs in children components
// the selectors are strictly defined to avoid conflics in tabs in children components
$("#opencga-knockout-analysis-result > div > .content-pills", this).removeClass("active");
$("#opencga-knockout-analysis-result > .content-tab-wrapper > .content-tab", this).hide();
$("#" + this._prefix + tabId, this).show();
Expand All @@ -95,11 +93,11 @@ export default class OpencgaKnockoutAnalysisResult extends LitElement {
}

getDefaultConfig() {
return AnalysisRegistry.get("knockout").config;
// return AnalysisRegistry.get("knockout").config;
}

render() {
//wait for opencgaSession to be available because inner components use it
// wait for opencgaSession to be available because inner components use it
return this.opencgaSession ? html`
<div class="container" style="margin-top: 60px">
<div id="opencga-knockout-analysis-result">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

import {LitElement, html} from "lit";
import {classMap} from "lit/directives/class-map.js";
import UtilsNew from "../../../../core/utils-new.js";
import UtilsNew from "../../../../../core/utils-new.js";
import AnalysisRegistry from "../analysis-registry.js";
import GridCommons from "../../../commons/grid-commons.js";
import GridCommons from "../../../../commons/grid-commons.js";
import knockoutDataGene from "../test/knockout.20201103172343.kFIvpr.gene.js";

export default class KnockoutGeneGrid extends LitElement {
Expand Down Expand Up @@ -99,7 +99,7 @@ export default class KnockoutGeneGrid extends LitElement {
this.table = $("#" + this.gridId);
this.table.bootstrapTable("destroy");
this.table.bootstrapTable({
//data: this.tableData,
// data: this.tableData,
columns: this._initTableColumns(),
sidePagination: "local",
iconsPrefix: GridCommons.GRID_ICONS_PREFIX,
Expand All @@ -115,7 +115,7 @@ export default class KnockoutGeneGrid extends LitElement {
ajax: params => {
this.opencgaSession.opencgaClient.variants().queryKnockoutGene({job: this.jobId, study: this.opencgaSession.study.fqn})
.then(restResponse => {
console.log("restResponse", restResponse)
console.log("restResponse", restResponse);
this.tableData = restResponse.getResults();
params.success(this.tableData);
}).catch(e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import {LitElement, html} from "lit";
import UtilsNew from "../../../../core/utils-new.js";
import GridCommons from "../../../commons/grid-commons.js";
import "./../../../commons/view/detail-tabs.js";
import UtilsNew from "../../../../../core/utils-new.js";
import GridCommons from "../../../../commons/grid-commons.js";
import "../../../../commons/view/detail-tabs.js";
import knockoutDataIndividuals from "../test/knockout.20201103172343.kFIvpr.individuals.js";


Expand Down Expand Up @@ -55,9 +55,6 @@ export default class KnockoutIndividualVariants extends LitElement {
}

updated(changedProperties) {
if (changedProperties.has("opencgaSession")) {
}

if (changedProperties.has("individual")) {
this.prepareData();
this.renderTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/

import {LitElement, html} from "lit";
import UtilsNew from "../../../../core/utils-new.js";
import CatalogGridFormatter from "../../../commons/catalog-grid-formatter.js";
import UtilsNew from "../../../../../core/utils-new.js";
import CatalogGridFormatter from "../../../../commons/catalog-grid-formatter.js";
import AnalysisRegistry from "../analysis-registry.js";
import GridCommons from "../../../commons/grid-commons.js";
import GridCommons from "../../../../commons/grid-commons.js";
import knockoutDataIndividuals from "../test/knockout.20201103172343.kFIvpr.individuals.js";
import "./knockout-individual-variants.js";
import "../../../family/family-view.js";
import "../../../../family/family-view.js";

export default class KnockoutIndividualView extends LitElement {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import {LitElement, html} from "lit";
import UtilsNew from "../../../../core/utils-new.js";
import GridCommons from "../../../commons/grid-commons.js";
import "./../../../commons/view/detail-tabs.js";
import UtilsNew from "../../../../../core/utils-new.js";
import GridCommons from "../../../../commons/grid-commons.js";
import "../../../../commons/view/detail-tabs.js";
import knockoutDataIndividuals from "../test/knockout.20201103172343.kFIvpr.individuals.js";


Expand Down Expand Up @@ -54,9 +54,6 @@ export default class KnockoutVariantAllelePairs extends LitElement {
}

updated(changedProperties) {
if (changedProperties.has("opencgaSession")) {
}

if (changedProperties.has("variantId")) {
this.prepareData();
this.renderTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import {LitElement, html} from "lit";
import UtilsNew from "../../../../core/utils-new.js";
import GridCommons from "../../../commons/grid-commons.js";
import "./../../../commons/view/detail-tabs.js";
import UtilsNew from "../../../../../core/utils-new.js";
import GridCommons from "../../../../commons/grid-commons.js";
import "../../../../commons/view/detail-tabs.js";
import knockoutDataIndividuals from "../test/knockout.20201103172343.kFIvpr.individuals.js";


Expand Down Expand Up @@ -54,8 +54,6 @@ export default class KnockoutVariantIndividual extends LitElement {
}

updated(changedProperties) {
if (changedProperties.has("opencgaSession")) {
}

if (changedProperties.has("variant")) {
this.prepareData();
Expand Down Expand Up @@ -86,7 +84,7 @@ export default class KnockoutVariantIndividual extends LitElement {
uniqueId: "id",
pagination: true,
paginationVAlign: "both",
//formatShowingRows: this.gridCommons.formatShowingRows,
// formatShowingRows: this.gridCommons.formatShowingRows,
gridContext: this,
formatLoadingMessage: () => "<div><loading-spinner></loading-spinner></div>",
onClickRow: (row, selectedElement, field) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
*/

import {LitElement, html} from "lit";
import UtilsNew from "../../../../core/utils-new.js";
import CatalogGridFormatter from "../../../commons/catalog-grid-formatter.js";
import UtilsNew from "../../../../../core/utils-new.js";
import CatalogGridFormatter from "../../../../commons/catalog-grid-formatter.js";
import AnalysisRegistry from "../analysis-registry.js";
import GridCommons from "../../../commons/grid-commons.js";
import GridCommons from "../../../../commons/grid-commons.js";
import knockoutData from "../test/knockout.20201029141213.SChLEA.js";
import "./knockout-individual-variants.js";
import "./knockout-variant-allele-pairs.js";
import "./knockout-variant-individual.js";
import "../../../family/family-view.js";
import "../../annotation/cellbase-population-frequency-grid.js";
import "../../annotation/variant-annotation-clinical-view.js";
import "../../../../family/family-view.js";
import "../../../annotation/cellbase-population-frequency-grid.js";
import "../../../annotation/variant-annotation-clinical-view.js";


export default class KnockoutVariantView extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@ export default [
}
]
}
]
];
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ export default [
}
]
}
]
];

0 comments on commit 7854469

Please sign in to comment.