diff options
author | Munyoki Kilyungi | 2023-06-15 21:28:36 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-06-15 21:30:11 +0300 |
commit | 2b0542c47bfce7c9b6df32b002f9218883d329af (patch) | |
tree | 3dba15cc51d09425a6768cb8924cac66329af8dc | |
parent | 894c16c781d93fba08223c50a848e9bb0fbfd7ed (diff) | |
download | genenetwork2-2b0542c47bfce7c9b6df32b002f9218883d329af.tar.gz |
Add genotype page
* wqflask/wqflask/templates/genotype.html: New template.
* wqflask/wqflask/views.py (get_phenotype): New endpoint.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r-- | wqflask/wqflask/templates/genotype.html | 86 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 13 |
2 files changed, 99 insertions, 0 deletions
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 %} +<style type="text/css"> + .page-header { + text-underline-offset: 0.5rem; + padding: 1em; + } +</style> +{% endblock %} + +{% block title %}Genotype: {{ name }}{% endblock %} + +{% block content %} + +<h1 class="page-header"> + {% if metadata.name %} + <u>Genotype: {{ metadata.name }}</u> + {% else %} + {{ name }} + {% endif %} +</h1> + +<div class="container"> + <table class="table"> + {% if metadata.datasetName %} + <tr> + <td><b>Dataset: </b></td> + <td> + <a href="{{ metadata.genotypeOfDataset }}" target="_blank">{{ metadata.datasetName }}</a> + </td> + </tr> + {% endif %} + + {% if metadata.inbredSetName %} + <tr> + <td><b>Group</b></td> + <td>{{ metadata.inbredSetName }}</td> + </tr> + {% endif %} + + {% if metadata.speciesName %} + <tr> + <td><b>Species</b></td> + <td>{{ metadata.speciesName }}</td> + </tr> + {% endif %} + + {% if metadata.cM %} + <tr> + <td><b>cM</b></td> + <td>{{ metadata.cM }}</td> + </tr> + {% endif %} + + {% if metadata.mb %} + <tr> + <td><b>mb</b></td> + <td>{{ metadata.mb }}</td> + </tr> + {% endif %} + + {% if metadata.sequence %} + <tr> + <td><b>Sequence</b></td> + <td>metadata.sequence</td> + </tr> + {% endif %} + + {% if metadata.source %} + <tr> + <td><b>Source</b></td> + <td>{{ metadata.source}}</td> + </tr> + {% endif %} + + {% if metadata.markerName %} + <tr> + <td><b>Marker Name</b></td> + <td>{{ metadata.markerName}}</td> + </tr> + {% endif %} + </table> +</div> + +{% 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/<name>", 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, + ) |