Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/rworkflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -40,7 +40,6 @@ Imports:
EnsDb.Hsapiens.v86,
scater,
SingleR,
celldex,
scuttle,
scDblFinder,
magrittr,
Expand Down Expand Up @@ -74,6 +73,7 @@ Imports:
rhdf5
Suggests:
testthat (>= 3.0.0),
celldex,
qs,
Azimuth,
CellChat,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
28 changes: 15 additions & 13 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -390,6 +388,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"
Expand Down Expand Up @@ -634,7 +638,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]] <-
Expand All @@ -661,21 +665,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
Expand Down
Loading