diff options
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/templates/probeset.html | 114 | ||||
-rw-r--r-- | gn2/wqflask/views.py | 14 |
2 files changed, 128 insertions, 0 deletions
diff --git a/gn2/wqflask/templates/probeset.html b/gn2/wqflask/templates/probeset.html new file mode 100644 index 00000000..53d7136e --- /dev/null +++ b/gn2/wqflask/templates/probeset.html @@ -0,0 +1,114 @@ +{% extends "base.html" %} + +{% block css %} +<style type="text/css"> + .page-header { + text-underline-offset: 0.5rem; + padding: 1em; + } +</style> +{% endblock %} + +{% block title %} +mRNA Expression: +{{ metadata.name or name }} +{% endblock %} + +{% block content %} + + +<div class="container"> + <h2> + mRNA Expression: + {{ metadata.name or name }} + </h2> + {% if metadata.description %} + <h3>{{ metadata.description }}</h3> + {% endif %} + <table class="table"> + {% if metadata.dataset %} + <tr> + <td><b>Group </b></td> + <td> + <a href="{{ metadata.group }}" target="_blank">{{ metadata.dataset }}</a> + </td> + </tr> + <tr> + <td><b>Dataset </b></td> + <td> + <a href="{{ metadata.group }}" target="_blank">{{ metadata.datasetName }}</a> + </td> + </tr> + <tr> + <td><b>Tissue</b></td> + <td>{{ metadata.tissue}}</td> + </tr> + {% endif %} + + {% if metadata.symbol %} + <tr> + <td><b>Gene Symbol</b></td> + <td> + {% if metadata.symbol.__class__.__name__ == 'list' %} + {% for symbol in metadata.symbol %} + {{ symbol.symbol }}; + {% endfor %} + {% else %} + {{ metadata.symbol }} + {% endif %} + </td> + </tr> + {% endif %} + + {% if metadata.alias %} + <td><b>Aliases</b></td> + <!-- XXX TODO: How do you fetch the Wikidata Alias for a given genesymbol? --> + <td>GeneneNetwork: {{ metadata.alias }}</td> + {% endif %} + + {% if metadata.location %} + <tr> + <td><b>Location</b></td> + <td> {{ metadata.location }}</td> + </tr> + {% endif %} + + {% if metadata.blatSeq %} + <tr> + <td><b>BLAT Sequence</b></td> + <td style="inline-size: fit-content; writing-mode: horizontal-tb; overflow-wrap: break-word; max-width: 70vw;"> + {{ metadata.blatSeq }} + </td> + </tr> + {% endif %} + + {% if metadata.specificity or metadata.blatScore %} + <tr> + <td><b>Target Score</b></td> + <td> + {% if metadata.specificity %} + <a href="http://gn1.genenetwork.org/blatInfo.html" target="_blank">BLAT Specificity</a>: {{ metadata.specificity }} + {% endif %} + + {% if metadata.blatScore %} +  Score: {{ metadata.blatScore }} + {% endif %} + </td> + </tr> + {% endif %} + + {% if metadata.references %} + <tr> + <td><b>Resource Links</b></td> + <td> + {% for reference in metadata.references %} + <a href="{{ reference.id }}" target="_blank" title="{{ reference.comments }}">{{ reference.name }}</a>  + {% endfor %} + </td> + + </tr> + {% endif %} + </table> +</div> + +{% endblock %} diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index d73438c2..3b324719 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -1181,6 +1181,20 @@ def get_phenotype(name, group=None): ) +@app.route("/probesets/<name>", methods=('GET',)) +def get_probeset(name): + metadata = requests.get( + urljoin( + GN3_LOCAL_URL, + f"/api/metadata/probesets/{name}") + ).json() + return render_template( + "probeset.html", + name=name, + metadata=metadata, + ) + + @app.route("/genotypes/<name>", methods=('GET',)) def get_genotype(name): metadata = requests.get( |