Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for Annotations GeneDict result in error #24

Closed
aruta321 opened this issue Feb 3, 2025 · 4 comments
Closed

Examples for Annotations GeneDict result in error #24

aruta321 opened this issue Feb 3, 2025 · 4 comments

Comments

@aruta321
Copy link

aruta321 commented Feb 3, 2025

Reproducing the examples from the GeneDict() documentation gives a TypeError in v3.3.1. Either the documentation should specify the hgnc id and symbol are required or the code should allow for only one to be passed.

Image

@aruta321
Copy link
Author

aruta321 commented Feb 3, 2025

This is also a problem in DiseaseDict with the 'name' and 'diseaseid' inputs.

@anergictcell
Copy link
Owner

Hi aruta321,

You're right, the documentation for this section is outdated and not correct. I'm sorry for this - I'll try to update it when I find some time.

There are a few things that you should change:

You must initialize the Ontology once at the beginning

During this step, it will read and parse the underlying ontology data. Without this step, there will be no genes or diseases.

from pyhpo import Ontology
from pyhpo.annotations import Gene, OmimDisease

_ = Ontology()  # this step is important

Calling the Gene or OmimDisease class will instantiate a new one, that's why both id and name are needed. There is a helper function get to retrieve a single gene or disease based on ID or name.

from pyhpo import Ontology
from pyhpo.annotations import Gene, OmimDisease

_ = Ontology()  # this step is important

Gene.get("GBA1")

The gene GBA was renamed to GBA1, so the query for GBA will not yield any results anymore.

I hope this instructions help solving your issues - please let me know if you need more assistance. I will keep this issue open as a reminder for me to update the docs.

@aruta321
Copy link
Author

aruta321 commented Feb 4, 2025

Thanks for the quick response. This has resolved my issues.

@anergictcell
Copy link
Owner

I updated the documentation for handling Genes and Diseases to make the workflow (hopefully) more obvious in #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants