From 1d96296053bbe5385f24e79287d0626922d3a140 Mon Sep 17 00:00:00 2001 From: Alan Collins Date: Tue, 17 Dec 2024 15:00:54 -0500 Subject: [PATCH] improve low coverage reporting accuracy. --- el_gato/el_gato.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/el_gato/el_gato.py b/el_gato/el_gato.py index 8b7ab00..40baa4d 100644 --- a/el_gato/el_gato.py +++ b/el_gato/el_gato.py @@ -1196,7 +1196,7 @@ def process_reads(contig_dict: dict, read_info_dict: dict, ref: Ref, outdir: str loci = ['flaA', 'pilE', 'asd', 'mip', 'mompS', 'proA', 'neuA'] for line in result.strip().split('\n')[1:]: - gene, _, _, cov, depth, _, _ = line.split() + gene, _, covbases, cov, depth, _, _ = line.split() cov = float(cov) depth = float(depth) cov_results[gene] = {"Percent_covered": str(cov), "Mean_depth": str(depth)} @@ -1210,10 +1210,10 @@ def process_reads(contig_dict: dict, read_info_dict: dict, ref: Ref, outdir: str a.allele_id = '-' alleles[gene] = [a] cov_results[gene] = { - "Percent_covered": "0", - "Mean_depth": "0", + "Percent_covered": str(cov), + "Mean_depth": str(depth), "Min_depth": 0, - "Num_below_min_depth": ref.REF_POSITIONS[gene]["end_pos"] - ref.REF_POSITIONS[gene]["start_pos"] + "Num_below_min_depth": (ref.REF_POSITIONS[gene]["end_pos"] - ref.REF_POSITIONS[gene]["start_pos"]) - int(covbases) } del ref.REF_POSITIONS[gene]