rnabioco / clustifyr

Infer cell types in scRNA-seq data using bulk RNA-seq or gene sets
https://rnabioco.github.io/clustifyr/
MIT License
103 stars 14 forks source link

seurat_ref(): Error when building reference matrix from Seurat object (group length is 0 but data length >0) #366

Closed federicaress closed 3 years ago

federicaress commented 3 years ago

Hi! I encountered a problem: when I try to build a reference matrix from a Seurat object. If I write: myrefmatrix = seurat_ref ( seurat_object = <mySeuratObject)

the error is: error in split.default(colnames(mat), cluster_info_temp): group length is 0 but data length >0

I tried three different data sets and the error remains the same.

What should I do? Thank you for your time

Edit: typo

raysinensis commented 3 years ago

Hi, for seurat_ref, please also include the column name from the seurat object metadata to define which cells belong to which clusters. That error occurs when the default cluster_col isn't found. With an included tiny seurat object loaded with clustifyr:

myref <- seurat_ref(clustifyr::s_small3, cluster_col = "RNA_snn_res.1")

Please let us know if that doesn't fix issues. We will try to make error messages more informative in the future.

raysinensis commented 3 years ago

Hi, please let us know if you still have issues. Closing for now.