From ce25873044f590fb1e00190895cc4e153b10096c Mon Sep 17 00:00:00 2001 From: MarvinDo Date: Tue, 10 Oct 2023 16:28:05 +0200 Subject: [PATCH] fixed some bugs when classifying variants --- src/frontend_celery/webapp/io/download_routes.py | 8 ++++---- src/frontend_celery/webapp/static/js/classify.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/frontend_celery/webapp/io/download_routes.py b/src/frontend_celery/webapp/io/download_routes.py index 50bc9b71..61f49d8f 100644 --- a/src/frontend_celery/webapp/io/download_routes.py +++ b/src/frontend_celery/webapp/io/download_routes.py @@ -320,7 +320,7 @@ def get_possible_classes_enigma_brca2(class_counts): if class_counts['ps'] >= 3: # 2 possible_classes.add(5) if class_counts['ps'] == 2: # 3 - if class_counts['pm'] >= 1 or class_counts['pp'] <= 2: + if class_counts['pm'] >= 1 or class_counts['pp'] >= 2: possible_classes.add(5) if class_counts['ps'] == 1: # 3 if class_counts['pm'] >= 3 or (class_counts['pm'] == 2 and class_counts['pp'] >= 2) or (class_counts['pm'] == 1 and class_counts['pp'] >= 4): @@ -381,7 +381,7 @@ def get_possible_classes_enigma_brca1(class_counts): if class_counts['ps'] >= 3: # 2 possible_classes.add(5) if class_counts['ps'] == 2: # 3 - if class_counts['pm'] >= 1 or class_counts['pp'] <= 2: + if class_counts['pm'] >= 1 or class_counts['pp'] >= 2: possible_classes.add(5) if class_counts['ps'] == 1: # 3 if class_counts['pm'] >= 3 or (class_counts['pm'] == 2 and class_counts['pp'] >= 2) or (class_counts['pm'] == 1 and class_counts['pp'] >= 4): @@ -425,8 +425,8 @@ def get_possible_classes_enigma_brca1(class_counts): if class_counts['bm'] == 1 and class_counts['bp'] >= 1: # 1 possible_classes.add(2) - #print(class_counts) - #print(possible_classes) + print(class_counts) + print(possible_classes) return possible_classes diff --git a/src/frontend_celery/webapp/static/js/classify.js b/src/frontend_celery/webapp/static/js/classify.js index c1ac89e8..ec556cdf 100644 --- a/src/frontend_celery/webapp/static/js/classify.js +++ b/src/frontend_celery/webapp/static/js/classify.js @@ -150,6 +150,10 @@ function submit_classification() { function preselect_literature() { // THIS FUNCTION IS UGLY --> maybe REWORK + if (classification_type === 'consensus') { // remove all rows in add from user literature selection + document.getElementById('user_text_passages_for_copy').innerHTML = "" + update_default_caption(document.getElementById('userSelectedLiterature')) + } for (var user_id in previous_classifications) { if (user_id != -1) { // skip imaginary consensus classification user id var all_user_classifications = previous_classifications[user_id] @@ -1175,10 +1179,11 @@ function enable_disable_buttons(criterium_ids, is_disable) { } function update_classification_preview() { - if (scheme_type == 'acmg') { - var selected_criteria = get_checked_criteria_strengths(); // this is an array of criteria strengths - } else { + if (scheme_type == 'task-force') { var selected_criteria = get_currently_checked_criteria(); // this is an array of critera ids + } else { + var selected_criteria = get_checked_criteria_strengths(); // this is an array of criteria strengths + } selected_criteria = selected_criteria.join('+') fetch('/calculate_class/'+scheme_type+'/'+selected_criteria).then(function (response) {