Skip to content

Commit

Permalink
Update R/SEraster.R
Browse files Browse the repository at this point in the history
Co-authored-by: David Collins <[email protected]>
  • Loading branch information
zskylarli and dcollins15 authored Jun 12, 2024
1 parent c503f95 commit de8a734
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/SEraster.R
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,13 @@ RunPermutateByRotation <- function(input, n_perm = 1, verbose = FALSE) {
if (is.list(input)) {
pos_comb <- do.call(rbind, lapply(seq_along(input), function(i) {
pos <- GetTissueCoordinates(input[[i]], scale = NULL)
if ("cell" %in% colnames(pos)) {
rownames(pos) <- pos$cell
}
dataset <- ifelse(!is.null(names(input)), names(input)[[i]], i)
return(data.frame(dataset = dataset, x = pos[, 1], y = pos[, 2]))
dataset <- data.frame(dataset = dataset, x = pos[, 1], y = pos[, 2])
rownames(dataset) <- rownames(pos)
return (dataset)
}))
midrange_pt <- rearrr::midrange(pos_comb, cols = c("x", "y"))

Expand Down

0 comments on commit de8a734

Please sign in to comment.