SydneyBioX / scMerge

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

getting Error in pca_current[, seq_len(10)] : subscript out of bounds #29

Open MartinLoza opened 4 years ago

MartinLoza commented 4 years ago

Hi, I am trying to integrate two PBMC batches (control and stimulation) but keep getting the same error. And example of what I am trying to do is:

`library(Seurat) library(SeuratData) library(scMerge)

if (! "ifnb" %in% SeuratData::InstalledData()[["Dataset"]]) { SeuratData::InstallData("ifnb") } Uncorrected <- SeuratData::LoadData("ifnb") Uncorrected <- NormalizeData(Uncorrected, verbose = FALSE) Uncorrected <- FindVariableFeatures(Uncorrected, nfeatures = 2000, verbose = FALSE)

features <- VariableFeatures(Uncorrected)

Correction <- as.SingleCellExperiment(Uncorrected[features,])

Correction <- scMerge(sce_combine = Correction, ctl = features, kmeansK = c(3,3), batch_name = "stim", assay_name = "scMerge", plot_igraph = FALSE)`

I am interested in correcting only the variable features, so I subset as Uncorrected[features,] I have tried different ways to create the SingleCellObject but keep getting the same error. It is worth to note that I don't get the error if I dont't subset the Uncorrected batch. Thanks in advance for any suggestion you may have.

grimwoo commented 2 years ago

Hi, @MartinLoza I had exactly same error. Have you solved this one?