Skip to content

Commit

Permalink
fixed variant import summary from variant import history
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Jul 22, 2024
1 parent 69ef6be commit 7c0669b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
42 changes: 21 additions & 21 deletions src/frontend_celery/webapp/download/download_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,27 +306,27 @@ def assay_report(assay_id):
########################################
# these can be used for debugging

#@download_blueprint.route('/download/annotation_errors')
#@require_permission(['admin_resources'])
#def annotation_errors():
# conn = get_connection()
#
# download_file_name = "annotation_errors_" + functions.get_today() + ".tsv"
#
# annotation_stati, errors, warnings, total_num_variants = conn.get_annotation_statistics(exclude_sv=True)
#
# helper = io.StringIO()
# helper.write("#" + "\t".join(["chrom", "pos", "ref", "alt", "error_msg"]) + '\n')
# for variant_id in errors:
# variant = conn.get_variant(variant_id)
# new_line = "\t".join([variant.chrom, str(variant.pos), variant.ref, variant.alt, errors[variant_id]])
# helper.write(new_line + "\n")
#
# buffer = io.BytesIO()
# buffer.write(helper.getvalue().encode())
# buffer.seek(0)
#
# return send_file(buffer, as_attachment=True, download_name=download_file_name, mimetype="text")
@download_blueprint.route('/download/annotation_errors')
@require_permission(['admin_resources'])
def annotation_errors():
conn = get_connection()

download_file_name = "annotation_errors_" + functions.get_today() + ".tsv"

annotation_stati, errors, warnings, total_num_variants = conn.get_annotation_statistics(exclude_sv=True)

helper = io.StringIO()
helper.write("#" + "\t".join(["chrom", "pos", "ref", "alt", "error_msg"]) + '\n')
for variant_id in errors:
variant = conn.get_variant(variant_id)
new_line = "\t".join([variant.chrom, str(variant.pos), variant.ref, variant.alt, errors[variant_id]])
helper.write(new_line + "\n")

buffer = io.BytesIO()
buffer.write(helper.getvalue().encode())
buffer.seek(0)

return send_file(buffer, as_attachment=True, download_name=download_file_name, mimetype="text")


#@download_blueprint.route('/recalculate_automatic_classes')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ function create_td_form(text_content, url, params) {
new_input.classList.add("visually_hidden")
form.appendChild(new_input)

var tmp = document.createElement('div')
tmp.textContent = params['import_variant_queue_id']
form.appendChild(tmp)
//var tmp = document.createElement('div')
//tmp.textContent = params['import_variant_queue_id']
//form.appendChild(tmp)

var submit_button = document.createElement('button')
submit_button.classList.add("btn")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="bst"> {% block title %} Variant publish history {% endblock %} </h1>
</thead>
<tbody id="variantTableBody">
{% for entry in publish_queue_requests %}
<tr class="clickable" data-href="{{ url_for('user.variant_publish_summary', publish_queue_id = entry[0]) }}">
<tr class="clickable" data-href="{{ url_for('user.variant_publish_summary', publish_queue_id = entry.id) }}">
<td>{{ entry.user.full_name }}</td>
<td>{{ entry.requested_at }}</td>
<td>{{ entry.finished_at }}</td>
Expand Down

0 comments on commit 7c0669b

Please sign in to comment.