welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
376 stars 78 forks source link

Missing value OptimizeALS #263

Open mtegtmey opened 2 years ago

mtegtmey commented 2 years ago

I use LIGER pretty regularly for integrating in vitro datasets with brain atlas data but came across this error I've not previously seen before. Any thoughts would be greatly appreciated! I don't have any missing values in my metadata, so the error is confusing me a bit.

Error in if (trim > 0 && n) {: missing value where TRUE/FALSE needed Traceback:

  1. RunOptimizeALS(BICCN.hiAstro, k = 20, lambda = 5, split.by = "orig.ident")
  2. rliger::optimizeALS(object = scale.data, k = k, lambda = lambda, . thresh = thresh, max.iters = max.iters, nrep = nrep, H.init = H.init, . W.init = W.init, V.init = V.init, rand.seed = rand.seed, . print.obj = print.obj)
  3. optimizeALS.list(object = scale.data, k = k, lambda = lambda, . thresh = thresh, max.iters = max.iters, nrep = nrep, H.init = H.init, . W.init = W.init, V.init = V.init, rand.seed = rand.seed, . print.obj = print.obj)
  4. mean(obj0, obj)
  5. mean(obj0, obj)
  6. mean.default(obj0, obj)
cgao90 commented 2 years ago

Hi @mtegtmey ,

Sorry about the late reply. Have you resolved this issue yet? If not, do you mind sharing a code snippet where you ran into this issue?

Best,

vivianlu63 commented 1 year ago

Hello, I am running into this issue as well. I just ran

obj <- normalize(obj)  
obj <- selectGenes(obj)  
obj <- scaleNotCenter(obj)  
obj <- optimizeALS(obj, k = 20)  
cgao90 commented 1 year ago

Hi @vivianlu63 ,

NAs in the ligerObject@scale.data can cause the error reported above.

Best,

lealealeal commented 1 year ago

Hello, I ran into the same issue reported above. I already used liger in the past without this issue. My dataset is a sc-rna-seq datdaset made of several batches (55 batches, from 11 to 180 cells per batch). As anyone been able to resolve the issue and could help me? I have checked that I have no NAs in the ligerobject

Thanks, best