Vivianstats / scImpute

Accurate and robust imputation of scRNA-seq data
https://www.nature.com/articles/s41467-018-03405-7
90 stars 34 forks source link

Error in pca$x[, 1:npc] : subscript out of bounds #37

Open 1213812138zqc opened 3 years ago

1213812138zqc commented 3 years ago

Hello, I obtained the following error when running the imputation on my dataset. Could you please advise what's the reason for this error? Thanks.

[1] "reading in raw count matrix ..." [1] "number of genes in raw count matrix 180253" [1] "number of cells in raw count matrix 60" [1] "reading finished!" [1] "imputation starts ..." [1] "searching candidate neighbors ... " [1] "calculating cell distances ..." Error in pca$x[, 1:npc] : subscript out of bounds Calls: scimpute ... imputation_wlabel_model8 -> find_neighbors -> lapply -> FUN -> t Execution halted

pwwang commented 2 years ago

I had the same problem. Not sure if this is your case, but in mine, I had too few cells in one of the groups marked by labels I passed to scimpute().

The workaround for me is to not pass the labels, but let scimpute() do the clustering. So previously I had

scimpute(..., labels=labels, labeled=T)

Now I have:

scimpute(..., labels=NULL, labeled=F, Kcluster=length(unique(labels)))

The grouping is a little bit different than ours, but it worked somehow.