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-4668 - Port Patch 1.7.2 -> 1.8.1 #806

Open
wants to merge 32 commits into
base: release-2.10.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
449d9da
wc - Fixed region MoI view
gpveronica May 29, 2023
4baf7d2
wc - Added region and variant coordinates
gpveronica May 29, 2023
4bb9cc5
Merge branch 'release-2.8.x' into TASK-2562
gpveronica May 29, 2023
9489fd2
wc - Minor code clean
gpveronica May 30, 2023
4bca310
wc - Fixed condition for setting and visualising coordinates
gpveronica May 30, 2023
a34dfdd
wc - Minor code clean
gpveronica May 30, 2023
6ec7741
wc: fix displaying pedigree in clinical analysis create #TASK-4501
jmjuanes May 31, 2023
369c64c
wc - Fixed returned value when value is undefined
gpveronica May 31, 2023
40ac51f
Merge branch 'release-2.8.x' into TASK-4501
jmjuanes Jun 5, 2023
2bbfcce
wc - Fixed visibility of Cohort Stats and Population Frequencies nest…
gpveronica Jun 7, 2023
7aa1f3d
wc: Fix typo in the fullTextSearch Field message within the ClinVar s…
Rodielm Jun 7, 2023
c79c2fe
wc - Added visibility to samples column
gpveronica Jun 8, 2023
f994dbf
Increment version to 2.8.3-dev
imedina Jun 9, 2023
ca43906
wc: fix saving proband info for family type in clinical-analysis-crea…
jmjuanes Jun 14, 2023
acaa452
Merge branch 'release-2.8.x' into TASK-4030
Rodielm Jun 20, 2023
1dae74a
Merge pull request #789 from opencb/TASK-4030
halender Jun 21, 2023
53e3afd
Merge branch 'release-2.8.x' into TASK-4573
jmjuanes Jun 21, 2023
38eebc7
Merge pull request #791 from opencb/TASK-4573
jmjuanes Jun 21, 2023
112ffba
Merge branch 'release-2.8.x' into TASK-4496
gpveronica Jun 21, 2023
db0d43d
Merge pull request #790 from opencb/TASK-4496
gpveronica Jun 21, 2023
fc75ce8
wc - Changed placeholder in Regions
gpveronica Jun 22, 2023
8804b26
Merge branch 'release-2.8.x' into TASK-2562
gpveronica Jun 22, 2023
a597b92
Merge branch 'release-2.8.x' into TASK-4501
jmjuanes Jun 22, 2023
8ab2e65
Merge pull request #786 from opencb/TASK-4501
jmjuanes Jun 22, 2023
03e96f1
Merge branch 'release-2.8.x' into TASK-2562
gpveronica Jun 23, 2023
1f702d2
Merge pull request #787 from opencb/TASK-2562
gpveronica Jun 23, 2023
b8b525e
Prepare release 2.8.3
jmjuanes Jun 26, 2023
a200ebf
Merge tag 'v2.8.3' into release-2.9.x
juanfeSanahuja Jun 27, 2023
1b63df5
2.9.2-dev
juanfeSanahuja Jun 27, 2023
ab75d43
Prepare release 2.9.2
jmjuanes Jul 25, 2023
45b6d3a
Prepare Port Patch 1.7.2 -> 1.8.1 #TASK-4668
juanfeSanahuja Aug 1, 2023
df0bf33
Merge branch 'release-2.10.x' into TASK-4668
juanfeSanahuja Aug 1, 2023
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
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
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
86 changes: 72 additions & 14 deletions src/webcomponents/disease-panel/disease-panel-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default class DiseasePanelCreate extends LitElement {
const params = {
exclude: "transcripts,annotation",
};
this.opencgaSession.cellbaseClient.getGeneClient(gene.name, "info", params)
this.opencgaSession.cellbaseClient
.getGeneClient(gene.name, "info", params)
.then(res => {
const g = res.responses[0].results[0];
gene.id = g.id;
Expand All @@ -106,6 +107,46 @@ export default class DiseasePanelCreate extends LitElement {
}
}
}
// Set the region coordinates if needed: location, assembly, and source
if (e.detail?.data?.regions?.length > 0) {
for (const region of e.detail.data.regions) {
if (region.id) {
if (region.id !== region.coordinates?.[0]?.location) {
region.coordinates = [
{
location: region.id,
assembly: this.opencgaSession?.project?.organism?.assembly || "",
// source: region.source || "",
}
];
}
} else {
if (region.coordinates) {
region.coordinates = null;
}
}
}
}
// Set the variant coordinates if needed: location, assembly, and source
if (e.detail?.data?.variants?.length > 0) {
for (const variant of e.detail.data.variants) {
if (variant.id) {
if (variant.id !== variant.coordinates?.[0]?.location) {
variant.coordinates = [
{
location: variant.id,
assembly: this.opencgaSession?.project?.organism?.assembly || "",
// source: region.source || "",
}
];
}
} else {
if (variant.coordinates) {
variant.coordinates = null;
}
}
}
}
this.diseasePanel = {...e.detail.data}; // force to refresh the object-list
this.requestUpdate();
}
Expand Down Expand Up @@ -297,8 +338,11 @@ export default class DiseasePanelCreate extends LitElement {
view: gene => html`
<div>
<div>${gene?.name} (<a href="${BioinfoUtils.getGeneLink(gene?.id)}" target="_blank">${gene?.id}</a>)</div>
<div style="margin: 5px 0">MoI: ${gene?.modeOfInheritance || "NA"} (Confidence: ${gene.confidence || "NA"})</div>
<div class="help-block">${gene.coordinates?.[0]?.location}</div>
<div style="margin: 5px 0">MoI: ${gene?.modesOfInheritance?.join(", ") || "-"} (Confidence: ${gene.confidence || "NA"})</div>
<div class="help-block">
Location: ${gene.coordinates?.[0]?.location || "-"},
Assembly: ${gene.coordinates?.[0]?.assembly || "-"},
</div>
</div>
`,
},
Expand Down Expand Up @@ -326,7 +370,7 @@ export default class DiseasePanelCreate extends LitElement {
field: "genes[].modesOfInheritance",
type: "select",
multiple: true,
save: value => value.split(","), // Array when select and multiple
save: value => value?.split(",") || [], // Array when select and multiple
allowedValues: MODE_OF_INHERITANCE,
display: {
placeholder: "Select a mode of inheritance..."
Expand All @@ -346,7 +390,7 @@ export default class DiseasePanelCreate extends LitElement {
field: "genes[].cancer.roles",
type: "select",
multiple: true,
save: value => value.split(","), // Array when select and multiple
save: value => value?.split(",") || [], // Array when select and multiple
allowedValues: ROLE_IN_CANCER,
display: {
placeholder: "Select role in cancer..."
Expand All @@ -366,25 +410,32 @@ export default class DiseasePanelCreate extends LitElement {
display: {
style: "border-left: 2px solid #0c2f4c; padding-left: 12px; margin-bottom:24px",
collapsedUpdate: true,
view: region => html`
<div>${region.id} - ${region?.modeOfInheritance || "-"}</div>
view: region => html `
<div>
<div>${region?.id}</div>
<div style="margin: 5px 0">MoI: ${region?.modesOfInheritance?.join(", ") || "-"} (Confidence: ${region?.confidence || "NA"})</div>
<div class="help-block">
Location: ${region.coordinates?.[0]?.location || "-"},
Assembly: ${region.coordinates?.[0]?.assembly || "-"},
</div>
</div>
`,
},
elements: [
{
title: "Region ID",
title: "Region ID/Location",
field: "regions[].id",
type: "input-text",
display: {
placeholder: "Add region...",
placeholder: "Add a region ID/Location (e.g. 1:10100-10110)...",
}
},
{
title: "Mode of Inheritance",
field: "regions[].modesOfInheritance",
type: "select",
multiple: true,
save: value => value.split(","), // Array when select and multiple
save: value => value?.split(",") || [], // Array when select and multiple
allowedValues: MODE_OF_INHERITANCE,
display: {
placeholder: "Select a mode of inheritance..."
Expand Down Expand Up @@ -414,24 +465,31 @@ export default class DiseasePanelCreate extends LitElement {
style: "border-left: 2px solid #0c2f4c; padding-left: 12px; margin-bottom:24px",
collapsedUpdate: true,
view: variant => html`
<div>${variant.id} - ${variant?.modeOfInheritance || "-"}</div>
<div>
<div>${variant.id}</div>
<div style="margin: 5px 0">MoI: ${variant?.modesOfInheritance?.join(", ") || "-"}</div>
<div class="help-block">
Location: ${variant.coordinates?.[0]?.location || "-"},
Assembly: ${variant.coordinates?.[0]?.assembly || "-"},
</div>
</div>
`,
},
elements: [
{
title: "Variant ID",
title: "Variant ID/Location",
field: "variants[].id",
type: "input-text",
display: {
placeholder: "Add variant ID...",
placeholder: "Add the variant ID/Location...",
}
},
{
title: "Mode of Inheritance",
field: "variants[].modesOfInheritance",
type: "select",
multiple: true,
save: value => value.split(","), // Array when select and multiple
save: value => value?.split(",") || [], // Array when select and multiple
allowedValues: MODE_OF_INHERITANCE,
display: {
placeholder: "Select a mode of inheritance..."
Expand Down
35 changes: 22 additions & 13 deletions src/webcomponents/disease-panel/disease-panel-region-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,19 @@ export default class DiseasePanelRegionView extends LitElement {
halign: this._config.header.horizontalAlign,
},
{
id: "modeOfInheritance",
id: "modesOfInheritance",
title: "Mode of Inheritance",
field: "modeOfInheritance",
field: "modesOfInheritance",
formatter: (value, row) => {
const modesOfInheritanceContent = this.generateList(row.modesOfInheritance, "");
return String.raw `
${modesOfInheritanceContent ? String.raw `
<ul>
${modesOfInheritanceContent}
</ul>` : "-"
}
`;
},
},
{
id: "confidence",
Expand Down Expand Up @@ -190,17 +200,16 @@ export default class DiseasePanelRegionView extends LitElement {

render() {
return html`
${this._config.showToolbar ?
html`
<opencb-grid-toolbar
.config="${this.toolbarConfig}"
.query="${this.query}"
.opencgaSession="${this.opencgaSession}"
@columnChange="${this.onColumnChange}"
@download="${this.onDownload}"
@export="${this.onDownload}">
</opencb-grid-toolbar>` : nothing
}
${this._config.showToolbar ? html`
<opencb-grid-toolbar
.config="${this.toolbarConfig}"
.query="${this.query}"
.opencgaSession="${this.opencgaSession}"
@columnChange="${this.onColumnChange}"
@download="${this.onDownload}"
@export="${this.onDownload}">
</opencb-grid-toolbar>
` : nothing}

<div id="${this._prefix}GridTableDiv" class="force-overflow">
<table id="${this._prefix}GenePanelBrowserGrid"></table>
Expand Down
Loading