
Download and cache a TCGA or TARGET expression dataset
LoadTCGA.RdDownloads a consolidated expression matrix and clinical metadata for a
TCGA or TARGET project and caches the result locally as an .rds
file. Subsequent calls with the same arguments load from the cache
instantly without re-downloading.
Arguments
- project
Character scalar. Project ID, e.g.
"TCGA-GBM","TCGA-LGG","TARGET-NBL". SeeSurvPlotfor the full list of available projects.- data_type
"rnaseq"(default) or"microarray"."microarray"forcesbackend = "TCGAbiolinks"automatically.- backend
Download engine.
"recount3"(default) fetches a single pre-consolidated matrix — fast and reliable."TCGAbiolinks"downloads one file per patient from the GDC API — use only when recount3 does not carry the project or for microarray data.- cache_dir
Directory for the cached
.rdsfile. Defaults to the OS user cache directory for scSidekick.- force_reload
Logical (default
FALSE). WhenTRUE, deletes the existing.rdscache file and re-downloads the dataset from scratch. Useful after adding TCGAbiolinks or when the upstream data have been updated. The new download is cached as usual.
Value
A named list with:
expr_matNumeric matrix, genes × samples,
log2(TPM + 1)values.metaData frame of clinical metadata, one row per sample.
projectProject ID string.
data_typeData modality used.
backendDownload engine used.
Details
The returned list can be passed directly to SurvMetaSummary
to explore available clinical columns before calling SurvPlot.
Examples
if (FALSE) { # \dontrun{
gbm <- LoadTCGA("TCGA-GBM")
SurvMetaSummary(gbm$meta)
SurvPlot(expr_mat = gbm$expr_mat,
meta = gbm$meta,
genes = c("YAP1", "S100A4"),
time_col = "OS",
status_col = "status",
facet_row = "gender",
facet_col = "paper_IDH.status",
output_file = "~/Desktop/GBM_survival/")
} # }