Skip to content

Error: subscript contains invalid names #148

@Tycooner

Description

@Tycooner

Thank you for developing such a powerful tool—BayesSpace!!
I encountered a runtime error and would like to ask for help.
I'm working with BGI's Stereo-seq data, stored as a Seurat .rds file. Based on previous suggestions, I converted the Seurat object into a SingleCellExperiment format. However, when running the following step:

sce = spatialCluster(sce, nrep = 1000, burn.in = 100, q = 10)

but get error: “Error: subscript contains invalid names” . I wonder if this issue is related to the data structure. Could you please advise on how to resolve this error?

Below is the full code I used:

library(Seurat)
library(SeuratData)
library(BayesSpace)
library(tidyverse)

seurat = readRDS("LP3_cluster.rds") # load Seurat data

seurat = Seurat::FindVariableFeatures(seurat)
seurat = Seurat::ScaleData(seurat)
seurat = Seurat::RunPCA(seurat)

Convert to SCE

diet.seurat = Seurat::DietSeurat(seurat, graphs = "pca")
sce = as.SingleCellExperiment(diet.seurat)
colData(sce) = cbind(colData(sce), seurat@images$st@coordinates)

BayesSpace Workflow

sce = spatialPreprocess(sce, platform = "Visium", skip.PCA = TRUE, log.normalize = FALSE)
sce = spatialCluster(sce, nrep = 1000, burn.in = 100, q = 10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions