HPOTerm
HPOTerm
instances contain all relevant information about a single HPO term. They are part of an Ontology
and contain links to parental and offspring HPOTerm
s.
HPOTerm
- class pyhpo.term.HPOTerm(**kwargs)[source]
An HPOTermBase instance can be build solely by itself, without knowledge of the actual Ontology
Attributes
- HPOTerm.id:
str
The HPO identifier
- HPOTerm.name:
str
The name of the HPO term
- HPOTerm.information_content:
InformationContent
The
InformationContent
of the HPO term. Multiple kinds of IC are automatically calculated, others can be manually calculated.
- HPOTerm.comment:
str
- HPOTerm.definition:
str
- HPOTerm.synonym:
List
[str
]
- HPOTerm.genes:
Set
[GeneSingleton
]
- HPOTerm.omim_diseases:
Set
[OmimDisease
]
- HPOTerm.orpha_diseases:
Set
[OrphaDisease
]
- HPOTerm.decipher_diseases:
Set
[DecipherDisease
]
parent_of
child_of
parent_ids
common_ancestors
count_parents
longest_path_to_root
shortest_path_to_root
shortest_path_to_parent
longest_path_to_bottom
path_to_other
similarity_score
- HPOTerm.similarity_score(other, kind=None, method=None)[source]
Calculate the similarity between this and another HPO-Term It uses
pyhpo.similarity.base._Similarity
underneath- Parameters:
other (HPOTerm) – Other HPO term to compare similarity to
kind (str, default
''
) –Which kind of information content should be calculated. Default option is defined in pyhpo.similarity.base._Similarity
Available options:
omim
orpha
decipher
gene
method (string, default
''
) –The method to use to calculate the similarity. Default option is defined in pyhpo.similarity.base._Similarity
Available options:
resnik - Resnik P, Proceedings of the 14th IJCAI, (1995)
lin - Lin D, Proceedings of the 15th ICML, (1998)
jc - Jiang J, Conrath D, ROCLING X, (1997) Implementation according to R source code
jc2 - Jiang J, Conrath D, ROCLING X, (1997) Implementation according to paper from R
hposim
library Deng Y, et. al., PLoS One, (2015)rel - Relevance measure - Schlicker A, et.al., BMC Bioinformatics, (2006)
ic - Information coefficient - Li B, et. al., arXiv, (2010)
graphic - Graph based Information coefficient - Deng Y, et. al., PLoS One, (2015)
dist - Distance between terms
Additional methods can be registered separately ( see :class::pyhpo.similarity.base._Similarity)
- Return type:
float
toJSON
- HPOTerm.toJSON(verbose=False)[source]
Creates a JSON-like object of the HPOTerm
- Parameters:
verbose (bool, default
False
) – Include extra properties- Returns:
A dictionary with the main properties of the HPOTerm
- Return type:
dict
Example:
>>> terms[2].toJSON() { 'name': 'Abnormality of body height', 'id': 'HP:0000002', 'int': 2 } >>> terms[2].toJSON(verbose=True) { 'name': 'Abnormality of body height', 'synonym': ['Abnormality of body height'], 'comment': None, 'def': '"Deviation from the norm of height with respect [...]', 'xref': ['UMLS:C4025901'], 'is_a': ['HP:0001507 ! Growth abnormality'], 'id': 'HP:0000002', 'int': 2 }
InformationContent
- class pyhpo.term.InformationContent(**data)[source]
InformationContent contains automatically calculated IC based on direct/indirect associations with genes, omim, orpha and decipher. IC instances are created automatically and accessed through
pyhpo.term.HPOTerm
instances.Users can also register and calculate custom IC scores via
pyhpo.term.InformationContent.set_custom()
.
Default attributes
set_custom
- InformationContent.set_custom(key, value)[source]
Set the IC of a custom score
- Parameters:
key (str) – The name of the information-content metric
value (float) – The actual information content
- Return type:
None
Example:
for term in Ontology: # For some reason, you want to base the information content # on the depths of the Term in the ontology term.setcustom('depth', term.shortest_path_to_root()) # and now calculate similarity of two sets my_similarity = term_set_1.similarity(term_set_2, kind='depth')