From 5fd77ce4362aa91dfd1a918c165dd2f5b149ba0c Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Mon, 6 Jan 2025 15:34:36 -0500 Subject: [PATCH] load diseaseCodes from TCGAutils --- R/setup_subtype_clonality.R | 11 ++++++++--- vignettes/subtypeHeterogeneity.Rmd | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/R/setup_subtype_clonality.R b/R/setup_subtype_clonality.R index 8bcd874..9b35d77 100644 --- a/R/setup_subtype_clonality.R +++ b/R/setup_subtype_clonality.R @@ -7,8 +7,13 @@ # ############################################################ +## DATA LOAD +dataenv <- new.env(parent = emptyenv()) +data("diseaseCodes", package = "TCGAutils", envir = dataenv) +diseaseCodes <- dataenv[["diseaseCodes"]] + ## SETUP -ctypes <- TCGAutils::diseaseCodes[,"Study.Abbreviation"] +ctypes <- diseaseCodes[,"Study.Abbreviation"] ## cancer types .isSubClonal <- function(x) as.integer(x$Subclonal_HSCN_a1 | x$Subclonal_HSCN_a2) @@ -56,7 +61,7 @@ ctypes <- TCGAutils::diseaseCodes[,"Study.Abbreviation"] ## GISTIC # @returns: a RangedSummarizedExperiment -gistic2RSE <- function(ctype=TCGAutils::diseaseCodes[,"Study.Abbreviation"], +gistic2RSE <- function(ctype=ctypes, peak=c("wide", "narrow", "full"), cache=TRUE) { ctype <- match.arg(ctype) @@ -141,7 +146,7 @@ gistic2RSE <- function(ctype=TCGAutils::diseaseCodes[,"Study.Abbreviation"], ## Broad subtypes # @returns: a matrix with sample IDs as rownames and at least a column "cluster" -getBroadSubtypes <- function(ctype=TCGAutils::diseaseCodes[,"Study.Abbreviation"], +getBroadSubtypes <- function(ctype=ctypes, clust.alg=c("CNMF", "Consensus_Plus"), cache=TRUE) { ctype <- match.arg(ctype) diff --git a/vignettes/subtypeHeterogeneity.Rmd b/vignettes/subtypeHeterogeneity.Rmd index 409601a..251d9a6 100644 --- a/vignettes/subtypeHeterogeneity.Rmd +++ b/vignettes/subtypeHeterogeneity.Rmd @@ -63,7 +63,8 @@ names(stcols) <- SUBTYPES ## Cancer types ```{r ctypes} -TCGAutils::diseaseCodes[,c("Study.Abbreviation", "Study.Name")] +data("diseaseCodes", package = "TCGAutils") +diseaseCodes[,c("Study.Abbreviation", "Study.Name")] ``` ## ABSOLUTE