Data update to 2024-04-26
Fix JC similarity algoritm (see #20 for details)
Data update to 2024-03-06
Data update to 2023-10-09
Hotfix to include missing submodules during build process
Data update to 2023-07-21
Migrate documentations to ReadTheDocs
Transfer repository ownership back to anergictcell
.
Update Pydantic dependency to 2.0
Data update to 2023-06-17
Data update to 2023-04-05
Minor fix in parsing to account for new JAX HPO data format
Refactored huge parts of the code, enabling more strict mypy type checking and class validation via Pydantic. This makes development much easier, but has a few, minor impacts on the library's API.
Obviously, 3.0.0 also includes a data update to 2021-10-10.
Due to use of f-strings, PyHPO requires Python >= 3.6
removed
removed
removed
HPOTerm.children
and HPOTerm.parents
now are set(HPOTerm)
instead of list(HPOTerm)
. This makes more sense logically, but breks code that slices the result. I believe this to be low impact, since there is no good reason to slice a list of children or parents. In an ideal case one wants to iterate through them or check for existence or length. This behaviour is still possible:
This code will still work
for child in term.children:
# do something with the child-term
child.similarity(term)
if term_x in term.children:
# Hooray
if len(term.children):
# Hooray
HPOTerm.hierarchy
now is a property and not a method anymore.
HPOTerm._index
now is a public attribute HPOTerm.index
.
HPOTerm.id_from_string
is moved to pyhpo.parser.generics.id_from_string
.
HPOTerm.parse_synonym
is moved to a semi-private function in the OBO parser.
Direct access of HPOTerms
from the Ontology raises KeyError
instead
of returning None
if no term is present for the index.
Updating gene or diease annotations should be done only via
pyhpo.parser.genes.add_gene_to_term
pyhpo.parser.diseases.add_decipher_to_term
pyhpo.parser.diseases.add_negative_decipher_to_term
pyhpo.parser.diseases.add_omim_to_term
pyhpo.parser.diseases.add_negative_omim_to_term
pyhpo.parser.diseases.add_orpha_to_term
pyhpo.parser.diseases.add_negative_orpha_to_term
Note
Updating HPOTerm.genes
, HPOTerm.omim_diseases
etc directly will not update the parent and child terms properly.
# DON'T DO THIS
term.genes.update(new_gene)
# Do this instead
from pyhpo.parser.genes import add_gene_to_term
add_gene_to_term(new_gene, term)
HPOTerm.similarity
no longer defines the default options. They are now defined in
pyhpo.similarity.base._Similarity
. Defaults now to:
- method:
graphic
- kind:
omim
HPOTerm.shortest_path_to_parent
raises a RuntimeError if the other
term is not a parent of self
instead of returning (inf, None)
.
Changed repr to be more readable and more pythonic.
HPOTerm.print_hierarchy
has been removed and is not part of the public
API anymore
There are no setter and wrapper methods around this anymore. These attributes should not be set by clients and should only be modified by the library itself.
Initiating the ontology with custom data changed to specify the path to the data folder
Retired old list-based initializiation. Use keyword arguments instead
# DON'T DO THIS
mygene = Gene([None, None, 1, 'EZH2'])
# Do this instead
mygene = Gene(hgncid=1, symbol='EZH2')
Retired old list-based initializiation. Use keyword arguments instead
# DON'T DO THIS
my_disease = Omim([None, 1, 'Gaucher'])
# Do this instead
my_disease = Omim(diseaseid=1, name='Gaucher')
Disease and Gene annotations are not completely bidirectional anymore. HPOTerms do still inherit their annotation to their parent terms. But diseases and genes do not get these inheritances assigned reciprocally.
For example, consider COHEN SYNDROME (OMIM-ID: 216550)
.
Cohen syndrom is linked to HP:0002943 | Thoracic scoliosis
in the HPO-Annotations file, but not to HP:0002650 | Scoliosis
. Since Scoliosis is a parent of Thoracic scoliosis, both HPOTerms are annotated with Cohen disease. However, Cohen disease is only annotated with the Thoracic scoliosis HPOterm.
cohen = Omim.get(216550)
scoliosis = Ontology[2650]
thoracic_scoliosis = Ontology[2943]
thoracic_scoliosis.child_of(scoliosis)
# >> True
cohen in scoliosis.omim_diseases
# >> True
cohen in thoracic_scoliosis.omim_diseases
# >> True
thoracic_scoliosis.index in cohen.hpo
# >> True
scoliosis.index in cohen.hpo
# >> False
Searching via Ontology.search
or Ontology.synonym_search
is now case insensitive.
- Added type annotation to all methods
Ontology.get_hpo_object
now behaves as documented and raises an error if the term is not found instead of silently returning None- 2.7.3 Fixes a bug in
EnrichmentModel.enrichment
method.
- Refactored Gene and Disease annotations
- Added proper hashing methods to
HPOTerm
,Disease
andGene
- Bugfix for similarity score when one set does not contain any HPOTerm
- 2.6.1: Re-add (Gene/Omim).get method for single gene/disease fetching. Needed in pyhpoapi
- Added combination methods for HPOset similarities
- Added Matrix module for row/column based operations
- Data update to
hp/releases/2020-10-12
- HPO: 15530 ==> 15656
- Genes: 4366 ==> 4484
- OMIM: 7801 ==> 7860
- Negative OMIM: 652 ==> 660
- ORPHANET: 3956 ==> 3989
- Negative ORPHANET: 255 ==> 259
- DECIPHER: 47 ==> 47
- Negative DECIPHER: 0 ==> 0
- Data update to
- Data update to
hp/releases/2020-08-11
- HPO: 15332 ==> 15530
- Genes: 4317 ==> 4366
- OMIM: 7675 ==> 7801
- Negative OMIM: 638 ==> 652
- ORPHANET: 3889 ==> 3956
- Negative ORPHANET: 240 ==> 255
- DECIPHER: 47 ==> 47
- Negative DECIPHER: 0 ==> 0
- Data update to
- Added GraphIC similarity measure
- Added Orphanet diseases to Annotation
- Added Decipher diseases to Annotation
- Reworked BasicHPOSet
- Added omim_diseases to HPOSet
- Added distance method to similarity measurement
- Added equal measurement to HPOSet similarity
- Refactored Ontology to act as a singleton - Able to remove some weird dependencies when creating HPOSets - Refactored some unit tests to only temporarily mock methods
- Performance improvements through using more cached objects
- Making HPOSet an actual set
- Adding BasicHPOSet
- Handling obsolete terms
- Added serialization to HPO Term and HPO Set
- Option to remove modifier from HPO Set
- Changed Omim and Gene to be Singletons
- Data update
- HPO: 14961 ==> 15332
- Genes: 4312 ==> 4317
- OMIM: 7623 ==> 7675
- Negative OMIM: 634 ==> 638
- Data update
- HPO: 14832 ==> 14961
- Genes: 4293 ==> 4312
- OMIM: 7758 ==> 7623
- Negative OMIM: 631 ==> 634
- Switched to new annotation files from HPO Team (
phenotype.hpoa
)
- Only data update
- No code changes
- Removed daemon and client scripts since they are not yet part of the package and aren't working.
- Restructured some metadata for packaging and documentation
- Adding annotation automatically to the Ontology by default.
- This should not break backwards compatibility, since all annotation data is stored in the repo itself and thus always present
- Include data (HPO-Ontology and Annotation) directly in the repo
- Data updates:
- HPO: hp/releases/2019-09-06
- Added HPO terms: 14647 ==> 14831
- Genes: Added genes 4073 ==> 4231
- OMIM: Added diseases 7665 ==> 7677
- OMIM excluded: Added excluded diseases 614 ==> 623
- First stable release