Skip to content

Commit

Permalink
Merge branch 'release-2.8.x' into TASK-2355
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Oct 24, 2023
2 parents 9081319 + e09bc49 commit 05c2ba0
Show file tree
Hide file tree
Showing 56 changed files with 523 additions and 56,668 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsorolla",
"version": "2.8.3-dev",
"version": "2.8.6-dev",
"description": "JSorolla is a JavaScript bioinformatic library for data analysis and genomic visualization",
"repository": {
"type": "git",
Expand Down Expand Up @@ -77,7 +77,6 @@
"select2": "^4.1.0-rc.0",
"select2-bootstrap-theme": "0.1.0-beta.10",
"sweetalert2": "^9.13.1",
"tokenize2": "^1.3.1",
"urijs": "~1.19.10",
"vanilla-jsoneditor": "^0.7.11"
},
Expand Down
2 changes: 0 additions & 2 deletions src/sites/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<!-- <script type="text/javascript" src="../../../node_modules/bootstrap-notify/bootstrap-notify.js"></script>-->
<script type="text/javascript" src="../../../node_modules/jwt-decode/build/jwt-decode.js"></script>
<script type="text/javascript" src="../../../node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="../../../node_modules/tokenize2/dist/tokenize2.min.js"></script>
<script type="text/javascript" src="../../../node_modules/@svgdotjs/svg.js/dist/svg.min.js"></script>
<script type="text/javascript" src="../../../node_modules/sweetalert2/dist/sweetalert2.js"></script>
<script type="text/javascript" src="../../../node_modules/clipboard/dist/clipboard.min.js"></script>
Expand All @@ -95,7 +94,6 @@
<link rel="stylesheet" href="../../../node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="../../../node_modules/qtip2/dist/jquery.qtip.min.css">
<link rel="stylesheet" href="../../../node_modules/jquery.json-viewer/json-viewer/jquery.json-viewer.css">
<link rel="stylesheet" href="../../../node_modules/tokenize2/dist/tokenize2.min.css">
<link rel="stylesheet" href="../../../node_modules/sweetalert2/dist/sweetalert2.css">
<link rel="stylesheet" href="../../../node_modules/@highlightjs/cdn-assets/styles/default.min.css">
<link rel="stylesheet" href="../../../node_modules/select2/dist/css/select2.css">
Expand Down
20 changes: 19 additions & 1 deletion src/sites/iva/conf/browsers.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,25 @@ const INTERPRETER_SETTINGS = {
],
},
{
id: "methods"
id: "methods",
items: [
{
type: "SINGLE",
methods: [
{id: "exomiser"},
],
},
{
type: "FAMILY",
methods: [
{id: "exomiser"},
],
},
{
type: "CANCER",
methods: [],
},
],
},
{
id: "variant-browser",
Expand Down
2 changes: 1 addition & 1 deletion src/sites/iva/conf/opencga-variant-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ const tooltips = {
"This knowledge is both human-readable and machine-readable, and is a foundation for computational analysis of large-scale molecular biology and genetics experiments in biomedical research.",
hpo: "The Human Phenotype Ontology (HPO) provides a standardized vocabulary of phenotypic abnormalities encountered in human disease.",
clinvar: "Filter out variants falling outside the genomic features (gene, transcript, SNP, etc.) defined",
fullTextSearch: "Filter out variants falling outside the genomic features (gene, transcript, SNP, etc.) defined",
fullTextSearch: "Filter out variants that do not match with the IDs or the full text provided",
cadd: "Raw values have relative meaning, with higher values indicating that a variant is more likely to be " +
"simulated (or not observed) and therefore more likely to have deleterious effects. If discovering causal variants " +
"within an individual, or small groups, of exomes or genomes te use of the scaled CADD score is recommended",
Expand Down
2 changes: 0 additions & 2 deletions src/sites/iva/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
<!-- <script type="text/javascript" src="../../../node_modules/bootstrap-notify/bootstrap-notify.min.js" ></script>-->
<script type="text/javascript" src="../../../node_modules/jwt-decode/build/jwt-decode.min.js"></script>
<script type="text/javascript" src="../../../node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="../../../node_modules/tokenize2/dist/tokenize2.min.js"></script>
<script type="text/javascript" src="../../../node_modules/@svgdotjs/svg.js/dist/svg.min.js"></script>
<script type="text/javascript" src="../../../node_modules/sweetalert2/dist/sweetalert2.min.js"></script>
<!-- <script type="text/javascript" src="../node_modules/@highlightjs/cdn-assets/highlight.min.js"></script> -->
Expand All @@ -129,7 +128,6 @@
<link rel="stylesheet" href="../../../node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="../../../node_modules/qtip2/dist/jquery.qtip.min.css">
<link rel="stylesheet" href="../../../node_modules/jquery.json-viewer/json-viewer/jquery.json-viewer.css">
<link rel="stylesheet" href="../../../node_modules/tokenize2/dist/tokenize2.min.css">
<link rel="stylesheet" href="../../../node_modules/sweetalert2/dist/sweetalert2.min.css">
<link rel="stylesheet" href="../../../node_modules/@highlightjs/cdn-assets/styles/default.min.css">
<link rel="stylesheet" href="../../../node_modules/select2/dist/css/select2.min.css">
Expand Down
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
2 changes: 0 additions & 2 deletions src/sites/test-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
<!-- <script type="text/javascript" src="../../../node_modules/bootstrap-notify/bootstrap-notify.min.js" ></script>-->
<script type="text/javascript" src="../../../node_modules/jwt-decode/build/jwt-decode.min.js"></script>
<script type="text/javascript" src="../../../node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="../../../node_modules/tokenize2/dist/tokenize2.min.js"></script>
<script type="text/javascript" src="../../../node_modules/@svgdotjs/svg.js/dist/svg.min.js"></script>
<script type="text/javascript" src="../../../node_modules/sweetalert2/dist/sweetalert2.min.js"></script>
<!-- <script type="text/javascript" src="../node_modules/@highlightjs/cdn-assets/highlight.min.js"></script> -->
Expand All @@ -104,7 +103,6 @@
<link rel="stylesheet" href="../../../node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="../../../node_modules/qtip2/dist/jquery.qtip.min.css">
<link rel="stylesheet" href="../../../node_modules/jquery.json-viewer/json-viewer/jquery.json-viewer.css">
<link rel="stylesheet" href="../../../node_modules/tokenize2/dist/tokenize2.min.css">
<link rel="stylesheet" href="../../../node_modules/sweetalert2/dist/sweetalert2.min.css">
<link rel="stylesheet" href="../../../node_modules/@highlightjs/cdn-assets/styles/default.min.css">
<link rel="stylesheet" href="../../../node_modules/select2/dist/css/select2.min.css">
Expand Down
26 changes: 17 additions & 9 deletions src/webcomponents/clinical/clinical-analysis-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import UtilsNew from "../../core/utils-new.js";
import "../commons/forms/data-form.js";
import "../commons/filters/disease-panel-filter.js";
import "../commons/filters/catalog-search-autocomplete.js";
import "../commons/image-viewer.js";
import "./filters/clinical-priority-filter.js";
import "./filters/clinical-flag-filter.js";

Expand Down Expand Up @@ -107,14 +108,17 @@ export default class ClinicalAnalysisCreate extends LitElement {
}

// In FAMILY, changing the proband only sets the 'proband.id' field of the clinicalAnalysis object
// We have to add also the disorders list to 'proband.disorders'.
// We need to save the full member object in proband.
if (e.detail.param === "proband.id" && this.clinicalAnalysis.type === "FAMILY") {
// Changing the 'proband.id' means we have to reset the disorder field
delete this.clinicalAnalysis.disorder;
if (this.clinicalAnalysis.proband?.id) {
const proband = this.clinicalAnalysis.family.members.find(member => member.id === this.clinicalAnalysis.proband?.id);
this.clinicalAnalysis.proband.disorders = proband?.disorders || [];
} else if (this.clinicalAnalysis.proband?.disorders) {
// If we have remove the 'proband.id', we have to remove also the 'proband.disorders' field
delete this.clinicalAnalysis.proband.disorders;
this.clinicalAnalysis.proband = UtilsNew.objectClone(proband);
this.clinicalAnalysis.proband.disorders = this.clinicalAnalysis.proband.disorders || [];
} else {
// If we have removed the 'proband.id' field, we have to remove also the full proband object
delete this.clinicalAnalysis.proband;
}
}

Expand Down Expand Up @@ -175,7 +179,7 @@ export default class ClinicalAnalysisCreate extends LitElement {
if (this.clinicalAnalysis.family && this.clinicalAnalysis.family.members) {
for (const member of this.clinicalAnalysis.family.members) {
if (member.disorders && member.disorders.length > 0 && member.father.id && member.mother.id) {
this.clinicalAnalysis.proband = member;
this.clinicalAnalysis.proband = UtilsNew.objectClone(member);
break;
}
}
Expand Down Expand Up @@ -646,11 +650,15 @@ export default class ClinicalAnalysisCreate extends LitElement {
title: "Pedigree",
type: "custom",
display: {
// defaultLayout: "vertical",
render: data => {
if (data.family) {
return html`<pedigree-view .family="${data.family}"></pedigree-view>`;
if (data?.family?.pedigreeGraph?.base64) {
return html`
<image-viewer
.data="${data.family?.pedigreeGraph?.base64}">
</image-viewer>
`;
}
return "-";
},
errorMessage: "No family selected",
}
Expand Down
45 changes: 37 additions & 8 deletions src/webcomponents/clinical/clinical-analysis-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default class ClinicalAnalysisUpdate extends LitElement {
#init() {
this.clinicalAnalysis = {};
this.clinicalAnalysisId = "";
this.buttonsDisabled = false;

this.displayConfig = {
titleWidth: 3,
Expand Down Expand Up @@ -89,11 +90,15 @@ export default class ClinicalAnalysisUpdate extends LitElement {
this.disordersAllowedValues = (this.clinicalAnalysis?.proband?.disorders?.length > 0) ?
this.clinicalAnalysis?.proband?.disorders?.map(disorder => disorder.id) :
[];

// Initialize the state of the submit and discard buttons
this.buttonsDisabled = !!this.clinicalAnalysis?.locked;
this._config = this.getDefaultConfig();
}

clinicalAnalysisIdObserver(e) {
this.clinicalAnalysis = e.detail.value;
/*
/*
// Fixme: discuss what to do with:
// (a) the custom event received.
// (b) event.status error and message (notified to the user in opencga-update catch)
Expand All @@ -104,13 +109,33 @@ export default class ClinicalAnalysisUpdate extends LitElement {
e.detail.value,
e.detail,
null);
*/
*/
// Initialize the state of the submit and discard buttons
this.buttonsDisabled = !!this.clinicalAnalysis?.locked;
this._config = this.getDefaultConfig();
this.requestUpdate();
}

opencgaSessionObserver() {
this.users = OpencgaCatalogUtils.getUsers(this.opencgaSession.study);
}

onComponentFieldChange(e) {
if (e.detail.param === "locked") {
if (this.clinicalAnalysis?.locked) {
this.buttonsDisabled = e.detail.value;
}
this._config = this.getDefaultConfig();
this.requestUpdate();
}
}

onComponentClear() {
this.buttonsDisabled = !!this.clinicalAnalysis?.locked;
this._config = this.getDefaultConfig();
this.requestUpdate();
}

render() {
return html`
<opencga-update
Expand All @@ -119,7 +144,9 @@ export default class ClinicalAnalysisUpdate extends LitElement {
.componentId="${this.clinicalAnalysisId}"
.opencgaSession="${this.opencgaSession}"
.config="${this._config}"
@componentIdObserver="${this.clinicalAnalysisIdObserver}">
@componentIdObserver="${this.clinicalAnalysisIdObserver}"
@componentFieldChange="${this.onComponentFieldChange}"
@componentClear="${this.onComponentClear}">
</opencga-update>
`;
}
Expand All @@ -129,7 +156,11 @@ export default class ClinicalAnalysisUpdate extends LitElement {
id: "clinical-analysis", // Fixme: clinical-analysis-update.js?
title: "Case Editor", // Fixme: Clinical Analysis update?
icon: "fas fa-user-md", // Fixme: to overwrite?
display: this.displayConfig,
display: {
...this.displayConfig,
buttonOkDisabled: this.buttonsDisabled,
buttonClearDisabled: this.buttonsDisabled,
},
sections: [
{
id: "summary",
Expand Down Expand Up @@ -320,12 +351,10 @@ export default class ClinicalAnalysisUpdate extends LitElement {
display: {
render: (panels, dataFormFilterChange, updateParams, clinicalAnalysis) => {
const handlePanelsFilterChange = e => {
// eslint-disable-next-line no-param-reassign
e.detail.value = e.detail.value
?.split(",")
const panels = (e.detail.value?.split(",") || [])
.filter(panelId => panelId)
.map(panelId => ({id: panelId}));
dataFormFilterChange(e.detail.value);
dataFormFilterChange(panels);
};
return html`
<disease-panel-filter
Expand Down
12 changes: 9 additions & 3 deletions src/webcomponents/clinical/clinical-analysis-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,16 @@ export default class ClinicalAnalysisView extends LitElement {
{
title: "Collection Method",
field: "collection.method",
defaultValue: "-",
display: {
defaultValue: "-",
},
},
{
title: "Preparation Method",
field: "processing.preparationMethod",
defaultValue: "-",
display: {
defaultValue: "-",
},
},
{
title: "Somatic",
Expand All @@ -427,7 +431,9 @@ export default class ClinicalAnalysisView extends LitElement {
{
title: "Status",
field: "status.name",
defaultValue: "-",
display: {
defaultValue: "-",
},
},
],
defaultValue: "No sample found",
Expand Down
8 changes: 5 additions & 3 deletions src/webcomponents/cohort/cohort-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ export default class CohortView extends LitElement {
title: "Annotation sets",
field: "annotationSets",
type: "custom",
defaultValue: "N/A",
display: {
render: field => html`
<annotation-set-view
.annotationSets="${field}">
</annotation-set-view>
`,
defaultValue: "N/A",
},
},
],
Expand All @@ -246,15 +246,17 @@ export default class CohortView extends LitElement {
{
title: "Somatic",
field: "somatic",
defaultValue: "false",
display: {
defaultValue: "false",
},
},
{
title: "Phenotypes",
field: "phenotypes",
type: "custom",
defaultValue: "-",
display: {
render: data => data?.length ? html`${data.map(d => d.id).join(", ")}` : "-",
defaultValue: "-",
},
},
],
Expand Down
Loading

0 comments on commit 05c2ba0

Please sign in to comment.