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
)
A data.table with a column of disease IDs.
The name of the column with the disease IDs.
The fields to extract from the API response.
Use the API to get the disease names and descriptions.
Otherwise, use a cached data.table (disease_map
).
Return the data.table with the mapped fields.
Number (>1) or proportion (<1) of worker cores to use.
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.
See allow.cartesian
in [.data.table
.
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.