yueqiw / shiny_cell_browser

Shiny browser for single cell RNAseq data
9 stars 3 forks source link

Seurat v3 - Cannot load v3 data into Shiny Cell Browser #7

Closed gringer closed 3 years ago

gringer commented 3 years ago

I'm getting a few issues when running shiny_cell_browser on my computer. These issues started with the following error:

2020-10-05 21:51:52 INFO::loading data...
Warning: Error in SetAllIdent: could not find function "SetAllIdent"
  50: read_data [/app/server.R#33]
Error in SetAllIdent(seurat_data, x$cluster) : 
  could not find function "SetAllIdent"

This error can be fixed by using the Idents function: https://github.com/satijalab/seurat/issues/1076

I made the following fix:

- seurat_data <- SetAllIdent(seurat_data, x$cluster)
+ Idents(seurat_data) <- x$cluster

But there was another error:

Warning: Error in read_data: no slot of name "cell.names" for this object of class "Seurat"
  50: read_data [/app/server.R#34]

So I made another fix:

- ncells <- length(seurat_data@cell.names)
+ ncells <- ncols(seurat_data)

... And another fix:

- colors <- sample(rainbow(n_distinct(seurat_data@ident)))
+ colors <- sample(rainbow(n_distinct(Idents(seurat_data))))

... And another fix:

- genes <- sort(rownames(seurat_data@data))
+ genes <- sort(rownames(seurat_data))
yueqiw commented 3 years ago

Thanks for trying out the app!

As mentioned in the set-up guide, the master branch currently supports Seurat2. For Seurat3 datasets, please check out the seurat3 branch.

git checkout seurat3

This branch contains the code that should work for Seurat 3 datasets. Let me know if you run into other issues.

Yueqi

gringer commented 3 years ago

Huh.... Thanks for getting me to re-check. I thought I was using the seurat3 branch, but it looks like I was on the master branch instead.

yueqiw commented 3 years ago

Glad it works.

gringer commented 3 years ago

Unfortunately it's still not working for me (something to do with colour assignment to clusters), but I'm still trying to work out precisely what the problem is, and I suspect at the moment I might have a weirdly-formatted Seurat object.