From ec3c483b7feef3e36ce467ec35efd57f316031b0 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 8 Jan 2024 18:40:01 +0300 Subject: Include Entrez summary for a geneID on the ProbeSet page. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/templates/probeset.html | 7 +++++++ gn2/wqflask/views.py | 10 ++++++++++ 2 files changed, 17 insertions(+) (limited to 'gn2/wqflask') diff --git a/gn2/wqflask/templates/probeset.html b/gn2/wqflask/templates/probeset.html index ed96e6c3..327870c8 100644 --- a/gn2/wqflask/templates/probeset.html +++ b/gn2/wqflask/templates/probeset.html @@ -72,6 +72,13 @@ mRNA Expression: {% endif %} + {% if summary %} + + Summary + {{ summary }} + + {% endif %} + {% if metadata.blatSeq %} BLAT Sequence diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index cbf530c6..ec138a67 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -1190,11 +1190,21 @@ def get_probeset(name, dataset=None): GN3_LOCAL_URL, f"/api/metadata/probesets/{name}") ).json() + summary = None + if gene_id := metadata.get("geneID"): + gene_id = gene_id.get("id").split("=")[-1] + result = json.loads( + requests.get( + f"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id={gene_id}&retmode=json" + ).content + )['result'] + summary = result[gene_id]['summary'] return render_template( "probeset.html", name=name, dataset=dataset, metadata=metadata, + summary=summary, ) -- cgit v1.2.3