Skip to content

Commit

Permalink
refactor: minor fixes to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Oct 30, 2024
1 parent fb23e09 commit ac71324
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion htsinfer/get_library_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion htsinfer/get_library_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions htsinfer/get_read_orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit ac71324

Please sign in to comment.