diff --git a/R/SCP-analysis.R b/R/SCP-analysis.R index 22cb5e0f..433a6e0b 100644 --- a/R/SCP-analysis.R +++ b/R/SCP-analysis.R @@ -4068,7 +4068,10 @@ RunMonocle2 <- function(srt, assay = NULL, slot = "counts", expressionFamily = " root_state = NULL, seed = 11) { set.seed(seed) check_R(c("monocle", "DDRTree", "BiocGenerics", "Biobase", "VGAM")) - attachNamespace("DDRTree") + + if (!"package:DDRTree" %in% search()) { + attachNamespace("DDRTree") + } assay <- assay %||% DefaultAssay(srt) expr_matrix <- as.sparse(GetAssayData(srt, assay = assay, slot = slot)) diff --git a/R/SCP-app.R b/R/SCP-app.R index b69f7e80..6750d394 100644 --- a/R/SCP-app.R +++ b/R/SCP-app.R @@ -591,7 +591,7 @@ RunSCExplorer <- function(base_dir = "SCExplorer", style_script = require("styler", quietly = TRUE), overwrite = FALSE, return_app = TRUE) { - check_R(c("rhdf5", "HDF5Array", "shiny@1.6.0", "ggplot2", "ragg", "htmlwidgets", "plotly", "bslib", "future", "promises", "BiocParallel")) + check_R(c("rhdf5", "HDF5Array", "shiny", "ggplot2", "ragg", "htmlwidgets", "plotly", "bslib", "future", "promises", "BiocParallel")) DataFile_full <- paste0(base_dir, "/", DataFile) MetaFile_full <- paste0(base_dir, "/", MetaFile) if (!file.exists(DataFile_full) || !file.exists(MetaFile_full)) { diff --git a/R/SCP-cellqc.R b/R/SCP-cellqc.R index 8287e678..00036637 100644 --- a/R/SCP-cellqc.R +++ b/R/SCP-cellqc.R @@ -344,7 +344,7 @@ RunCellQC <- function(srt, assay = "RNA", split.by = NULL, } status <- check_DataType(srt, slot = "counts", assay = assay) if (status != "raw_counts") { - stop("Data type is not raw counts!") + warning("Data type is not raw counts!") } if (!paste0("nCount_", assay) %in% colnames(srt@meta.data)) { srt@meta.data[[paste0("nCount_", assay)]] <- colSums(srt[[assay]]@counts) diff --git a/R/Seurat-function.R b/R/Seurat-function.R index 7dfe9272..a7b09cf7 100644 --- a/R/Seurat-function.R +++ b/R/Seurat-function.R @@ -120,7 +120,9 @@ RunNMF.default <- function(object, assay = NULL, slot = "data", nbes = 50, check_R("zdebruine/RcppML") options("RcppML.verbose" = FALSE) options("RcppML.threads" = 0) - attachNamespace("Matrix") + if (!"package:Matrix" %in% search()) { + attachNamespace("Matrix") + } nmf.results <- RcppML::nmf( t(object), k = nbes, tol = tol, maxit = maxit,