Annotations

The Annotations section contains various metadata annotations for HPO terms.

Gene class

class pyhpo.annotations.GeneSingleton(columns)[source]

Representation of a Gene

id

int

HGNC id

name

str

HGNC gene synbol

symbol

str

HGNC gene symbol (alias of name)

Parameters:columns (list) – [None, None, id, name]

Omim class

class pyhpo.annotations.OmimDisease(cols)[source]

HPO_Gene class

class pyhpo.annotations.HPO_Gene(filename=None, path='./')[source]

Associative dict to link an HPO term to a Gene

Parameters:
  • filename (str) – Filename of HPO-Gene association file. Defaults to filename from HPO
  • path (str) – Path to data files. Defaults to ‘./’

Methods

parse_pheno_file

pyhpo.annotations.parse_pheno_file(filename=None, path='./', delimiter='\t')[source]

Parses OMIM-HPO assoation file and generates a positive and negative annotation dictionary

Parameters:
  • filename (str) – Filename of HPO-Gene association file. Defaults to filename from HPO
  • path (str) – Path to data files. Defaults to ‘./’
Returns:

  • omim_dict (dict) – Dictionary containing all HPO-OMIM associations. HPO-ID is the key
  • negative_omim_dict (dict) – Dictionary containing all negative HPO-OMIM associations. HPO-ID is the key

remove_outcommented_rows

pyhpo.annotations.remove_outcommented_rows(fh, ignorechar='#')[source]

Removes all rows from a filereader object that start with a comment character

Parameters:
  • fh (iterator) – any object which supports the iterator protocol and returns a string each time its __next__() method is called — file objects and list objects are both suitable
  • ignorechar (str, defaults: #) – All lines starting with this character will be ignored
Yields:

row (str) – One row of the fh iterator