From ac7132447a7663f49726b1442289353e5a3b47a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Wed, 30 Oct 2024 11:01:52 +0100 Subject: [PATCH] refactor: minor fixes to logging --- htsinfer/get_library_source.py | 5 ++++- htsinfer/get_library_stats.py | 2 +- htsinfer/get_read_orientation.py | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htsinfer/get_library_source.py b/htsinfer/get_library_source.py index 80b17e4..3ef7c4e 100644 --- a/htsinfer/get_library_source.py +++ b/htsinfer/get_library_source.py @@ -83,7 +83,10 @@ def evaluate(self) -> ResultsSource: self.transcripts_file ) source.file_1.short_name = src_name - + LOGGER.info( + f'Library source taxonomy ID: {self.tax_id}, ' + f'short name: {source.file_1.short_name}' + ) if self.paths[1] is not None: source.file_2.taxon_id = self.tax_id source.file_2.short_name = source.file_1.short_name diff --git a/htsinfer/get_library_stats.py b/htsinfer/get_library_stats.py index 30c004c..718521c 100644 --- a/htsinfer/get_library_stats.py +++ b/htsinfer/get_library_stats.py @@ -60,8 +60,8 @@ 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[1]}") if self.paths[1] is not None: + LOGGER.info(f"Obtaining statistics for file: {self.paths[1]}") (stats.file_2.read_length.min, stats.file_2.read_length.max, stats.file_2.read_length.mean, diff --git a/htsinfer/get_read_orientation.py b/htsinfer/get_read_orientation.py index cfc4cbd..6904e39 100644 --- a/htsinfer/get_read_orientation.py +++ b/htsinfer/get_read_orientation.py @@ -186,8 +186,8 @@ def process_single( f"Required number of mapped reads: {self.min_mapped_reads}" ) LOGGER.info(f"Number of mapped reads: {orient_df.iloc[0, 0]}") - LOGGER.info(f"Fraction of SF: {orient_df.iloc[0, 1], 3}") - LOGGER.info(f"Fraction of SR: {orient_df.iloc[0, 2], 3}") + LOGGER.info(f"Fraction of SF: {orient_df.iloc[0, 1]}") + LOGGER.info(f"Fraction of SR: {orient_df.iloc[0, 2]}") LOGGER.debug(f"Orientation: {orient_df.iloc[0, 3]}") self.write_orientation_to_json(orient_df, self.paths[0].name) @@ -313,8 +313,8 @@ def process_paired( # pylint: disable=R0912,R0915 f"Required number of mapped reads: {self.min_mapped_reads}" ) LOGGER.info(f"Number of mapped reads: {orient_df_1.iloc[0, 0]}") - LOGGER.info(f"Fraction of ISF: {orient_df_1.iloc[0, 1], 3}") - LOGGER.info(f"Fraction of ISR: {orient_df_1.iloc[0, 2], 3}") + LOGGER.info(f"Fraction of ISF: {orient_df_1.iloc[0, 1]}") + LOGGER.info(f"Fraction of ISR: {orient_df_1.iloc[0, 2]}") LOGGER.debug(f"Orientation file 1: {orient_df_1.iloc[0, 3]}") LOGGER.debug(f"Orientation file 2: {orient_df_2.iloc[0, 3]}") LOGGER.debug(