scMerge icon indicating copy to clipboard operation
scMerge copied to clipboard

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

Open MartinLoza opened this issue 5 years ago • 1 comments

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.

MartinLoza avatar Aug 31 '20 06:08 MartinLoza

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

grimwoo avatar Jan 20 '22 07:01 grimwoo