## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## -----------------------------------------------------------------------------
library(IDConverter)

# TCGA sample ID → patient ID
convert_tcga("TCGA-02-0001-10")

# ICGC specimen → donor
convert_icgc("SP29019")

# PCAWG specimen → donor
convert_pcawg("SP1677")

## ----eval=FALSE---------------------------------------------------------------
# # Symbol → Ensembl (human)
# convert_hm_genes(c("TP53", "KRAS"), type = "symbol")
# 
# # Ensembl → Symbol (human)
# convert_hm_genes("ENSG00000141510")
# 
# # Human → Mouse orthologs
# convert_hm_orthologs(c("TP53", "KRAS"))

## ----eval=FALSE---------------------------------------------------------------
# # List available tables
# ls_annotables()
# 
# # Load from Zenodo (fixed version, works offline)
# grch38 <- load_data("grch38")
# 
# # Or build from Ensembl BioMart (latest, requires biomaRt + internet)
# grch38_latest <- build_annotables("grch38", tx2gene = FALSE)

## -----------------------------------------------------------------------------
dt <- data.table::data.table(
  UpperCase = LETTERS[1:5],
  LowerCase = letters[1:5]
)
convert_custom(c("B", "C", "E"), from = "UpperCase", to = "LowerCase", dt = dt)

