From c1f3494c35fdf25039a442b7dc79097b31441adc Mon Sep 17 00:00:00 2001 From: vertesy Date: Thu, 20 Jun 2024 14:40:53 +0200 Subject: [PATCH] bf, comm processSeuratObject --- R/Seurat.Utils.R | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/R/Seurat.Utils.R b/R/Seurat.Utils.R index 23ef96a..4328399 100644 --- a/R/Seurat.Utils.R +++ b/R/Seurat.Utils.R @@ -59,22 +59,18 @@ processSeuratObject <- function(obj, param.list = p, add.meta.fractions = FALSE, ...) { # warning("Make sure you cleaned up the memory!", immediate. = TRUE) - tic() stopifnot(require(tictoc)) - message("nfeatures: ", nfeatures) - + tic() # Assertions to check input types _________________________________________________ stopifnot( "Seurat" %in% class(obj), is.list(param.list), all(c("n.PC", "snn_res") %in% names(param.list)), - is.numeric(n.PC), - is.numeric(resolutions), - is.character(variables.2.regress) | is.null(variables.2.regress) - ) - - .checkListElements(param_list = p, elements = c("variables.2.regress.combined", "n.PC", "snn_res")) + is.numeric(n.PC), is.numeric(resolutions), + is.character(variables.2.regress) | is.null(variables.2.regress), + "variables.2.regress is not found in @meta" = variables.2.regress %in% colnames(obj@meta.data) + ) iprint("nfeatures:", nfeatures) iprint("n.PC:", n.PC) @@ -87,6 +83,8 @@ processSeuratObject <- function(obj, param.list = p, add.meta.fractions = FALSE, param.list$"n.PC" <- n.PC param.list$"snn_res" <- resolutions + # .checkListElements(param_list = param.list, elements = c("variables.2.regress.combined", "n.PC", "snn_res")) + obj@misc$"p" <- param.list # overwrite previous parameters gc() @@ -5450,7 +5448,7 @@ compareVarFeaturesAndRanks <- function( if (is.null(param_list[[element]])) { warning(sprintf("`%s` is not defined", element), immediate. = TRUE, call. = FALSE) } else { - message(sprintf("`%s` is: %s", element, param_list[[element]])) + message(sprintf("`%s` is: %s", element, param_list[[element]]) ) } }, USE.NAMES = FALSE)