Open Sophiesze opened 4 years ago
Hi, Same error here using a custom reduction object based on scBFA reduction metho (but this reduction object works with any other method or package i've tried till now)...
Hi @Sophiesze, thanks for reporting the issue.
You might consider sharing more information:
reduction = 'lsi'
?sessionInfo()
, so we know which version of harmony you are using?I'm encountering the same error with 10X scATAC-seq data. it appears during a call to ProjectDim
, where the assay
is not properly set (see #1849)
proposed fix to Runharmony.R#L159
object <- Seurat::ProjectDim(
object,
reduction = reduction.save,
assay = assay.use,
overwrite = TRUE,
verbose = FALSE
)
(but make sure that assay.use
also has been scaled, because ProjectDim
accesses this slot)
Hi all,
I also ran into the same issue. If I understand correctly, the ProjectDim part in the harmony source code is trying to project the batch corrected embedding back to the original feature loading (is that right?). Therefore I guess if you only need the corrected embedding but not the corrected original data we can do something like RunHarmony(data, "batch", project.dim = F). Setting project.dim avoids invoking the ProjectDim function and solved my problem.
In addition, the project.dim argument was not found in the documentation at https://www.rdocumentation.org/packages/harmony/versions/1.0/topics/RunHarmony so it took me sometime to dig this out. It might be nice to include it in the documentation.
Thanks
Using project.dim = F is OK, but in fact, this error is because assay.use was not correctly set, the default is assay.use = "RNA", when you use other assays, such as SCT or integrated, it should be explicitly set to solved the problem:
object <- RunHarmony(object = object,group.by.vars = "var",assay.use = "SCT")
object <- RunHarmony(object = object,group.by.vars = "var",assay.use = "integrated")
I'm also running into the same issue, but the assay I'm using is "RNA"
I use the following command:
seurObj <- RunHarmony(object = data, group.by.vars = "batch", assay.use='RNA')
And then I run into the issue:
Harmony converged after 3 iterations Error in data.use %*% cell.embeddings : non-conformable arguments
I tried it without projecting back to the original dimensions. I see that dim(cell.embeddings) is (34068, 50) while the original expression matrix's dimension is (36601, 34068). In the original expression matrix, 36601 is the number of features and 34068 is the number of samples. I'm curious why I'd continue running into this problem. Please let me know if you have any insights
Hello,
I have met the same issue as previously described by yejg2017. When I was trying to RunHarmony with my 10X-ATAC data (reduction = 'lsi'), harmony did not work well.
Is it possible that you can help me with this problem? Thanks so much.