diff --git a/htsinfer/get_library_type.py b/htsinfer/get_library_type.py index ca68c4e..19665c9 100644 --- a/htsinfer/get_library_type.py +++ b/htsinfer/get_library_type.py @@ -206,7 +206,13 @@ def _align_mates(self): def _update_relationship(self, concordant, read_counter): """Helper function to update relationship based on alignment.""" try: - if (concordant / read_counter) >= self.cutoff: + ratio = concordant / read_counter + except ZeroDivisionError: + self.results.relationship = ( + StatesTypeRelationship.not_available + ) + else: + if ratio >= self.cutoff: self.results.relationship = ( StatesTypeRelationship.split_mates ) @@ -218,10 +224,6 @@ def _update_relationship(self, concordant, read_counter): self.results.relationship = ( StatesTypeRelationship.not_mates ) - except ZeroDivisionError: - self.results.relationship = ( - StatesTypeRelationship.not_available - ) class AlignedSegment: """Placeholder class for mypy "Missing attribute" @@ -331,7 +333,7 @@ def evaluate(self) -> None: if self.seq_id_format is None: self.result = StatesType.not_available - LOGGER.warning( + LOGGER.debug( "Could not determine sequence identifier format." ) else: diff --git a/tests/test_get_library_type.py b/tests/test_get_library_type.py index 9682bf7..2ae8c96 100644 --- a/tests/test_get_library_type.py +++ b/tests/test_get_library_type.py @@ -33,7 +33,6 @@ FILE_IDS_NOT_MATCH_2, FILE_TRANSCRIPTS, FILE_SINGLE, - FILE_UNKNOWN_SEQ_ID, RaiseError, SEQ_ID_DUMMY, SEQ_ID_MATE_1,