Skip to content

Commit

Permalink
fixed some bugs when classifying variants
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Oct 10, 2023
1 parent e5a8936 commit ce25873
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/frontend_celery/webapp/io/download_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down
11 changes: 8 additions & 3 deletions src/frontend_celery/webapp/static/js/classify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ce25873

Please sign in to comment.