From 94160ddbb26904362b757376abd13f658d8fdaf1 Mon Sep 17 00:00:00 2001 From: Luca Venturini Date: Mon, 10 Jun 2019 10:50:25 +0100 Subject: [PATCH] Fix #181 and small bug fix for parsing Mikado annotations. --- Mikado/parsers/bed12.py | 3 ++- Mikado/parsers/gfannotation.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Mikado/parsers/bed12.py b/Mikado/parsers/bed12.py index 4f0044ed5..2ef630437 100644 --- a/Mikado/parsers/bed12.py +++ b/Mikado/parsers/bed12.py @@ -500,7 +500,8 @@ def _adjust_start(self, sequence, orf_sequence): self.phase = 0 else: if self.end - self.thick_end <= 2: - self.phase = self.end - self.thick_end + new_phase = max(self.end - self.thick_end, 0) + self.phase = new_phase self.thick_end = self.end else: self.phase = 0 diff --git a/Mikado/parsers/gfannotation.py b/Mikado/parsers/gfannotation.py index 39b3b5387..61215c7ec 100644 --- a/Mikado/parsers/gfannotation.py +++ b/Mikado/parsers/gfannotation.py @@ -240,6 +240,8 @@ def is_gene(self): elif self.id is not None and self.id.startswith("gene:"): # Hack for EnsEMBL return True + elif self.feature in ("sublocus", "monosublocus", "monosublocusholder"): + return True return False @property