monarch-initiative / pheval

A framework for empirical evaluation of phenotype matching and prioritisation
https://monarch-initiative.github.io/pheval/
Apache License 2.0
12 stars 1 forks source link

Check for no parent when scrambling phenotypic profiles #293

Closed yaseminbridges closed 9 months ago

yaseminbridges commented 9 months ago

Check if no parents are found for a HPO term to avoid this error:

File ".pyenv/versions/3.11.3/lib/python3.11/site-packages/pheval/prepare/create_noisy_phenopackets.py", line 71, in convert_patient_terms_to_parent
    self.retrieve_hpo_term(self.hpo_ontology.hierarchical_parents(term.type.id)[0])
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range