Skip to content

Commit

Permalink
feat: round mean, update debug message (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Aug 21, 2023
1 parent db2480d commit 9d4e66e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions htsinfer/get_library_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def fastq_get_stats_read_length(fastq: Path) -> Tuple[
FileProblem: Could not process FASTQ file.
"""
LOGGER.debug(
"Extracting minimum and maximum read length in: %s", {fastq})
"Extracting read length statistics in: %s", {fastq})
min_len: int = 1000000
max_len: int = 0
total_lengths: int = 0
Expand All @@ -111,12 +111,12 @@ def fastq_get_stats_read_length(fastq: Path) -> Tuple[
f"Failed to process FASTQ file: {fastq}"
) from exc

mean_len = total_lengths / len(lengths)
mean_len = round(total_lengths / len(lengths), 2)
median_len = int(statistics.median(lengths))
mode_len = length_counter.most_common(1)[0][0]

LOGGER.debug(
"Extracted minimum and maximum read length: %s",
"Extracted read length statistics: %s",
{(min_len, max_len, mean_len, median_len, mode_len)}
)
return min_len, max_len, mean_len, median_len, mode_len

0 comments on commit 9d4e66e

Please sign in to comment.