Skip to content

Commit

Permalink
update coordinate headers for as.SpatialExperiment
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur-man committed Jan 15, 2025
1 parent f72203a commit 44ad3b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,8 @@ as.SpatialExperiment <- function(object, assay = NULL, reg = FALSE){
# coordinates
coords <- as.matrix(vrCoordinates(flipCoordinates(object, assay = assay), assay = assay, reg = reg))
coords <- coords[colnames(rawdata),]
coords <- coords[,c("x", "y")]
colnames(coords) <- c("x_centroid", "y_centroid")

# Seurat object
spe <- SpatialExperiment::SpatialExperiment(assay=list(counts = rawdata),
Expand Down

0 comments on commit 44ad3b9

Please sign in to comment.