SC3 icon indicating copy to clipboard operation
SC3 copied to clipboard

Error in `[.default`(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters"))

Open DrLucyMac opened this issue 7 years ago • 10 comments

Hello! I am using SC3 for clustering of pbmc single cell data which was originally a Seurat object converted to SCE. However, I have encountered the following issue...

pbmc <- sc3_estimate_k(pbmc)
metadata(pbmc)$sc3$k_estimation

#Transform counts slot in pbmc object to full matrix as sparse matrix throws error about wrong dimension
counts(pbmc) <- as.matrix(counts(pbmc))
logcounts(pbmc) <- as.matrix(logcounts(pbmc))
pbmc <- sc3(pbmc, ks = 11, biology = TRUE)

Error in checkForRemoteErrors(val) : 3 nodes produced errors; first error: Error in [.default(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters")) : incorrect number of dimensions

Is there something i am doing wrong?

Cheers, Lucy

DrLucyMac avatar Jul 12 '18 16:07 DrLucyMac

Hi, could you please check this issue first? https://github.com/hemberg-lab/SC3/issues/61

wikiselev avatar Jul 17 '18 15:07 wikiselev

Hi, I had a look at the issue 61. What n_dim do you recommend for a sample of >5000 cells? This is the SCE object. I do all my preprocessing (QC/normalization) with Seurat then convert to SCE.

screen shot 2018-07-17 at 14 58 55

Thanks for your help. Lucy

DrLucyMac avatar Jul 18 '18 11:07 DrLucyMac

Hi, sorry for a very long delay, I suppose you figured this out already, or still need help?

wikiselev avatar Oct 08 '18 17:10 wikiselev

Hello, I have a similar problem. I use an external environment to make QC and preprocessing, and after import the table in R and create a SingleCellExperiment. Error in [.default(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters")) : incorrect number of dimensions Error in [.default(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters")) : incorrect number of dimensions Error in [.default(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters")) : incorrect number of dimensions Error in checkForRemoteErrors(val) : 3 nodes produced errors; first error: Error in [.default(clusts, , paste0("sc3_", hash.table[i, 1], "_clusters")) : incorrect number of dimensions. Just for reference, my code is:

library(SingleCellExperiment)
library(SC3)
data <- read.table(file = 'scdata.csv', header = TRUE, row.names=1, sep=',')
sce <- SingleCellExperiment(assays = list(logcounts = as.matrix(t(data))))
rowData(sce)$feature_symbol <- rownames(sce)
sce <- sce[!duplicated(rowData(sce)$feature_symbol), ]
sce <- sc3_estimate_k(sce)
metadata(sce)$sc3$k_estimation
system.time(sce <- sc3(sce, ks = 31, biology = TRUE, gene_filter=FALSE))

As a note, I get a very high number of estimated clusters with sc3_estimate_k (301!!). Is there something I am doing wrong?

Thanks in advance, Enrico

reemagit avatar Dec 25 '18 03:12 reemagit

@reemagit, would you be able to share your dataset so that I can check the errors? You can share it with [email protected]

wikiselev avatar Jan 02 '19 10:01 wikiselev

Hello, I apologize for answering late. Unfortunately I am not authorized to share the dataset, but I think I solved my problem since the error is not showing up anymore. I am not sure what the problem was, but in previous iterations the preprocessing for the data was done in python and the processed data was loaded in R. Switching to a pure R processing solved the issue, so maybe there was some problem in the transfer. Thanks for the help anyways, Enrico

reemagit avatar Jan 16 '19 15:01 reemagit

Ok, I will close it for now, thanks for replying.

wikiselev avatar Jan 16 '19 15:01 wikiselev

I think I found the problem!!! In this line if there is only one k provided then clusts becomes a vector and the subsetting of the vector throws an error. https://github.com/hemberg-lab/SC3/blob/eaae33bb5bccfb1cdd8ff05ef8f3aa216efb9c1d/R/CoreMethods.R#L705

So, one either has to run with at least two values in ks or @wikiselev has to fix this!

mariaprimo avatar Jun 19 '19 13:06 mariaprimo

Thanks, Maria! I will try to fix this asap, for the moment please use Maria's advice - have at least two values in ks.

wikiselev avatar Jun 19 '19 14:06 wikiselev

Thanks for @mariaprimo 's answer, but it's been three years and this issue still exists 👀

poseidonchan avatar Nov 25 '22 00:11 poseidonchan