Browse code

Update lisaClust.R

Fix class issue

Ellis Patrick authored on 14/11/2022 00:10:18 • GitHub committed on 14/11/2022 00:10:18
Showing 1 changed files

... ...
@@ -64,7 +64,7 @@ lisaClust <-
64 64
         
65 65
         
66 66
         
67
-        if(is(cells, "SingleCellExperiment")){
67
+        if(class(cells) == "SingleCellExperiment"){
68 68
             cd <- as.data.frame(SingleCellExperiment::colData(cells))
69 69
             cd <- cd[,c(cellType, imageID, spatialCoords)]
70 70
             colnames(cd) <- c("cellType", "imageID", "x", "y")
... ...
@@ -87,7 +87,7 @@ lisaClust <-
87 87
             SummarizedExperiment::colData(cells)[regionName] <- regions
88 88
         }
89 89
         
90
-        if(is(cells, "SpatialExperiment")){
90
+        if(class(cells) == "SpatialExperiment"){
91 91
             cd <- cbind(as.data.frame(SingleCellExperiment::colData(cells)),as.data.frame(SpatialExperiment::spatialCoords(cells)))
92 92
             cd <- cd[,c(cellType, imageID, spatialCoords)]
93 93
             colnames(cd) <- c("cellType", "imageID", "x", "y")