drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
258 stars 98 forks source link

doLeidenCluster error #421

Closed zglu closed 1 year ago

zglu commented 1 year ago

Hi,

I used the Giotto docker image and encountered an error when doing doLeidenCluster():

Fatal error at src/core/vector.c:483 : Assertion failed: v->stor_begin != NULL

What could be the reason please?

Here are the commands that I ran:

library(Giotto)
library(Seurat)

expression_matrix = readExprMatrix("seqfish_field_expr.txt")
cell_locations = data.table::fread("seqfish_field_locs.txt")

my_giotto_object = createGiottoObject(raw_exprs = expression_matrix, spatial_locs = cell_locations)

my_giotto_object <- filterGiotto(gobject = my_giotto_object, 
                                 expression_threshold = 1, 
                                 gene_det_in_min_cells = 10, 
                                 min_det_genes_per_cell = 5)

my_giotto_object <- normalizeGiotto(gobject = my_giotto_object, scalefactor = 6000, verbose = T)

my_giotto_object <- addStatistics(gobject = my_giotto_object)
my_giotto_object <- adjustGiottoMatrix(gobject = my_giotto_object, 
                                   expression_values = c('normalized'),
                                   covariate_columns = c('nr_genes', 'total_expr'))

head(my_giotto_object@cell_metadata)

my_giotto_object <- calculateHVG(gobject = my_giotto_object, save_plot=TRUE)
my_giotto_object <- runPCA(gobject = my_giotto_object)
my_giotto_object <- runUMAP(my_giotto_object, dimensions_to_use = 1:10)

my_giotto_object <- createNearestNetwork(gobject = my_giotto_object, dimensions_to_use = 1:10, k = 5)
my_giotto_object = doLeidenCluster(my_giotto_object, name = 'leiden_clus')

Giotto version is 1.1.2 in the docker image. But doLouvainCluster() works.

Thanks, Zhigang

GCatatGC commented 1 year ago

I also got another issue when doing doLeidenCluster(): Error in py_run_file_impl(file, local, convert) : ImportError: DLL load failed while importing _c_leiden: The specified procedure could not be found.

josschavezf commented 1 year ago

Hi @zglu and @GCatatGC, thanks a lot for your feedback. I'll look at the docker image and see if updating it solves the issue. I'll be back to you by tomorrow morning. Thanks for your patience

zglu commented 1 year ago

Hi @josschavezf, that's a good hint. I just tried to upgrade the igraph python-igraph leidenalg libraries and it does solves the problem. Thanks a lot!

RubD commented 1 year ago

Thanks @josschavezf for help fixing this issue. I've moved the issue from @GCatatGC to a new issue and will close this one.