Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
v5 seurat handling
  • Loading branch information
ncborcherding committed Oct 23, 2024
1 parent d89f74e commit 850adbe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: escape
Title: Easy single cell analysis platform for enrichment
Version: 2.1.4
Date: 2024-09-19
Version: 2.1.5
Date: 2024-10-23
Authors@R: c(
person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "[email protected]"),
person(given = "Jared", family = "Andrews", role = c("aut"), email = "[email protected]"),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ importFrom(Matrix,colSums)
importFrom(MatrixGenerics,rowSds)
importFrom(MatrixGenerics,rowSums2)
importFrom(SeuratObject,Assays)
importFrom(SeuratObject,CreateAssay5Object)
importFrom(SeuratObject,CreateAssayObject)
importFrom(SeuratObject,CreateDimReducObject)
importFrom(SeuratObject,Idents)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# escape VERSION 2.1.5 (2024-10-23)

* update handling of v5 Seurat versus <v5 Seurat Objects

# escape VERSION 2.1.4 (2024-09-13)

* update ```densityEnrichment()``` GSVA function pull
Expand Down
11 changes: 8 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,18 @@ is_seurat_or_se_object <- function(obj) {
}

#Add the values to single cell object
#' @importFrom SeuratObject CreateAssayObject
#' @importFrom SeuratObject CreateAssayObject CreateAssay5Object
#' @importFrom SummarizedExperiment SummarizedExperiment assays<-
#' @importFrom SingleCellExperiment altExps altExp<-
.adding.Enrich <- function(sc, enrichment, enrichment.name) {
if (inherits(sc, "Seurat")) {
new.assay <- suppressWarnings(CreateAssayObject(
data = as.matrix(t(enrichment))))
if (as.numeric(substr(sc@version,1,1)) == 5) {
new.assay <- suppressWarnings(CreateAssay5Object(
data = as.matrix(t(enrichment))))
} else {
new.assay <- suppressWarnings(CreateAssayObject(
data = as.matrix(t(enrichment))))
}

suppressWarnings(sc[[enrichment.name]] <- new.assay)
} else if (inherits(sc, "SingleCellExperiment")) {
Expand Down

0 comments on commit 850adbe

Please sign in to comment.