From 1158e94040f0bd2686f6a6860108ed814be22ae1 Mon Sep 17 00:00:00 2001 From: Vince Carey Date: Sun, 29 Sep 2024 06:17:19 -0400 Subject: [PATCH 1/4] Update DESCRIPTION remove import of ontoProc --- DESCRIPTION | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 42a8ca1..6a0728a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: xCell2 Type: Package Title: A Tool for Generic Cell Type Enrichment Analysis -Version: 0.99.5 +Version: 0.99.5001 Authors@R: c(person(given = "Almog", family = "Angel", @@ -23,7 +23,6 @@ Imports: SummarizedExperiment, Rfast, singscore, - ontoProc, ontologyIndex, tibble, dplyr, From dd46f220395303baa427b3709d391d405183254c Mon Sep 17 00:00:00 2001 From: Vince Carey Date: Sun, 29 Sep 2024 06:20:29 -0400 Subject: [PATCH 2/4] Update xCell2GetLineage.R, remove ontoProc refs adds getOntoLocal --- R/xCell2GetLineage.R | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/R/xCell2GetLineage.R b/R/xCell2GetLineage.R index bef5d4c..e854706 100644 --- a/R/xCell2GetLineage.R +++ b/R/xCell2GetLineage.R @@ -4,7 +4,6 @@ #' If no output file is specified, the function returns a list of cell type dependencies. #' If an output file is specified, the function writes the cell type dependencies to a TSV file. #' -#' @importFrom ontoProc getOnto #' @importFrom ontologyIndex get_descendants get_ancestors #' @importFrom dplyr select mutate rowwise #' @importFrom tibble as_tibble @@ -57,7 +56,7 @@ xCell2GetLineage <- function(labels, outFile = NULL) { lineageOut <- labelsUniq %>% dplyr::mutate(descendants = "", ancestors = "") } else { - cl <- ontoProc::getOnto(ontoname = "cellOnto", year_added = "2023") + cl <- getOntoLocal(ontoname = "cellOnto", year_added = "2023") labelsUniq$descendants <- NA labelsUniq$ancestors <- NA for (i in seq_len(nrow(labelsUniq))) { @@ -99,3 +98,32 @@ xCell2GetLineage <- function(labels, outFile = NULL) { warning("It is recommended that you manually check the cell type lineage file: ", outFile) } } + +getOntoLocal = function( ontoname="cellOnto", year_added = "2023" ) { + stopifnot(ontoname %in% c("caro", "cellLineOnto", "cellOnto", "cellosaurusOnto", "chebi_full", +"chebi_lite", "diseaseOnto", "efoOnto", "goOnto", "hcaoOnto", "mondo", +"patoOnto", "PROnto", "uberon", "Pronto") # only Pronto will get a 2021 PRO +} + ah = AnnotationHub::AnnotationHub() + opd = AnnotationHub::query(ah, "ontoProcData") + meta = mcols(opd) + tmp = meta |> as.data.frame() |> dplyr::filter(grepl(year_added, rdatadateadded)) |> dplyr::select(title, description) + + + if (year_added == "2023") { + if( ontoname %in% c("caro", "cellLineOnto")) stop("this ontology not updated in 2023, use a different year_added value") + ontoname = paste0(ontoname, "_") + stopifnot(length(grep(ontoname, tmp$title))==1) + } + else if (year_added == "2022") { + ontoname = paste0(ontoname, "_") + stopifnot(length(grep(ontoname, tmp$title))==1) + } + else if (year_added == "2021") { + stopifnot(length(grep(paste0("^", ontoname, "$"), tmp$title))==1) + } + tmp = tmp |> filter(grepl(ontoname, title)) + tag = rownames(tmp) + stopifnot(length(tag)==1) + ah[[tag]] +} From a05d1872b88570fd1f3d708fb6cf67cccea1ea20 Mon Sep 17 00:00:00 2001 From: Vince Carey Date: Sun, 29 Sep 2024 06:23:33 -0400 Subject: [PATCH 3/4] fix typo --- R/xCell2GetLineage.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/xCell2GetLineage.R b/R/xCell2GetLineage.R index e854706..a3e0e63 100644 --- a/R/xCell2GetLineage.R +++ b/R/xCell2GetLineage.R @@ -103,7 +103,7 @@ getOntoLocal = function( ontoname="cellOnto", year_added = "2023" ) { stopifnot(ontoname %in% c("caro", "cellLineOnto", "cellOnto", "cellosaurusOnto", "chebi_full", "chebi_lite", "diseaseOnto", "efoOnto", "goOnto", "hcaoOnto", "mondo", "patoOnto", "PROnto", "uberon", "Pronto") # only Pronto will get a 2021 PRO -} + ah = AnnotationHub::AnnotationHub() opd = AnnotationHub::query(ah, "ontoProcData") meta = mcols(opd) From e60655c8766ff70ed94b40802d62e0c1bca52085 Mon Sep 17 00:00:00 2001 From: Vince Carey Date: Sun, 29 Sep 2024 06:24:22 -0400 Subject: [PATCH 4/4] fix typo --- R/xCell2GetLineage.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/xCell2GetLineage.R b/R/xCell2GetLineage.R index a3e0e63..20197e7 100644 --- a/R/xCell2GetLineage.R +++ b/R/xCell2GetLineage.R @@ -102,7 +102,7 @@ xCell2GetLineage <- function(labels, outFile = NULL) { getOntoLocal = function( ontoname="cellOnto", year_added = "2023" ) { stopifnot(ontoname %in% c("caro", "cellLineOnto", "cellOnto", "cellosaurusOnto", "chebi_full", "chebi_lite", "diseaseOnto", "efoOnto", "goOnto", "hcaoOnto", "mondo", -"patoOnto", "PROnto", "uberon", "Pronto") # only Pronto will get a 2021 PRO +"patoOnto", "PROnto", "uberon", "Pronto")) # only Pronto will get a 2021 PRO ah = AnnotationHub::AnnotationHub() opd = AnnotationHub::query(ah, "ontoProcData")