Skip to content

Commit

Permalink
update documentation and re-order args
Browse files Browse the repository at this point in the history
  • Loading branch information
IoannaNika committed Dec 24, 2024
1 parent db46507 commit 6536eba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/benchmarking_scripts/evaluate_hrt_output_lumc.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def main():
recalls = [recall_wuhan, recall_omicron]
recalls = [x for x in recalls if str(x) != 'nan']
recall = round(sum(recalls)/len(recalls),3)
precision_omicron, precision_wuhan = calculate_precision(number_of_all_haplotypes_per_region = number_of_all_haplotypes_per_region,number_of_assigned_haplotypes_per_region = number_of_haplotypes_per_region)
precision_omicron, precision_wuhan = calculate_precision(number_of_assigned_haplotypes_per_region = number_of_haplotypes_per_region, number_of_all_haplotypes_per_region = number_of_all_haplotypes_per_region)
precisions = [precision_omicron, precision_wuhan]
precisions = [x for x in precisions if str(x) != 'nan']
precision = round(sum(precisions)/len(precisions),3)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def calculate_precision(number_of_assigned_haplotypes_per_region:dict, number_of
Calculates the precision for Wuhan and Omicron haplotypes. How many of the reconstructed haplotypes assigned to Wuhan and Omicron are exact matches to the true haplotypes?
Args:
number_of_exact_haplotypes_per_region: dict, number of exact haplotypes per region dictionary
number_of_haplotypes_per_region: dict, number of haplotypes per region dictionary
number_of_assigned_haplotypes_per_region: dict, number of haplotypes assigned to Wuhan or Omicron per region (not discarded)
number_of_all_haplotypes_per_region: dict, number of all reconstructed haplotypes per region
Returns:
precision_wuhan: float, precision for Wuhan haplotypes
Expand Down

0 comments on commit 6536eba

Please sign in to comment.