tanaylab / metacell

Metacell - Single-cell mRNA Analysis
https://tanaylab.github.io/metacell
Other
108 stars 30 forks source link

`scm_merge_mats()` error when setting slots to `NULL` #55

Closed anamariaelek closed 3 years ago

anamariaelek commented 3 years ago

Hi, I've tried running scm_merge_mats() and it fails with following error:

Error in (function (cl, name, valueClass)  : 
  assignment of an object of class “NULL” is not valid for @‘ignore_genes’ in an object of class “tgScMat”; is(value, "vector") is not TRUE

This can be fixed by changing the following assignments from NULL to vector(l=0):

    scmats = lapply(scmats, scm_ignore_cells, vector(l=0))
    scmats = lapply(scmats, scm_ignore_genes, vector(l=0))

Best, Anamaria

akhiadber commented 3 years ago

Which R version are you using? The first lines of the scm_ignore_genes function are: if (is.null(ig_genes)) { ig_genes = vector(l = 0) } So previously this was taken care of. Don't know what changed:)

anamariaelek commented 3 years ago

I was using latest released version of metacell (0.3.41) with R 4.0, now I see the function changed from then. Updated metacell to 0.3.6, everything works fine. Thank you for clarifying!