From f32e9fe90d0a5e5e225c5683fc838652db0fe0db Mon Sep 17 00:00:00 2001 From: js2264 Date: Fri, 16 Feb 2024 10:05:08 +0100 Subject: [PATCH] fix: typo in stats module --- hicstuff/pipeline.py | 3 ++- hicstuff/stats.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hicstuff/pipeline.py b/hicstuff/pipeline.py index e022e4e..6e49ecd 100644 --- a/hicstuff/pipeline.py +++ b/hicstuff/pipeline.py @@ -1140,7 +1140,8 @@ def _out_file(fname): # Get stats on the pipeline try: logger.info("Fetching mapping and pairing stats") - hcs.get_pipeline_stats(prefix, out_dir, log_file) + stats = hcs.get_pipeline_stats(prefix, out_dir, log_file) + logger.info(stats) except IndexError: logger.warning("IndexError. Stats not compiled.") pass diff --git a/hicstuff/stats.py b/hicstuff/stats.py index 3cce2e9..60e4780 100644 --- a/hicstuff/stats.py +++ b/hicstuff/stats.py @@ -40,7 +40,7 @@ def get_pipeline_stats(prefix, out_dir, log_file): log_lines = [line.rstrip() for line in file] # 1. Number of sequenced pairs from fastqs - fastq_pairs = [s for s in log_lines if re.search("reads found in eajch fastq file.", s)][0] + fastq_pairs = [s for s in log_lines if re.search("reads found in each fastq file.", s)][0] fastq_pairs = re.sub(".*INFO :: ", "", fastq_pairs) fastq_pairs = re.sub(" reads found in each fastq file.*", "", fastq_pairs) fastq_pairs = int(float(fastq_pairs)) @@ -151,4 +151,4 @@ def get_pipeline_stats(prefix, out_dir, log_file): stats_json_path = join(out_dir, prefix + ".stats.json") with open(stats_json_path, 'w') as json_file: json.dump(stats, json_file, indent=4) - + return(stats)