Parser
The parser
section contains functions to parse the master data,
such as hpo.obo
and phenotype...
files. These methods should
mostly be left untouched and there is very little need for client-side
code to interact with these methods. The documentation here is mostly
for developers of the library.
Public methods
build_ontology_annotations
- pyhpo.parser.build_ontology_annotations(data_folder, ontology)[source]
Builds all annotations and associated genes and diseases to the HPO terms in the Ontology.
- Parameters:
data_folder (
str
) – The full path to the folder that contains the master data filesontology (
OntologyClass
) – The ontology of HPO terms
- Return type:
None
id_from_string
remove_outcommented_rows
- pyhpo.parser.generics.remove_outcommented_rows(fh, ignorechar='#')[source]
Removes all rows from a filereader object that start with a comment character
- Parameters:
fh (
Iterator
[str
]) – 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 suitableignorechar (
str
) – All lines starting with this character(s) will be ignored
- Yields:
row (str) – One row of the
fh
iterator- Return type:
Iterator
[str
]
add_decipher_to_term
add_negative_decipher_to_term
- pyhpo.parser.diseases.add_negative_decipher_to_term(decipher, term)[source]
Recursive function to add excluded Decipher Disease to an HPOTerm and all its parents
- Parameters:
decipher (
DecipherDisease
) – Disease to exclude from termterm (
HPOTerm
) – HPOTerm that is not associated with diseease
- Return type:
None
add_omim_to_term
add_negative_omim_to_term
add_orpha_to_term
add_negative_orpha_to_term
all_decipher_diseases
all_omim_diseases
all_orpha_diseases
add_gene_to_term
- pyhpo.parser.genes.add_gene_to_term(gene, term)[source]
Recursive function to add Gene to an HPOTerm and all its parents
- Parameters:
gene (
GeneSingleton
) – Gene to add to termterm (
HPOTerm
) – HPOTerm that is associated with the gene
- Return type:
None
all_genes
- pyhpo.parser.genes.all_genes()[source]
- Return type:
Set
[GeneSingleton
]