Skip to content

Commit

Permalink
Double check phenopy data files are there.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldingemans committed Jan 28, 2024
1 parent 6312fca commit e297852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions phenoscore/hpo_phenotype/calc_hpo_sim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from phenopy.build_hpo import generate_annotated_hpo_network
from phenopy.config import download_resource_files
from phenopy.score import Scorer
import networkx as nx
import os
Expand Down Expand Up @@ -91,10 +92,12 @@ def _init_calc_similarity(self, scoring_method, sum_method):
scorer: phenopy scorer instance
Scorer object that can be used to calculate semantic similarity between lists of HPO terms
"""

# files used in building the annotated HPO network
phenopy_data_directory = os.path.join(os.path.expanduser("~"), '.phenopy', 'data')
obo_file = os.path.join(phenopy_data_directory, 'hp.obo')
disease_to_phenotype_file = os.path.join(phenopy_data_directory, 'phenotype.hpoa')
download_resource_files()
hpo_network, alt2prim, disease_records = generate_annotated_hpo_network(obo_file,
disease_to_phenotype_file, )

Expand Down

0 comments on commit e297852

Please sign in to comment.