Skip to content

Commit

Permalink
fix #141
Browse files Browse the repository at this point in the history
  • Loading branch information
dputhier committed Jan 9, 2024
1 parent 52b0219 commit 1c84726
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
20 changes: 18 additions & 2 deletions R/dist2border.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,25 @@ plot_stratum <- function(seurat_obj=NULL,
if(intensity_slot=="sct"){
slot_intensity <- seurat_obj@assays$SC
}else if(intensity_slot=="counts"){
slot_intensity <- seurat_obj@assays$Spatial@counts

slot_intensity <- try({
seurat_obj@assays$Spatial$counts
}, silent = TRUE)

if (class(slot_intensity) == "try-error") {
slot_intensity <- seurat_obj@assays$Spatial@counts
}

}else if(intensity_slot=="data"){
slot_intensity <- seurat_obj@assays$Spatial@data

slot_intensity <- try({
seurat_obj@assays$Spatial$data
}, silent = TRUE)

if (class(slot_intensity) == "try-error") {
slot_intensity <- seurat_obj@assays$Spatial@data
}

}

if(is.null(slot_intensity))
Expand Down
22 changes: 20 additions & 2 deletions R/plot_spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,29 @@ plot_spatial <- function(seurat_obj=NULL,

}else{
if(intensity_slot=="sct"){

slot_intensity <- seurat_obj@assays$SC

}else if(intensity_slot=="counts"){
slot_intensity <- seurat_obj@assays$Spatial@counts

slot_intensity <- try({
seurat_obj@assays$Spatial$counts
}, silent = TRUE)

if (class(slot_intensity) == "try-error") {
slot_intensity <- seurat_obj@assays$Spatial@counts
}

}else if(intensity_slot=="data"){
slot_intensity <- seurat_obj@assays$Spatial@data

slot_intensity <- try({
seurat_obj@assays$Spatial$data
}, silent = TRUE)

if (class(slot_intensity) == "try-error") {
slot_intensity <- seurat_obj@assays$Spatial@data
}

}

if(is.null(slot_intensity))
Expand Down

0 comments on commit 1c84726

Please sign in to comment.