From ab686777fc1467d6258b88efb37faf196b021bdb Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 2 Jun 2023 16:17:34 +0300 Subject: Add dataset link that uses RDF * wqflask/wqflask/templates/dataset.html: New page. * wqflask/wqflask/templates/show_trait_details.html: Add link to GN2 datasets page. * wqflask/wqflask/views.py (get_dataset): New endpoint. Signed-off-by: Munyoki Kilyungi --- wqflask/wqflask/templates/dataset.html | 114 ++++++++++++++++++++++ wqflask/wqflask/templates/show_trait_details.html | 4 + wqflask/wqflask/views.py | 23 +++++ 3 files changed, 141 insertions(+) create mode 100644 wqflask/wqflask/templates/dataset.html diff --git a/wqflask/wqflask/templates/dataset.html b/wqflask/wqflask/templates/dataset.html new file mode 100644 index 00000000..402e4aa1 --- /dev/null +++ b/wqflask/wqflask/templates/dataset.html @@ -0,0 +1,114 @@ +{% extends "base.html" %} + +{% block css %} + +{% endblock %} + +{% block title %}Dataset: {{ name }}{% endblock %} + +{% block content %} + + + +
+ {% if metadata == {} %} +

We appreciate your interest, but unfortunately, we don't have any additional information available for: {{ name }}. If you have any other questions or need assistance with something else, please feel free to reach out to us.

+ {% else %} + + +
+ {% if metadata.summary %} +

Summary

+
{{ metadata.summary|safe }}
+ {% endif %} + + {% if metadata.experimentDesign %} +

Experiment Design

+
{{ metadata.experimentDesign|safe }}
+ {% endif %} + + {% if metadata.aboutCases %} +

About Cases

+
{{ metadata.aboutCases|safe }}
+ {% endif %} + + {% if metadata.aboutTissue %} +

About Tissue

+
{{ metadata.aboutTissue|safe }}
+ {% endif %} + + {% if metadata.aboutPlatform %} +

About Platform

+
{{ metadata.aboutPlatform|safe }}
+ {% endif %} + + {% if metadata.aboutDataProcessing %} +

About Data Processing

+
{{ metadata.aboutDataProcessing|safe }}
+ {% endif %} + + {% if metadata.notes %} +

GeneNetwork Notes

+
{{ metadata.notes|safe }}
+ {% endif %} +
+ {% endif %} + +
+ +{% endblock %} diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index cd8671bb..c745fce8 100644 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -62,6 +62,10 @@ {{ dataset.fullname }} +
+ + GN2 Link: {{ dataset.fullname }} + {% if this_trait.probe_set_specificity %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 243c79b2..895ad0cb 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1095,3 +1095,26 @@ def display_generif_page(symbol): symbol=symbol, entries=entries ) + + +@app.route("/dataset/", methods=('GET',)) +def get_dataset(name): + metadata = requests.get( + urljoin( + GN3_LOCAL_URL, + f"/api/metadata/dataset/{name}") + ).json() + float_p = "" + if any([metadata.get("summary"), + metadata.get("experimentDesign"), + metadata.get("aboutCases"), + metadata.get("aboutTissue"), + metadata.get("aboutPlatform"), + metadata.get("aboutDataProcesing"), metadata.get("notes")]): + float_p = " pull-right" + return render_template( + "dataset.html", + name=name, + metadata=metadata, + float_p=float_p + ) -- cgit v1.2.3