Skip to contents

This function maps OncoTree codes to Unified Medical Language System (UMLS) codes.

Usage

oncotree_to_umls(
  oncotree_code = NULL,
  oncotree_version = "oncotree_latest_stable",
  expand = FALSE,
  keep_empty = TRUE
)

Arguments

oncotree_code

OncoTree codes.

oncotree_version

OncoTree database release version.

expand

Whether to expand one-to-many mappings. If TRUE, one-to-many mappings are expanded into several rows in the output.

keep_empty

OncoTree codes that do not map to UMLS have the umls_code with NA if keep_empty = TRUE. Use keep_empty = FALSE, to remove the mapping (row) altogether from the output.

Value

A tibble of two variables: oncotree_code and umls_code.

Examples

# Leave `oncotree_code` empty to return mappings for all OncoTree codes
oncotree_to_umls()
#> # A tibble: 885 × 2
#>    oncotree_code umls_code
#>    <chr>         <list>   
#>  1 MMB           <chr [1]>
#>  2 GCB           <NULL>   
#>  3 SBLU          <NULL>   
#>  4 OHNCA         <NULL>   
#>  5 PAOS          <chr [1]>
#>  6 TMDS          <NULL>   
#>  7 ARMS          <chr [1]>
#>  8 SCST          <chr [1]>
#>  9 ITLPDGI       <NULL>   
#> 10 MBC           <chr [1]>
#> # … with 875 more rows

# Map a few selected OncoTree codes
oncotree_to_umls(oncotree_code = c('PAOS', 'SCST', 'ITLPDGI', 'SRCCR'))
#> # A tibble: 4 × 2
#>   oncotree_code umls_code
#>   <chr>         <list>   
#> 1 PAOS          <chr [1]>
#> 2 SCST          <chr [1]>
#> 3 ITLPDGI       <NULL>   
#> 4 SRCCR         <chr [2]>

# Use `expand` to make sure the column `umls_code` is a character vector and
# not a list-column. One-to-many mappings will result in more than row with
# `oncotree_code` values repeated.
oncotree_to_umls(oncotree_code = c('PAOS', 'SCST', 'ITLPDGI', 'SRCCR'),
  expand = TRUE)
#> # A tibble: 5 × 2
#>   oncotree_code umls_code
#>   <chr>         <chr>    
#> 1 PAOS          C0206642 
#> 2 SCST          C0600113 
#> 3 ITLPDGI       NA       
#> 4 SRCCR         C0279654 
#> 5 SRCCR         C1707436 

# Use `keep_empty` to drop or keep one-to-none mappings
oncotree_to_umls(oncotree_code = c('PAOS', 'SCST', 'ITLPDGI', 'SRCCR'),
  expand = TRUE, keep_empty = FALSE)
#> # A tibble: 4 × 2
#>   oncotree_code umls_code
#>   <chr>         <chr>    
#> 1 PAOS          C0206642 
#> 2 SCST          C0600113 
#> 3 SRCCR         C0279654 
#> 4 SRCCR         C1707436