From 14f935704faf3f463eee43d53bf1d89cb669786a Mon Sep 17 00:00:00 2001 From: Adelme Bazin Date: Wed, 20 Sep 2023 20:19:44 +0200 Subject: [PATCH] add logging if genes share start position --- ppanggolin/genome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppanggolin/genome.py b/ppanggolin/genome.py index 6552348e..9f3e0498 100644 --- a/ppanggolin/genome.py +++ b/ppanggolin/genome.py @@ -331,7 +331,7 @@ def __setitem__(self, start: int, gene: Gene): if not isinstance(gene, Gene): raise TypeError(f"'Gene' type was expected but you provided a '{type(gene)}' type object") if start in self._genes_getter: - raise ValueError(f"Gene with start position {start} already exists in the contig") + raise ValueError(f"Gene '{self._genes_getter[start].ID}' with start position {start} already exists in the contig '{self.name}', cannot add gene '{gene.ID}'") if gene.position is None: raise AttributeError("The gene object needs to have its position in the contig filled before adding it") # Adding empty values.