Skip to content
Snippets Groups Projects
Commit 40130b27 authored by Vermaat's avatar Vermaat
Browse files

Use Jinja2 for description extractor

parent d4379004
No related branches found
No related tags found
No related merge requests found
<html>
<head>
<link rel="stylesheet"
type="text/css"
href="static/css/style.css">
<title></title>
</head>
<body>
<div metal:define-macro="content">
<center>
<h3>Variant Description Extractor</h3>
</center>
<div> <!-- Remove this div later. -->
<b style="color: red">Note that this is an experimental service.</b>
<br>
<br>
Extract the HGVS variant description from a reference sequence and an
observed sequence. For now, we require the user to fill in two
sequences. After the testing phase, we plan to use the underlying
algorithm for:
<ul>
<li>
Disambiguation in the name checker. This will enable full support
for complex variants.
</li>
<li>
Comparison of two reference sequences. Useful for migrating a
variant description to an other reference sequence.
</li>
<li>
Implementation of a Reference Sequence Editor.
</li>
</ul>
<br>
</div>
<div style="border: 1px solid grey; background-color: aliceblue; padding: 20px;">
<form action = "" method = "post">
Please supply a reference sequence and an observed sequence.<br>
<br>
<div style="border: 1px solid grey; padding: 20px">
<b>Reference sequence:</b><br>
<br>
Example: <tt>ATGATGATCAGATACAGTGTGATACAGGTAGTTAGACAA</tt><br>
<br>
<input
type = "text"
name = "referenceSeq"
tal:attributes = "value lastReferenceSeq"
style = "width:100%"
><br>
<input type="button" value="Clear field" onclick="clearField(this.form, 'referenceSeq');">
</div>
<br>
<div style="border: 1px solid grey; padding: 20px">
<b>Observed sequence:</b><br>
<br>
Example: <tt>ATGATTTGATCAGATACATGTGATACCGGTAGTTAGGACAA</tt><br>
<br>
<input
type = "text"
name = "variantSeq"
tal:attributes = "value lastVariantSeq"
style = "width:100%"
><br>
<input type="button" value="Clear field" onclick="clearField(this.form, 'variantSeq');">
</div>
<br>
<input type="submit" value="Submit">
<a href="https://humgenprojects.lumc.nl/trac/mutalyzer/wiki/DescriptionExtractor">Help</a>
</form>
</div>
<div tal:condition = "description">
<br>
<h3>Variant Description Extractor results:</h3>
<div class="messages">
<p tal:repeat = "m messages" tal:content = "m/description"
tal:attributes = "class m/class; title string:${m/level} (origin: ${m/origin})"></p>
<p tal:content = "summary"></p>
</div>
<div tal:condition = "not:errors">
<br>
<b>Genomic description:</b><br>
<br>
<tt>g.<div tal:replace = "description"></div></tt>
<br>
<br>
<br>
<b>Overview of the raw variants:</b><br>
<br>
<table class = "laTable">
<tr>
<td>Start</td>
<td>End</td>
<td>Type</td>
<td>Deleted</td>
<td>Inserted</td>
<td>Shift</td>
<td>Description</td>
</tr>
<tr tal:repeat = "i visualisation">
<td tal:repeat = "j i" tal:content = "j"></td>
</tr>
</table>
</div>
</div> <!-- description -->
<br>
</div>
</body>
</html>
{% extends "base.html" %}
{% set active_page = "description-extractor" %}
{% set page_title = "Variant Description Extractor" %}
{% block content %}
<p>
<b style="color: red">Note that this is an experimental service.</b>
</p>
<p>
Extract the HGVS variant description from a reference sequence and an
observed sequence. For now, we require the user to fill in two
sequences. After the testing phase, we plan to use the underlying
algorithm for:
</p>
<ul>
<li>
Disambiguation in the name checker. This will enable full support
for complex variants.
</li>
<li>
Comparison of two reference sequences. Useful for migrating a
variant description to an other reference sequence.
</li>
<li>
Implementation of a Reference Sequence Editor.
</li>
</ul>
<div style="border: 1px solid grey; background-color: aliceblue; padding: 20px;">
<form action = "" method = "post">
Please supply a reference sequence and an observed sequence.<br>
<br>
<div style="border: 1px solid grey; padding: 20px">
<b>Reference sequence:</b><br>
<br>
Example: <tt>ATGATGATCAGATACAGTGTGATACAGGTAGTTAGACAA</tt><br>
<br>
<input
type = "text"
name = "referenceSeq"
value = "{{ lastReferenceSeq|e }}"
style = "width:100%"
><br>
<input type="button" value="Clear field" onclick="clearField(this.form, 'referenceSeq');">
</div>
<br>
<div style="border: 1px solid grey; padding: 20px">
<b>Observed sequence:</b><br>
<br>
Example: <tt>ATGATTTGATCAGATACATGTGATACCGGTAGTTAGGACAA</tt><br>
<br>
<input
type = "text"
name = "variantSeq"
value = "{{ lastVariantSeq|e }}"
style = "width:100%"
><br>
<input type="button" value="Clear field" onclick="clearField(this.form, 'variantSeq');">
</div>
<br>
<input type="submit" value="Submit">
<a href="https://humgenprojects.lumc.nl/trac/mutalyzer/wiki/DescriptionExtractor">Help</a>
</form>
</div>
{% if description is defined %}
<h3>Variant Description Extractor results:</h3>
<div class="messages">
{% for m in messages %}
<p class="{{ m.class|e }}" title="{{ m.level|e }} (origin: {{ m.origin|e }})">{{ m.description|e }}</p>
{% endfor %}
<p>{{ summary|e }}</p>
</div>
{% if not errors %}
<p>
<b>Genomic description:</b>
</p>
<p>
<tt>g.{{ description|e }}</tt>
</p>
<p>
<b>Overview of the raw variants:</b>
</p>
<table class = "laTable">
<tr>
<td>Start</td>
<td>End</td>
<td>Type</td>
<td>Deleted</td>
<td>Inserted</td>
<td>Shift</td>
<td>Description</td>
</tr>
{% for i in visualisation %}
<tr>
{% for j in i %}
<td>{{ j|e }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% endif %}
{% endif %}
{% endblock content %}
......@@ -33,7 +33,7 @@
<br>
</div>
<br>
{% if variant %}
{% if variant is defined %}
<h3>Variant syntax checker results:</h3>
{% if parseError %}
<div class="messages">
......
......@@ -459,7 +459,7 @@ class SyntaxCheck:
counter = Db.Counter()
counter.increment('syntaxcheck', 'website')
variant = i.variant
variant = i.variant or ''
if variant.find(',') >= 0:
output.addMessage(__file__, 2, "WCOMMASYNTAX",
"Comma's are not allowed in the syntax, autofixed.")
......@@ -962,14 +962,14 @@ class DescriptionExtractor:
output = Output(__file__)
IP = web.ctx["ip"]
if not (referenceSeq and variantSeq):
return render.description_extractor()
args = {
'lastReferenceSeq' : referenceSeq,
'lastVariantSeq' : variantSeq
}
if not (referenceSeq and variantSeq):
return render_.descriptionExtract(args)
output.addMessage(__file__, -1, 'INFO',
"Received Description Extract request from %s" % IP)
......@@ -998,14 +998,13 @@ class DescriptionExtractor:
'visualisation' : visualisation,
'errors' : errors,
'summary' : summary,
'messages' : map(util.message_info,
output.getMessages())
'messages' : map(util.message_info, output.getMessages())
}
output.addMessage(__file__, -1, 'INFO',
"Finished Description Extract request")
return render_.descriptionExtract(args)
return render.description_extractor(args)
#descriptionExtract
#DescriptionExtract
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment