Skip to content

Commit

Permalink
Merge branch 'release-2.12.x' into TASK-5797
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Mar 18, 2024
2 parents b64b84f + a66a67c commit 0ad1aa4
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 251 deletions.
8 changes: 0 additions & 8 deletions src/webcomponents/variant/custom/steiner-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,6 @@ class SteinerReport extends LitElement {
}
}

onFieldChange() {
this._data = {
...this._data,
};
this.requestUpdate();
}

onSignatureChange(event, type) {
this.selectedSignatures[type] = event.detail.value;
this._config = {
Expand Down Expand Up @@ -365,7 +358,6 @@ class SteinerReport extends LitElement {
<data-form
.data="${this._data}"
.config="${this._config}"
@fieldChange="${e => this.onFieldChange(e)}"
@clear="${this.onClear}"
@submit="${this.onRun}">
</data-form>
Expand Down
29 changes: 28 additions & 1 deletion src/webcomponents/variant/variant-browser-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,34 @@ export default class VariantBrowserGrid extends LitElement {
// summary: !this.query.sample && !this.query.family,
...this.query
};

// TASK-5791: Temporary SNP ID Search fix
if (this.query.xref) {
const snpIds = this.query.xref.split(",").filter(xref => xref.startsWith("rs"));
if (snpIds.length > 0) {
const snpRegion = [];
const request = new XMLHttpRequest();
for (const snpId of snpIds) {
const url = `https://rest.ensembl.org/variation/human/${snpId}?content-type=application/json`;

request.onload = event => {
if (request.status === 200) {
const restObject = JSON.parse(event.currentTarget.response);
const mapping = restObject.mappings?.find(m => m.assembly_name === "GRCh38");
snpRegion.push(mapping.seq_region_name + ":" + mapping.start);
}
};
request.open("GET", url, false);
request.send();
}
if (this.filters.region) {
this.filters.region += "," + snpRegion.join(",");
} else {
this.filters.region = snpRegion.join(",");
}
}
}

this.opencgaSession.opencgaClient.variants().query(this.filters)
.then(res => {
// FIXME A quick temporary fix -> TASK-947
Expand Down Expand Up @@ -1060,7 +1088,6 @@ export default class VariantBrowserGrid extends LitElement {
<div data-cy="vb-grid">
<table id="${this.gridId}"></table>
</div>
`;
}

Expand Down
Loading

0 comments on commit 0ad1aa4

Please sign in to comment.