Skip to contents

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

Usage

umls_to_oncotree(
  umls_code = NULL,
  oncotree_version = "oncotree_latest_stable",
  expand = FALSE
)

Arguments

umls_code

UMLS 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.

Value

A tibble of two variables: umls_code and oncotree_code.

Examples

# Leave `umls_code` empty to return mappings for all UMLS codes
umls_to_oncotree()
#> # A tibble: 533 × 2
#>    umls_code oncotree_code
#>    <chr>     <list>       
#>  1 C0001625  <chr [1]>    
#>  2 C0002991  <chr [1]>    
#>  3 C0003810  <chr [1]>    
#>  4 C0004114  <chr [1]>    
#>  5 C0005423  <chr [1]>    
#>  6 C0005682  <chr [1]>    
#>  7 C0005767  <chr [1]>    
#>  8 C0006141  <chr [1]>    
#>  9 C0006413  <chr [1]>    
#> 10 C0006826  <chr [1]>    
#> # … with 523 more rows

# Map a few selected OncoTree codes
umls_to_oncotree(umls_code = c('C0206642', 'C0600113', 'C0279654', 'C1707436'))
#> # A tibble: 4 × 2
#>   umls_code oncotree_code
#>   <chr>     <list>       
#> 1 C0206642  <chr [1]>    
#> 2 C0279654  <chr [1]>    
#> 3 C0600113  <chr [1]>    
#> 4 C1707436  <chr [1]>    

# Use `expand` to make sure the column `oncotree_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.
umls_to_oncotree(umls_code = c('C0206642', 'C0600113', 'C0279654', 'C1707436'), expand = TRUE)
#> # A tibble: 4 × 2
#>   umls_code oncotree_code
#>   <chr>     <chr>        
#> 1 C0206642  PAOS         
#> 2 C0600113  SCST         
#> 3 C0279654  SRCCR        
#> 4 C1707436  SRCCR