Skip to content
Snippets Groups Projects
Commit 77a552a3 authored by Amandine  PERRIN's avatar Amandine PERRIN
Browse files

Add try/except to function sorting proteins

parent 72aaff37
No related branches found
No related tags found
No related merge requests found
...@@ -350,7 +350,13 @@ def sort_proteins(x): ...@@ -350,7 +350,13 @@ def sort_proteins(x):
- in each species, strain number - in each species, strain number
- in each species and strain number, by protein number - in each species and strain number, by protein number
""" """
try:
return (x.split(".")[0], int(x.split(".")[2].split("_")[0]), int(x.split("_")[-1])) return (x.split(".")[0], int(x.split(".")[2].split("_")[0]), int(x.split("_")[-1]))
except IndexError:
logger = logging.getLogger("utils")
logger.error(("ERROR: Protein {} does not have the required format. "
"Please change its name.").format(x))
sys.exit(1)
def read_genomes(list_file, name, date, dbpath, tmp_path): def read_genomes(list_file, name, date, dbpath, tmp_path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment