Skip to contents

This function maps National Cancer Institute Thesaurus (NCIt) codes to OncoTree codes.

Usage

nci_to_oncotree(
  nci_code = NULL,
  oncotree_version = "oncotree_latest_stable",
  expand = FALSE
)

Arguments

nci_code

NCI 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: nci_code and oncotree_code.

Examples

# Leave `nci_code` empty to return mappings for all NCI codes
nci_to_oncotree()
#> # A tibble: 517 × 2
#>    nci_code oncotree_code
#>    <chr>    <list>       
#>  1 C121932  <chr [1]>    
#>  2 C12311   <chr [1]>    
#>  3 C12366   <chr [1]>    
#>  4 C12391   <chr [1]>    
#>  5 C12392   <chr [1]>    
#>  6 C12393   <chr [1]>    
#>  7 C12400   <chr [1]>    
#>  8 C12401   <chr [1]>    
#>  9 C12404   <chr [1]>    
#> 10 C12405   <chr [1]>    
#> # … with 507 more rows

# Map a few selected OncoTree codes
nci_to_oncotree(nci_code = c('C8969', 'C4862', 'C9168', 'C7967'))
#> # A tibble: 4 × 2
#>   nci_code oncotree_code
#>   <chr>    <list>       
#> 1 C4862    <chr [1]>    
#> 2 C7967    <chr [1]>    
#> 3 C8969    <chr [1]>    
#> 4 C9168    <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.
nci_to_oncotree(nci_code = c('C8969', 'C4862', 'C9168', 'C7967'), expand =
TRUE)
#> # A tibble: 4 × 2
#>   nci_code oncotree_code
#>   <chr>    <chr>        
#> 1 C8969    PAOS         
#> 2 C4862    SCST         
#> 3 C9168    SRCCR        
#> 4 C7967    SRCCR