data-raw/data_schema.R

library(cbioportalR)
library(dplyr)
library(readr)

names_df <- read_csv(here::here("data-raw", "accepted-column-names.csv"),
                     trim_ws = TRUE)

names_df <- names_df %>%
  mutate(sc_maf_column_name = snakecase::to_snake_case(maf_column_name)) %>%
  mutate(sc_api_column_name = snakecase::to_snake_case(api_column_name)) %>%
  mutate(internal_column_name = case_when(
    sc_maf_column_name == "tumor_sample_barcode" ~ "sample_id",
    is.na(sc_maf_column_name) & !is.na(sc_api_column_name) ~ sc_api_column_name,
    TRUE ~ sc_maf_column_name
  ))



usethis::use_data(names_df, overwrite = TRUE)
AxelitoMartin/gnomeR documentation built on Oct. 18, 2024, 11:39 a.m.