Annotations

class Omim
get()

Returns a gene that matches the provided query

Parameters

query (int) – An Omim ID

Returns

A Omim

Return type

pyhpo.Omim

Raises
  • NameError – Ontology not yet constructed

  • KeyError – No disease found for the query

Examples

from pyhpo import Ontology, Omim
Ontology()
Omim.get(183849)
# >> <OmimDisease (183849)>
hpo

Returns the IDs of all associated HPOTerm

Returns

A set of integers, representing the HPO-IDs

Return type

set(int)

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology
Ontology()
disease = list(Ontology.omim_diseases)[0]
disease.hpo
# >> {100864, 5090, 4581, 6, 2663, 3911, 6599, ...}
hpo_set()

Returns a HPOSet of all associated HPOTerm

Returns

An HPOSet containing all associated HPOTerm

Return type

pyhpo.HPOSet

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology
Ontology()
disease = list(Ontology.omim_diseases)[0]
disease.hpo_set()
# >> HPOSet.from_serialized(6+2651+2663+2812+2834+2869, ..._
id

Returns the OmimDisease Id

Returns

The Omim-ID

Return type

int

Examples

from pyhpo import Ontology
Ontology()
disease = list(Ontology.omim_diseases)[0]
disease.id    # ==> 183849
name

Returns the name of the disease

Examples

from pyhpo import Ontology
Ontology()
disease = list(Ontology.omim_diseases)[0]
gene.name  # ==> 'Spondyloepimetaphyseal dysplasia with hypotrichosis'
toJSON(verbose)

Returns a dict/JSON representation the Omim disease

Parameters

verbose (bool) – Indicates if all associated HPOTerm should be included in the output

Returns

Dict representation of the Omim disease

Return type

Dict

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology, Omim
Ontology()
Omim.get(183849).toJSON()
# >> {'name': 'Spondyloepimetaphyseal dysplasia with hypotrichosis', 'id': 183849}
class Gene
get()

Returns a gene that matches the provided query

Parameters

query (str or int) – A gene symbol of HGNC-ID

Returns

A Gene

Return type

pyhpo.Gene

Raises
  • NameError – Ontology not yet constructed

  • KeyError – No gene found for the query

Examples

from pyhpo import Ontology, Gene
Ontology()
Gene.get("BRCA2")
# >> Gene (BRCA2)>

Gene.get(2629)
# >> <Gene (GBA1)>
hpo

Returns the IDs of all associated HPOTerm

Returns

A set of integers, representing the HPO-IDs

Return type

set(int)

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology
Ontology()
gene = list(Ontology.genes[0]
gene.hpo
# >> {3077, 7, 7703, 2073, 2075, 30236, .....}
hpo_set()

Returns a HPOSet of all associated HPOTerm

Returns

An HPOSet containing all associated HPOTerm

Return type

pyhpo.HPOSet

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology
Ontology()
gene = list(Ontology.genes[0]
gene.hpo_set()
# >> HPOSet.from_serialized(7+118+152+234+271+315, ....)
id

Returns the Gene Id

Returns

The HGNC-ID

Return type

int

Examples

from pyhpo import Ontology
Ontology()
gene = list(Ontology.genes[0]
gene.id
# >> 11212
name

Returns the gene symbol

Returns

The gene symbol

Return type

str

Examples

from pyhpo import Ontology
Ontology()
gene = list(Ontology.genes[0]
gene.name
# >> 'BRCA2'
toJSON(verbose)

Returns a dict/JSON representation the Gene

Parameters

verbose (bool) – Indicates if all associated HPOTerm should be included in the output

Returns

Dict representation of the gene

Return type

Dict

Raises

NameError – Ontology not yet constructed

Examples

from pyhpo import Ontology, Gene
Ontology()
Gene.get("BRCA2").toJSON()
# >> {'name': 'BRCA2', 'id': 675, 'symbol': 'BRCA2'}