satijalab / seurat-data

Dataset distribution for Seurat
GNU General Public License v3.0
129 stars 46 forks source link

Tutorial: "NULL" to "dgMatrix" #47

Closed CD-man closed 2 years ago

CD-man commented 2 years ago

I have run into an issue with the tutorial where I get the following error. I am running Win11 and a fresh install of R and RStudio.

Any help you could offer would be greatly appreciated.

Error in as(object = data, Class = "dgCMatrix") : no method or default for coercing “NULL” to “dgCMatrix”

I then clicked "Show Traceback":

Error in as(object = data, Class = "dgCMatrix") : no method or default for coercing “NULL” to “dgCMatrix”
7. stop(gettextf("no method or default for coercing %s to %s", dQuote(thisClass), 
dQuote(Class)), domain = NA)
6. as(object = data, Class = "dgCMatrix")
5. LogNormalize(data = object, scale.factor = scale.factor, verbose = verbose)
4. NormalizeData.default(x)
3. NormalizeData(x)
2. FUN(X[[i]], ...)
1. lapply(X = ifnb.list, FUN = function(x) {
x <- NormalizeData(x)
x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000)
})
andrewwbutler commented 2 years ago

Hi,

It looks like you are trying to apply these functions to something that is NULL. Check that your list (infb.list) contains Seurat objects as each element and is not NULL.