Open Kim-Gihyeon opened 1 year ago
Hi @Kim-Gihyeon @mxposed @zeehio
Me too. I updated to new Seurat version and now I am facing this issue where running NormalizeData
> FindVariableFeatures
throws error
Finding variable features for layer counts
Error: 'VST.default' is not implemented yet
However, the error goes away, when I run NormalizeData
> RunALRA
>FindVariableFeatures
, it disappears. Here is the traceback
10: stop(gettextf("'%s' is not implemented yet", as.character(sys.call(sys.parent())[[1L]])),
call. = FALSE)
9: .NotYetImplemented()
8: VST.default(data = object, nselect = nselect, verbose = verbose,
...)
7: method(data = object, nselect = nselect, verbose = verbose, ...)
6: FindVariableFeatures.default(object = data, method = method,
nselect = nselect, span = span, clip = clip, verbose = verbose,
...)
5: hvf.function(object = data, method = method, nselect = nselect,
span = span, clip = clip, verbose = verbose, ...)
4: FindVariableFeatures.StdAssay(object = object[[assay]], selection.method = selection.method,
loess.span = loess.span, clip.max = clip.max, mean.function = mean.function,
dispersion.function = dispersion.function, num.bin = num.bin,
binning.method = binning.method, nfeatures = nfeatures, nselect = nfeatures,
mean.cutoff = mean.cutoff, dispersion.cutoff = dispersion.cutoff,
verbose = verbose, ...)
3: FindVariableFeatures(object = object[[assay]], selection.method = selection.method,
loess.span = loess.span, clip.max = clip.max, mean.function = mean.function,
dispersion.function = dispersion.function, num.bin = num.bin,
binning.method = binning.method, nfeatures = nfeatures, nselect = nfeatures,
mean.cutoff = mean.cutoff, dispersion.cutoff = dispersion.cutoff,
verbose = verbose, ...)
2: FindVariableFeatures.Seurat(mca.seurat2, nfeatures = 2000, selection.method = "vst",
slot = "counts", assay = "RNA")
1: FindVariableFeatures(mca.seurat2, nfeatures = 2000, selection.method = "vst",
slot = "counts", assay = "RNA")
I think this is happening when we make seurat object from csv
files only. I don't face similar issue with other samples. But when I use Malaria Cell Atlas Phenotype files and counts from CSV and then create seurat object, then I encounter this error.
dat.m = read.csv('pf10xIDC_counts.csv', header = TRUE ,row.names = 1)
mca.seurat <- CreateSeuratObject(counts = dat.m, project = "Malaria-Cell-Atlas")
mca.seurat[["percent.mt"]] <- PercentageFeatureSet(object = mca.seurat, pattern = "mal")
mca.seurat$Sample <- "MCA"
mca.seurat$batch <- "MCA"
mca.seurat$batch2 <- "MCA"
mca.pheno = read.csv("pf10xIDC_pheno.csv", row.names = 1)
mca.seurat@meta.data <- cbind(mca.seurat@meta.data,mca.pheno)
mca.seurat2 <- NormalizeData(mca.seurat)
mca.seurat2 <- FindVariableFeatures(mca.seurat2,nfeatures = 2000,selection.method = "vst")
Found the workaround but I hope the developers will fix it and yes the new seurat version does not convert data.frame object to dcgMatrix automatically. Referencing the issue, that gave me the idea.
> class(mca.seurat2@assays$RNA$counts)
[1] "data.frame"
> class(pfd@assays$RNA$counts)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
mca.seurat <- CreateSeuratObject(counts = Matrix::Matrix(as.matrix(dat.m),sparse = T), project = "Malaria-Cell-Atlas")
Hi @Rohit-Satyam,
As you pointed out, I found that the class of count slot of my Seurat Object was data.frame instead of dgCMatrix.
So, I tried your suggestion. input_cd45_pos <- Matrix::Matrix(as.matrix(input_cd45_pos), sparse = T)
The above code transformed the count slot to dbCMatrix from data.frame well, and this made the following steps run well.
Additionally, I'm thinking this error Error: 'VST.default' is not implemented yet
is due to reading tables with sep = ","
or sep = " "
(space) or else some separators instead of sep = "\t"
.
It will be really good if the developers could clarify this problem.
I really thank @Rohit-Satyam, and thank developers in advance!
Best regards, Gihyeon
Thank you @Rohit-Satyam and @Kim-Gihyeon , I meet the same problem when I load a matrix in txt format. Your discussion helps me to figure the problem out. Hope the developers can fix it in the future.
Best regards, Mason
Found the workaround but I hope the developers will fix it and yes the new seurat version does not convert data.frame object to dcgMatrix automatically. Referencing the issue, that gave me the idea.
> class(mca.seurat2@assays$RNA$counts) [1] "data.frame" > class(pfd@assays$RNA$counts) [1] "dgCMatrix" attr(,"package") [1] "Matrix" mca.seurat <- CreateSeuratObject(counts = Matrix::Matrix(as.matrix(dat.m),sparse = T), project = "Malaria-Cell-Atlas")
I was facing the same issue. Solution by @Rohit-Satyam is great while waiting for developers to fix the problem.
| >
Dear, developers.
First of all, I really thank you for the nice tools.
Now, I am struggling with a new error I have never seen before while I am running
FindVariableFeatures
I have downloaded the matrix and metadata from GSE160269.My detailed codes and error are shown below.
CODE:
The Error Message
However,
split_data_2 <- FindVariableFeatures(split_data_2, verbose = F, selection.method = "disp")
is working. Therefore, I think that the error is related to the VST function. Unfortunately, however, I could not find out any solution for it.My Seurat version is 4.9.9.9050 and R version is 4.3.0.
Thank you. Best regards, Gihyeon