map_phenotypes: Harmonise phenotypes

View source: R/map_phenotypes.R

map_phenotypesR Documentation

Harmonise phenotypes

Description

Harmonise a mixed vector of phenotype names (e.g. "Focal motor seizure") and HPO IDs (e.g. c("HP:0000002","HP:0000003")).

Usage

map_phenotypes(
  terms,
  hpo = get_hpo(),
  to = c("name", "id"),
  keep_order = TRUE,
  ignore_case = TRUE,
  ignore_char = eval(formals(KGExplorer::map_ontology_terms)$ignore_char),
  invert = FALSE
)

Arguments

terms

A subset of HPO IDs to include in the final dataset and plots (e.g. c("HP:0001508","HP:0001507")).

hpo

Human Phenotype Ontology object, loaded from get_ontology.

to

Character vector of database(s) to map IDs to. When not "mondo", can supply multiple alternative databases to map to (e.g. c("OMIM","Orphanet","DECIPHER")).

keep_order

Return a named list of the same length and order as terms. If FALSE, return a named list of only the unique terms, sometimes in a different order.

ignore_case

Ignore case when mapping terms.

ignore_char

A character vector of characters to ignore when mapping terms.

invert

Invert the keys/values of the dictionary, such that the key becomes the values (and vice versa).

Value

Character vector

Examples

terms <- c("Focal motor seizure",
            "Focal MotoR SEIzure",
            "HP:0000002","HP:0000003")
#### As phenotype names ####
term_names <- map_phenotypes(terms=terms)
#### As HPO IDs ####
term_ids <- map_phenotypes(terms=terms, to="id")

neurogenomics/HPOExplorer documentation built on July 17, 2024, 3:12 p.m.