Skip to content

Commit

Permalink
add logging if genes share start position
Browse files Browse the repository at this point in the history
  • Loading branch information
axbazin authored Sep 20, 2023
1 parent 9200a51 commit 14f9357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ppanggolin/genome.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 14f9357

Please sign in to comment.