hemberg-lab / SC3

A tool for the unsupervised clustering of cells from single cell RNA-Seq experiments
http://bioconductor.org/packages/SC3
GNU General Public License v3.0
118 stars 55 forks source link

each element of 'reducedDims' must be a matrix-like object with nrow equal to 'ncol(object) #96

Open makimenkova opened 4 years ago

makimenkova commented 4 years ago

Hello! I tried to use SC3 and this error occured:

    each element of 'reducedDims' must be a matrix-like object with nrow equal to 'ncol(object)'

My code:

dat = read.csv("/home/makimenkova/test/merge_with_astrocytes.csv", header = TRUE)
rownames(dat) <- dat[ , 1]
dat <- dat[ , 2:dim(dat)[2]]
dat <- as.matrix(dat)
dat[dat<0] <- 0
dat <- dat[apply(dat[,-1], 1, function(x) !all(x==0)), ]
labs <- as.character(names(data.frame(dat[0,])))
ann <- data.frame(clust_id = labs)

sce2_dataset <- create_sce_from_counts(dat, ann)

sce <- sc3_prepare(sce2_dataset, gene_filter = FALSE)
counts(sce) <- as.matrix(counts(sce))
logcounts(sce) <- as.matrix(logcounts(sce))
sce <- sc3_calc_dists(sce)
sce <- sc3_calc_transfs(sce)

My Session info:

─ Session info ──────────
 setting  value                       
 version  R version 3.6.1 (2019-07-05)
 os       Ubuntu 18.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language en_GB:en                    
 collate  en_GB.UTF-8                 
 ctype    en_GB.UTF-8                 
 tz       Europe/Moscow               
 date     2019-08-19  
______________
SC3                  * 1.9.1      2019-08-15 [1] Github (hemberg-lab/SC3@eaae33b)

What I did wrong?

zgyaru commented 4 years ago

I encountered same problem when I running the example code. Did you solve it?