From 7df45fb25bd760959120123d92fed1345f44e7d0 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 14 Apr 2023 18:35:52 +0300 Subject: Add genewiki page * wqflask/wqflask/templates/generif.html: New template. * wqflask/wqflask/views.py (display_diffs_users): New route. Signed-off-by: Munyoki Kilyungi --- wqflask/wqflask/templates/generif.html | 96 ++++++++++++++++++++++++++++++++++ wqflask/wqflask/views.py | 16 ++++++ 2 files changed, 112 insertions(+) create mode 100644 wqflask/wqflask/templates/generif.html (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/generif.html b/wqflask/wqflask/templates/generif.html new file mode 100644 index 00000000..affcbbed --- /dev/null +++ b/wqflask/wqflask/templates/generif.html @@ -0,0 +1,96 @@ +{% extends "base.html" %} + +{% block title %} +GeneWiki Entry for {{ symbol }} +{% endblock %} + +{% block css %} + + +{% endblock %} +{% block content %} + + +
+

GeneWiki For {{ symbol }}

+

GeneWiki enables you to enrich the annotation of genes and transcripts.

+ +

+ GeneNetwork + + {{ entries.gn_entries|length if entries.gn_entries[0] else 0 }} + : +

+ {% if entries.gn_entries[0] %} + + + {% else %} + +

There are no GeneNetwork entries for {{ symbol }}.

+ + {% endif %} + +

+ GeneRIF from NCBI + + {{ entries.ncbi_entries|length if entries.ncbi_entries[0] else 0 }} + : +

+ {% if entries.ncbi_entries[0] %} +
    + {% for entry in entries.ncbi_entries %} +
  1. + {{ entry.entry.value }} + ({{ entry["speciesBinomialName"]["value"] }}) + {% if entry.PubMedId.value != "" %} + {% set pmids = entry.PubMedId.value.split(",") %} + (PubMed: {% for id in pmids %} {{ id }}{% endfor %}) + {{ entry.createdOn.value }} + {% endif %} +
  2. + {% endfor %} +
+ {% else %} +

There are no NCBI entries for {{ symbol }}.

+ {% endif %} +
+{% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 69576cc4..24426539 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1048,3 +1048,19 @@ def display_diffs_users(): files) return render_template("display_files_user.html", files=files) + + +@app.route("/genewiki/") +def display_generif_page(symbol): + """Fetch GeneRIF metadata from GN3 and display it""" + entries = requests.get( + urljoin( + GN3_LOCAL_URL, + f"/api/metadata/genewiki/{symbol}" + ) + ).json() + return render_template( + "generif.html", + symbol=symbol, + entries=entries + ) -- cgit v1.2.3