kstreet13 / slingshot

Functions for identifying and characterizing continuous developmental trajectories in single-cell data.
259 stars 42 forks source link

Error in igraph::shortest_paths(tree, from = l, to = ends, mode = "out", : At core/paths/dijkstra.c:360 : Weight vector must not contain NaN values, Invalid value #232

Closed abulislam closed 9 months ago

abulislam commented 9 months ago

Hi

sce <- slingshot(sce, reducedDim = 'UMAP', clusterLabels = colData(sce)$CellType, approx_points = 150, start.clus = NULL)

Error in igraph::shortest_paths(tree, from = l, to = ends, mode = "out", : At core/paths/dijkstra.c:360 : Weight vector must not contain NaN values, Invalid value

sce class: SingleCellExperiment dim: 15642 25540 metadata(0): assays(3): counts logcounts scaledata rownames(15642): ATAD3B PRDM16 ... MIR4290HG FAM90A27P rowData names(0): colnames(25540): AAACGAATCTGTGTGA-1 GGGACAATCCACAGGC-1 ... OA2_TCTACATCAGGTTCGC-1 OA2_TCTACCGTCTAGGCCG-1 colData names(14): orig.ident nCount_RNA ... CellType ident

reducedDimNames(4): PCA TSNE UMAP HARMONY mainExpName: RNA altExpNames(0):


same error when used "seurat_clusters" as clusterLabels. But do not get error when used "treatment" column (has one treatment and one reference)

There are 27 seurat clusters and 44 different cell types. There is no missing value (NA, NaN) in UMAP or in cellType

What to do to solve this, please?

Many Thanks,

abulislam commented 9 months ago

We solve this by removing those cellTypes that don't have at least 20 cells annotated.

kstreet13 commented 9 months ago

Hi @abulislam ,

That is odd, but as you seem to have figured out, my first guess would be that it was an issue with cluster sizes. This error often results from clusters with 1 or 2 cells.

Glad you were able to resolve it!

Best, Kelly

TdzBAS commented 7 months ago

I can confirm, that the small cluster size was the issue for me as well.