From 930b74196b8cb7a5276e69392215e3678198a8d9 Mon Sep 17 00:00:00 2001 From: balajtimate <51365402+balajtimate@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:54:48 +0100 Subject: [PATCH] fix: correctly infer read stats from second mate (#152) * fix: statistics from second mate #151 * fix: report median as int --- htsinfer/get_library_stats.py | 4 ++-- htsinfer/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htsinfer/get_library_stats.py b/htsinfer/get_library_stats.py index ff2bc57b..6413586f 100644 --- a/htsinfer/get_library_stats.py +++ b/htsinfer/get_library_stats.py @@ -60,14 +60,14 @@ def evaluate(self) -> ResultsStats: self.fastq_get_stats_read_length(fastq=self.paths[0]) ) # process file 2 - LOGGER.info(f"Obtaining statistics for file: {self.paths[0]}") + LOGGER.info(f"Obtaining statistics for file: {self.paths[1]}") if self.paths[1] is not None: (stats.file_2.read_length.min, stats.file_2.read_length.max, stats.file_2.read_length.mean, stats.file_2.read_length.median, stats.file_2.read_length.mode) = ( - self.fastq_get_stats_read_length(fastq=self.paths[0]) + self.fastq_get_stats_read_length(fastq=self.paths[1]) ) return stats diff --git a/htsinfer/models.py b/htsinfer/models.py index 8db42f6f..6b8c2f95 100644 --- a/htsinfer/models.py +++ b/htsinfer/models.py @@ -95,7 +95,7 @@ class ReadLength(BaseModel): min: Optional[int] = None max: Optional[int] = None mean: Optional[float] = None - median: Optional[float] = None + median: Optional[int] = None mode: Optional[int] = None