Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmony converged after 6 iterations Error in UseMethod(generic = "Key", object = object) : no applicable method for 'Key'... #221

Open
ncedi12 opened this issue Nov 19, 2023 · 5 comments
Labels
response needed Issue will be closed within a month if no response is provided

Comments

@ncedi12
Copy link

ncedi12 commented Nov 19, 2023

hi there I'm encountering this issue when trying to run harmony integration on seurat platform

Harmony converged after 6 iterations
Error in UseMethod(generic = "Key", object = object) :
no applicable method for 'Key' applied to an object of class "character"

this was the command: after SCT and RunPCA.

object <- RunHarmony(object, group.by.vars =c('orig.ident','Subgroup'), assay.use = "SCT", theta = c(0.5,2))

or

object <- RunHarmony(object, group.by.vars =c('orig.ident','Subgroup'), assay.use = "SCT", reduction = 'pca', theta = c(0.5,2))

All give the same error as above..

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: AlmaLinux 8.8 (Sapphire Caracal)

Matrix products: default
BLAS: /hpf/tools/R/4.0.3/lib64/R/lib/libRblas.so
LAPACK: /hpf/tools/R/4.0.3/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=C LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] magrittr_2.0.3 glue_1.6.2 sctransform_0.3.2 harmony_0.1.1
[5] Rcpp_1.0.10 SeuratObject_4.0.0 Seurat_4.0.0

I've tried passing a single group.by.vars argument, or single theta (doesn't allow this with two group.by argument.

any advice on how to deal with this error?

@pati-ni
Copy link
Collaborator

pati-ni commented Nov 30, 2023

I can see you are using Harmony v0.1.1. Can you please upgrade the harmony package and retry?

@pati-ni pati-ni added the response needed Issue will be closed within a month if no response is provided label Nov 30, 2023
@sallyseullee-0821
Copy link

Hi @pati-ni, I am facing a similar issue, but my harmony package is version 1.2.0.
When I run the following,

integrated<- RunHarmony(seurat, group.by.vars = c("samples"), reduction.save = T, plot_convergence = TRUE)

I receive an error:

Harmony converged after 6 iterations
Error in UseMethod(generic = "Key", object = object) : 
  no applicable method for 'Key' applied to an object of class "logical"

I would appreciate your guidance on solving this issue.
Thank you!

@pati-ni
Copy link
Collaborator

pati-ni commented Jan 15, 2024 via email

@ShuqingL
Copy link

hello @pati-ni, I encountered the same problem.
R version 3.6.1, harmony package is version 1.2.0
Previously, there was no problem using it, but this time there is a problem and I don't know how to solve it.
The current usage is single-cell transcriptome data, with two samples.

@biyukey
Copy link

biyukey commented Oct 26, 2024

hello @pati-ni ,I faced a same problem with harmony 1.2.1 and Seurat version 4.1.says"Harmony converged after 4 iterations
Error in UseMethod(generic = "Key", object = object) :
no applicable method for 'Key' applied to an object of class "character""
I notice u asked the Seurate version witch version u command ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
response needed Issue will be closed within a month if no response is provided
Projects
None yet
Development

No branches or pull requests

5 participants