yanwu2014 / swne

Similarity Weighted Nonnegative Embedding (SWNE), a method for visualizing high dimensional datasets
BSD 3-Clause "New" or "Revised" License
103 stars 20 forks source link

EmbedSWNE fails #2

Closed bobermayer closed 6 years ago

bobermayer commented 6 years ago

Hi,

I have a large dataset with more than 20k cells. trying

swne.embedding <- EmbedSWNE(nmf.scores, snn, alpha.exp=alpha.exp, snn.exp=snn.exp, n_pull=3, dist.use='IC')

I get the following error:

Error in SNN %*% t(H) : 
  Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90

although the dimensions should match (after subsetting snn to the relevant cells):

dim(nmf.scores)
[1]     4 20565
dim(snn)
[1] 20565 20565

any ideas what's wrong here?

thanks!

yanwu2014 commented 6 years ago

Ah that might be because in certain corner cases we need to filter the NMF matrix for columns with all zeros, which may cause the dimensions to be off. I've pushed an update to SWNE. Can you reinstall the package and see if you're still getting the bug?

bobermayer commented 6 years ago

yes, thanks a lot, that fixed it!