Skip to content

Commit

Permalink
fix: typo in stats module
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Feb 16, 2024
1 parent 3ebe602 commit f32e9fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion hicstuff/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hicstuff/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)

0 comments on commit f32e9fe

Please sign in to comment.