parseHPO: Parse HPO Gene-Phenotype Associations

View source: R/hpo_parsers.R

parseHPOR Documentation

Parse HPO Gene-Phenotype Associations

Description

Reads the Human Phenotype Ontology (HPO) gene-phenotype associations as distributed by Harmonizome (gene_attribute_edges.txt) and returns a dvobject with gene, phenotype and association tables.

Usage

parseHPO(
  filepath,
  minimum_weight = 0,
  db_version = NULL,
  db_exported_date = NULL
)

Arguments

filepath

Character. Path to the Harmonizome HPO gene_attribute_edges.txt file, plain or gzip-compressed.

minimum_weight

Numeric. Minimum association weight to keep. The default 0 keeps all associations.

db_version

Character or NULL. Dataset version, stored in the object metadata.

db_exported_date

Character or NULL. Dataset release date, stored in the object metadata.

Details

The Harmonizome file is tab separated and has two header lines: the column names (source, source_desc, source_id, target, target_desc, target_id, weight) followed by a descriptor row (GeneSym, NA, GeneID, Phenotype, HPOID, NA, weight). The parser drops the descriptor row and renames the columns to domain-specific names. Columns that carry no information in this dataset (source_desc and the -666 placeholder in target_id) are not kept.

Gzip-compressed files (.gz) are read directly.

The resulting object can be linked to DrugBank target genes with merge_drugbank_hpo.

Value

A dvobject with three tibbles:

associations

One row per gene-phenotype pair: gene_symbol, entrez_id, hpo_id, phenotype_name and association_weight.

genes

Unique genes: gene_symbol, entrez_id and n_phenotypes, the number of associated phenotypes.

phenotypes

Unique phenotypes: hpo_id, phenotype_name and n_genes, the number of associated genes.

See Also

Other parsers: cett_nodes_options(), drug_node_options(), parseDrugBank(), parseHGNC(), parseHealthCanadaDPD(), parseOnSIDES(), parseOpenFDA(), parseTWOSIDES(), references_node_options()

Examples

hpo_path <- system.file("extdata", "hpo_gene_attribute_edges.txt",
                        package = "dbparser")
hpo_db <- parseHPO(hpo_path)
hpo_db$phenotypes
show_dvobject_metadata(hpo_db)


dbparser documentation built on Nov. 9, 2026, 1:10 a.m.