From 2b0542c47bfce7c9b6df32b002f9218883d329af Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 15 Jun 2023 21:28:36 +0300 Subject: Add genotype page * wqflask/wqflask/templates/genotype.html: New template. * wqflask/wqflask/views.py (get_phenotype): New endpoint. Signed-off-by: Munyoki Kilyungi --- wqflask/wqflask/templates/genotype.html | 86 +++++++++++++++++++++++++++++++++ wqflask/wqflask/views.py | 13 +++++ 2 files changed, 99 insertions(+) create mode 100644 wqflask/wqflask/templates/genotype.html (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/genotype.html b/wqflask/wqflask/templates/genotype.html new file mode 100644 index 00000000..788586a3 --- /dev/null +++ b/wqflask/wqflask/templates/genotype.html @@ -0,0 +1,86 @@ +{% extends "base.html" %} + +{% block css %} + +{% endblock %} + +{% block title %}Genotype: {{ name }}{% endblock %} + +{% block content %} + +

+ {% if metadata.name %} + Genotype: {{ metadata.name }} + {% else %} + {{ name }} + {% endif %} +

+ +
+ + {% if metadata.datasetName %} + + + + + {% endif %} + + {% if metadata.inbredSetName %} + + + + + {% endif %} + + {% if metadata.speciesName %} + + + + + {% endif %} + + {% if metadata.cM %} + + + + + {% endif %} + + {% if metadata.mb %} + + + + + {% endif %} + + {% if metadata.sequence %} + + + + + {% endif %} + + {% if metadata.source %} + + + + + {% endif %} + + {% if metadata.markerName %} + + + + + {% endif %} +
Dataset: + {{ metadata.datasetName }} +
Group{{ metadata.inbredSetName }}
Species{{ metadata.speciesName }}
cM{{ metadata.cM }}
mb{{ metadata.mb }}
Sequencemetadata.sequence
Source{{ metadata.source}}
Marker Name{{ metadata.markerName}}
+
+ +{% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 8ac116be..e7a32d34 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1144,3 +1144,16 @@ def get_phenotype(name): "phenotype.html", metadata=metadata, ) + + +@app.route("/genotype/", methods=('GET',)) +def get_genotype(name): + metadata = requests.get( + urljoin( + GN3_LOCAL_URL, + f"/api/metadata/genotype/{name}") + ).json() + return render_template( + "genotype.html", + metadata=metadata, + ) -- cgit v1.2.3