Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DrLucyMac opened this issue Jul 12, 2018 · 10 comments

Comments

@DrLucyMac
Copy link

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

@wikiselev
Copy link
Member

Hi, could you please check this issue first? #61

@DrLucyMac
Copy link
Author

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

@wikiselev
Copy link
Member

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

@reemagit
Copy link

reemagit commented Dec 25, 2018

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

@wikiselev
Copy link
Member

@reemagit, would you be able to share your dataset so that I can check the errors? You can share it with vk6@sanger.ac.uk

@reemagit
Copy link

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

@wikiselev
Copy link
Member

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

@mariaprimo
Copy link

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.

get_biolgy(dataset, clusts[, paste0("sc3_", hash.table[i, 1], "_clusters")], hash.table[i, 2])

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

@wikiselev wikiselev reopened this Jun 19, 2019
@wikiselev
Copy link
Member

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

@poseidonchan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants