From 10e44bd1cd430d907426e44d00ab68d938d715d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Fri, 19 Jan 2024 12:16:32 +0100 Subject: [PATCH] feat: align mates even when assumed single #160 --- htsinfer/get_library_type.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htsinfer/get_library_type.py b/htsinfer/get_library_type.py index 37dad4f..e5fd2da 100644 --- a/htsinfer/get_library_type.py +++ b/htsinfer/get_library_type.py @@ -127,6 +127,21 @@ def _evaluate_mate_relationship( self.mapping.library_type.relationship = ( StatesTypeRelationship.split_mates ) + # Infer mate relationship, even when assumed to be single + elif ( + self.results.file_1 == StatesType.single and + self.results.file_2 == StatesType.single + ) and ( + self.library_source.file_1.short_name is not None or + self.library_source.file_2.short_name is not None + ): + LOGGER.debug("Determining mate relationship by alignment...") + self.mapping.library_type.relationship \ + = StatesTypeRelationship.not_available + self.mapping.library_source = self.library_source + self.mapping.paths = self.path_1, self.path_2 + self.mapping.evaluate() + self._align_mates() elif ( self.library_source.file_1.short_name is not None or self.library_source.file_2.short_name is not None