From fbc30a5726114e7c0641ddc9fd3f84815faa0332 Mon Sep 17 00:00:00 2001 From: Cole Lyman Date: Thu, 25 Jul 2024 10:13:19 -0600 Subject: [PATCH] Fix divide by zero error when there are no shared amplicons in Compare --- CRISPResso2/CRISPRessoCompareCORE.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRISPResso2/CRISPRessoCompareCORE.py b/CRISPResso2/CRISPRessoCompareCORE.py index d448b1e0..7d797024 100644 --- a/CRISPResso2/CRISPRessoCompareCORE.py +++ b/CRISPResso2/CRISPRessoCompareCORE.py @@ -195,7 +195,8 @@ def get_plot_title_with_ref_name(plotTitle, refName): sig_counts = {} # number of bp significantly modified (bonferonni corrected fisher pvalue) sig_counts_quant_window = {} percent_complete_start, percent_complete_end = 10, 90 - percent_complete_step = (percent_complete_end - percent_complete_start) / len(amplicon_names_in_both) + if amplicon_names_in_both: + percent_complete_step = (percent_complete_end - percent_complete_start) / len(amplicon_names_in_both) for amplicon_name in amplicon_names_in_both: percent_complete = percent_complete_start + percent_complete_step * amplicon_names_in_both.index(amplicon_name) info('Loading data for amplicon %s' % amplicon_name, {'percent_complete': percent_complete})