Closed odunola26 closed 1 week ago
The fov
parameter just takes the name of the FOV
instance stored in your object - in your case, you just need to do:
sample39_obj <- BuildNicheAssay(
object = sample39_obj,
fov = "fov",
group.by = "predicted.celltype",
assay = "niche",
cluster.name = "niches",
neighbors.k = 30,
niches.k = 5
)
Thanks @dcollins15
fov didn´t work. I tried with 'slice1' and it worked.
thank you.
Hello,
Please , i am trying to run "BuildNicheAssay" on my 10x visium data, but I am having error with the Fov, please can you guide me on how i can access this from my seurat object. here is my code :
Extract spatial coordinates from the centroids object coords <- sample39_obj@images$slice1@boundaries$centroids@coords coords
Ensure the coordinates matrix has proper row names rownames(coords) <- sample39_obj@images$slice1@boundaries$centroids@cells
Create the FOV list with the correct format fov <- list(FOV = coords)
Run BuildNicheAssay sample39_obj <- BuildNicheAssay( object = sample39_obj, fov = fov, group.by = "predicted.celltype", assay = "niche", cluster.name = "niches", neighbors.k = 30, niches.k = 5 )
HERE the error message i got: Error in
object[[fov]]
: ! 'i' must be a character vector Runrlang::last_trace()
to see where the error occurred.Thank you. Odunola