From 012f67f0b3303362d3bde5618022ce5503fb6ddf Mon Sep 17 00:00:00 2001 From: imedina Date: Fri, 8 Mar 2024 01:55:03 +0000 Subject: [PATCH 1/3] Add temporary fix to search by SNP ID --- .../variant/variant-browser-grid.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/webcomponents/variant/variant-browser-grid.js b/src/webcomponents/variant/variant-browser-grid.js index 5efa87051..9ff1d9904 100644 --- a/src/webcomponents/variant/variant-browser-grid.js +++ b/src/webcomponents/variant/variant-browser-grid.js @@ -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 From d931819f69ab191ef9323275e65c691360544a32 Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Sat, 9 Mar 2024 11:45:33 +0100 Subject: [PATCH 2/3] 2.12.3-1-dev --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 478880079..082d1fba9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsorolla", - "version": "2.12.3", + "version": "2.12.3-1-dev", "description": "JSorolla is a JavaScript bioinformatic library for data analysis and genomic visualization", "repository": { "type": "git", From bf48a44d913c4e57e4b5b95535875a57a2d0df15 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 13 Mar 2024 13:10:11 +0100 Subject: [PATCH 3/3] Prepare release v2.12.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 082d1fba9..72e739385 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsorolla", - "version": "2.12.3-1-dev", + "version": "2.12.3-1", "description": "JSorolla is a JavaScript bioinformatic library for data analysis and genomic visualization", "repository": { "type": "git",