Skip to content

Commit

Permalink
add check on negative coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMainguy committed Jul 3, 2024
1 parent 4641fd0 commit accbd36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ppanggolin/genome.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def fill_annotations(self, start: int, stop: int, strand: str, gene_type: str =
raise TypeError(f"Stop should be int. Got {type(stop_i)} instead in {self} from {self.organism}.")
if stop_i < start_i:
raise ValueError(f"Wrong coordinates: {coordinates}. Start ({start_i}) should not be greater than stop ({stop_i}) in {self} from {self.organism}.")

if start_i < 1 or stop_i < 1:
raise ValueError(f"Wrong coordinates: {coordinates}. Start ({start_i}) and stop ({stop_i}) should be greater than 0 in {self} from {self.organism}.")

self.start = start
self.stop = stop
Expand Down

0 comments on commit accbd36

Please sign in to comment.