Skip to content

Commit

Permalink
Merge pull request #44 from monarch-initiative/43-error-handling-for-…
Browse files Browse the repository at this point in the history
…when-no-phenotype-entries-are-found-in-the-annotation-for-a-disease

Add error handling for empty matches for a disease
  • Loading branch information
yaseminbridges authored Nov 25, 2024
2 parents 452cd0e + 5ac059d commit ba3be0a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "phenotype2phenopacket"
version = "0.6.5"
version = "0.6.6"
description = ""
authors = ["Yasemin Bridges <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/phenotype2phenopacket/cli_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)
@click.option(
"--local-ontology-cache",
"-l",
"-c",
metavar="PATH",
required=False,
help="Path to the local ontology cache, e.g., path to the hp.obo.",
Expand Down
2 changes: 1 addition & 1 deletion src/phenotype2phenopacket/cli_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)
@click.option(
"--local-ontology-cache",
"-l",
"-c",
metavar="PATH",
required=False,
help="Path to the local ontology cache, e.g., path to the hp.obo.",
Expand Down
6 changes: 5 additions & 1 deletion src/phenotype2phenopacket/convert/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from phenotype2phenopacket.utils.utils import (
filter_diseases,
load_ontology,
read_omim_id_list,
return_phenotype_annotation_data,
)

Expand Down Expand Up @@ -36,7 +37,10 @@ def convert_to_phenopackets(
grouped_omim_diseases = filter_diseases(
num_disease, omim_id, omim_id_list, phenotype_annotation_data
)
for omim_disease in grouped_omim_diseases:
for omim_id, omim_disease in zip(read_omim_id_list(omim_id_list), grouped_omim_diseases):
if len(omim_disease) == 0:
print(f"Skipping... Could not find any phenotype entries for {omim_id}!")
continue
phenopacket_file = PhenotypeAnnotationToPhenopacketConverter(
human_phenotype_ontology
).create_phenopacket(omim_disease, phenotype_annotation_data.version, None)
Expand Down

0 comments on commit ba3be0a

Please sign in to comment.