Harmonise a mixed vector of phenotype names (e.g. "Focal motor seizure") and HPO IDs (e.g. c("HP:0000002","HP:0000003")).
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
)
A subset of HPO IDs to include in the final dataset and plots (e.g. c("HP:0001508","HP:0001507")).
Human Phenotype Ontology object, loaded from get_ontology.
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")
).
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 when mapping terms.
A character vector of characters to ignore when mapping terms.
Invert the keys/values of the dictionary, such that the key becomes the values (and vice versa).
Character vector
terms <- c("Focal motor seizure",
"Focal MotoR SEIzure",
"HP:0000002","HP:0000003")
#### As phenotype names ####
term_names <- map_phenotypes(terms=terms)
#> Translating ontology terms to names.
#### As HPO IDs ####
term_ids <- map_phenotypes(terms=terms, to="id")
#> Translating ontology terms to ids.