SydneyBioX / scMerge

Statistical approach for removing unwanted variation from multiple single-cell datasets
https://sydneybiox.github.io/scMerge/
66 stars 13 forks source link

Error in neighbour_batch2[neighbour_batch1[l]] : invalid subscript type 'list' #31

Closed yuyuanyuana closed 2 years ago

yuyuanyuana commented 3 years ago

I checked the source code and the error occurred on line 639 of the script ScReplicate.R

library(SingleCellExperiment) library(scMerge) library(scater)

count <- rbind(counts1,counts2,counts3) log_count <- log2(count+1) colData <- DataFrame("batch" = as.factor(c(rep(1,dim(counts1)[1]),rep(2,dim(counts2)[1]),rep(3,dim(counts3)[1]))), 'row.names'=rownames(counts))

all <- SingleCellExperiment(assays = list(counts = as.matrix(t(count)), logcounts=as.matrix(t(log_count))), colData = colData) all <- runPCA(all, exprs_values = "logcounts")

exprs_mat = SummarizedExperiment::assay(all, 'counts') result = scSEGIndex(exprs_mat = exprs_mat) scMerge_res <- scMerge(sce_combine = all,ctl = rownames(result), kmeansK = c(5,5,5),assay_name = "scMerge_unsupervised", BSPARAM = IrlbaParam(), svd_k = 20, replicate_prop = 1)

I have tried different ways to create the SingleCellObject but keep getting the same error. Thanks in advance for any suggestion you may have.

YingxinLin commented 2 years ago

Thank you for the interest in scMerge.

This error has been fixed in the latest github version of scMerge.