Skip to content

Commit

Permalink
Merge pull request #199 from zhanghao-njmu/develop
Browse files Browse the repository at this point in the history
Fix some bugs
  • Loading branch information
zhanghao-njmu authored Nov 2, 2023
2 parents 887a1bc + 6e53e8e commit 063c3a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion R/SCP-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion R/SCP-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion R/SCP-cellqc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion R/Seurat-function.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 063c3a5

Please sign in to comment.