Map disease IDs (e.g. "OMIM:101200") to names (e.g. "Apert syndrome")

map_disease(
  dat,
  id_col = "disease_id",
  fields = c("disease", "categories", "genes")[1],
  use_api = FALSE,
  return_dat = FALSE,
  workers = NULL,
  all.x = TRUE,
  allow.cartesian = FALSE
)

Arguments

dat

A data.table with a column of disease IDs.

id_col

The name of the column with the disease IDs.

fields

The fields to extract from the API response.

use_api

Use the API to get the disease names and descriptions. Otherwise, use a cached data.table (disease_map).

return_dat

Return the data.table with the mapped fields.

workers

Number (>1) or proportion (<1) of worker cores to use.

all.x

logical; if TRUE, rows from x which have no matching row in y are included. These rows will have 'NA's in the columns that are usually filled with values from y. The default is FALSE so that only rows with data from both x and y are included in the output.

allow.cartesian

See allow.cartesian in [.data.table.

Examples

dat <- HPOExplorer::load_phenotype_to_genes()
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
out <- map_disease(dat = dat, workers=1)
#> Adding disease_name and disease_description.