From 0e934405ec93e7cd6967f83af17abc164a2b5f8e Mon Sep 17 00:00:00 2001 From: myushen Date: Mon, 13 Jul 2026 15:59:43 +1000 Subject: [PATCH 1/4] update alive MT genes identification --- R/functions.R | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/R/functions.R b/R/functions.R index eb2cd93..266ef5e 100644 --- a/R/functions.R +++ b/R/functions.R @@ -48,7 +48,7 @@ empty_droplet_id <- function(input_read_RNA_assay, # Get counts if (inherits(input_read_RNA_assay, "Seurat")) { - counts <- GetAssayData(input_read_RNA_assay, assay, slot = "counts") + counts <- GetAssayData(input_read_RNA_assay, assay, layer = "counts") } else if (inherits(input_read_RNA_assay, "SingleCellExperiment")) { counts <- assay(input_read_RNA_assay, assay) } @@ -269,7 +269,7 @@ empty_droplet_threshold<- function(input_read_RNA_assay, # Get counts if (inherits(input_read_RNA_assay, "Seurat")) { - counts <- GetAssayData(input_read_RNA_assay, assay, slot = "counts") + counts <- GetAssayData(input_read_RNA_assay, assay, layer = "counts") } else if (inherits(input_read_RNA_assay, "SingleCellExperiment")) { counts <- assay(input_read_RNA_assay, assay) } @@ -634,7 +634,7 @@ alive_identification <- function(input_read_RNA_assay, if (inherits(input_read_RNA_assay, "Seurat")) { - counts <- GetAssayData(input_read_RNA_assay, assay = assay, slot = "counts") + counts <- GetAssayData(input_read_RNA_assay, assay = assay, layer = "counts") if (!any(str_which(colnames(input_read_RNA_assay[[]]), nFeature_name)) || !any(str_which(colnames(input_read_RNA_assay[[]]), nCount_name))) { input_read_RNA_assay[[nFeature_name]] <- @@ -661,21 +661,19 @@ alive_identification <- function(input_read_RNA_assay, # Returns a named vector of IDs # Matches the gene id's row by row and inserts NA when it can't find gene names - if (feature_nomenclature == "symbol") { - location <- mapIds( + location <- mapIds( EnsDb.Hsapiens.v86, - keys=rownames(input_read_RNA_assay), - column="SEQNAME", - keytype="SYMBOL" + keys = rownames(input_read_RNA_assay), + column = "SEQNAME", + keytype = if (feature_nomenclature == "symbol") "SYMBOL" else "GENEID" ) - } - which_mito = rownames(input_read_RNA_assay) |> str_which("^MT") + which_mito = which(location == "MT") # mitochondrion = # input_read_RNA_assay |> - # GetAssayData( slot = "counts", assay=assay) |> + # GetAssayData( layer = "counts", assay=assay) |> # # # Join mitochondrion statistics # # Compute per-cell quality control metrics for a count matrix or a SingleCellExperiment From 3813c993e7ad936d2b6dda9ba40819736814588b Mon Sep 17 00:00:00 2001 From: myushen Date: Mon, 13 Jul 2026 16:00:52 +1000 Subject: [PATCH 2/4] version bump --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a930f22..f6c0080 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: HPCell Title: Massively-Parallel R Native Pipeline for Single-Cell Analysis -Version: 0.5.0 +Version: 0.5.1 Authors@R: c(person("Stefano", "Mangiola", email = "mangiolastefano@gmail.com", role = c("aut", "cre")), person("Jiayi", "Si", email = "si.j@wehi.edu.au", From eed4c4c24679b4bf3a56eb6e8021550188ed998f Mon Sep 17 00:00:00 2001 From: myushen Date: Tue, 14 Jul 2026 11:28:04 +1000 Subject: [PATCH 3/4] move celldex to suggest --- .github/workflows/rworkflows.yml | 8 +++++++- DESCRIPTION | 2 +- R/functions.R | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rworkflows.yml b/.github/workflows/rworkflows.yml index 86ee2b3..92bb725 100644 --- a/.github/workflows/rworkflows.yml +++ b/.github/workflows/rworkflows.yml @@ -40,6 +40,12 @@ jobs: cont: ~ rspm: ~ steps: + - name: Prefer source installs on macOS as fallback (Bioc 3.23 mac binary gap) + if: runner.os == 'macOS' + run: | + mkdir -p ~/.R + echo 'options(install.packages.check.source = "no", pkgType = "source")' >> ~/.Rprofile + shell: bash - uses: neurogenomics/rworkflows@master with: run_bioccheck: ${{ false }} @@ -56,4 +62,4 @@ jobs: DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} runner_os: ${{ runner.os }} cache_version: cache-v1 - docker_registry: ghcr.io + docker_registry: ghcr.io \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index f6c0080..24c4e97 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,6 @@ Imports: EnsDb.Hsapiens.v86, scater, SingleR, - celldex, scuttle, scDblFinder, magrittr, @@ -74,6 +73,7 @@ Imports: rhdf5 Suggests: testthat (>= 3.0.0), + celldex, qs, Azimuth, CellChat, diff --git a/R/functions.R b/R/functions.R index 266ef5e..b991dc9 100644 --- a/R/functions.R +++ b/R/functions.R @@ -390,6 +390,12 @@ annotation_label_transfer <- function(input_read_RNA_assay, colnames(input_read_RNA_assay)[2]= "dummy___" } + if (!requireNamespace("celldex", quietly = TRUE)) + stop( + "Package 'celldex' is required for SingleR-based cell-type annotation. ", + "Install it with: BiocManager::install('celldex')" + ) + #snapshotDate(): 2025-10-29 blueprint <- celldex::BlueprintEncodeData( ensembl = feature_nomenclature == "ensembl" From bcf79bd1188ba8fabc2e84eb35232b1d02f88d52 Mon Sep 17 00:00:00 2001 From: myushen Date: Tue, 14 Jul 2026 11:37:07 +1000 Subject: [PATCH 4/4] remove celldex namespace --- NAMESPACE | 2 -- R/functions.R | 2 -- 2 files changed, 4 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 77d78e2..8889e79 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -156,8 +156,6 @@ importFrom(SummarizedExperiment,rowData) importFrom(biomaRt,getBM) importFrom(biomaRt,useMart) importFrom(callr,r) -importFrom(celldex,BlueprintEncodeData) -importFrom(celldex,MonacoImmuneData) importFrom(crew,crew_controller_local) importFrom(data.table,":=") importFrom(digest,digest) diff --git a/R/functions.R b/R/functions.R index b991dc9..0d25031 100644 --- a/R/functions.R +++ b/R/functions.R @@ -312,8 +312,6 @@ empty_droplet_threshold<- function(input_read_RNA_assay, #' #' @return A tibble with cell-type annotation data. #' -#' @importFrom celldex BlueprintEncodeData -#' @importFrom celldex MonacoImmuneData #' #' @importFrom Seurat CreateAssayObject #' @importFrom Seurat SCTransform