aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-01-08 18:40:01 +0300
committerBonfaceKilz2024-01-08 19:23:48 +0300
commitec3c483b7feef3e36ce467ec35efd57f316031b0 (patch)
tree671b6c3995dbe5571cd061b81917af951f309069
parent900457449376dd6217d414390f52c2b4838696b0 (diff)
downloadgenenetwork2-ec3c483b7feef3e36ce467ec35efd57f316031b0.tar.gz
Include Entrez summary for a geneID on the ProbeSet page.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--gn2/wqflask/templates/probeset.html7
-rw-r--r--gn2/wqflask/views.py10
2 files changed, 17 insertions, 0 deletions
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:
</tr>
{% endif %}
+ {% if summary %}
+ <tr>
+ <td><b>Summary</b></td>
+ <td>{{ summary }}</td>
+ </tr>
+ {% endif %}
+
{% if metadata.blatSeq %}
<tr>
<td><b>BLAT Sequence</b></td>
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,
)