Skip to content

Commit

Permalink
added annotate all unannotated variants button
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Nov 30, 2023
1 parent 1f4ef88 commit 0c3eaff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/frontend_celery/webapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h4>Changelog</h4>
<li>Added automatic classification algorithm v1.0</li>
<li>Added the automatic classification result to the browse variant table & variant details page</li>
<li>Added automatic classification search</li>
<li>Added a button to the admin dashboard to annotate all variants which are missing an annotation</li>
</ul>
Bugfixes:
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ <h4>Warnings</h4>
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" title="Pressing this button requests an annotation of all aborted variants in HerediVar.">
<button type="button" class="btn btn-outline-primary reannotate_variants_button" data-bs-toggle="modal" data-bs-target="#reannotate-variants-modal" modal_text="ALL ABORTED" value="aborted">aborted variants</button>
</span>
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" title="Pressing this button requests an annotation of all variants missing an annotation variants in HerediVar.">
<button type="button" class="btn btn-outline-primary reannotate_variants_button" data-bs-toggle="modal" data-bs-target="#reannotate-variants-modal" modal_text="ALL VARIANTS MISSING AN ANNOTATION" value="unannotated">unannotated variants</button>
</span>
</div>
</form>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/frontend_celery/webapp/user/user_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from flask_paginate import Pagination
import annotation_service.main as annotation_service
from ..tasks import start_annotation_service, start_variant_import, start_import_one_variant, annotate_all_variants, abort_annotation_tasks
import random


user_blueprint = Blueprint(
Expand Down Expand Up @@ -356,10 +357,13 @@ def admin_dashboard():

if reannotate_which == 'all':
variant_ids = conn.get_all_valid_variant_ids()
#variant_ids = random.sample(variant_ids, 50)
elif reannotate_which == 'erroneous':
variant_ids = annotation_stati['error']
elif reannotate_which == 'aborted':
variant_ids = annotation_stati['aborted']
elif reannotate_which == 'unannotated':
variant_ids = annotation_stati['unannotated']

annotate_all_variants.apply_async(args=[variant_ids, selected_job_config, session['user']['user_id'], session['user']['roles']])
current_app.logger.info(session['user']['preferred_username'] + " issued a reannotation of " + reannotate_which + " variants")
Expand Down

0 comments on commit 0c3eaff

Please sign in to comment.