immunogenomics / harmony

Fast, sensitive and accurate integration of single-cell data with Harmony
https://portals.broadinstitute.org/harmony/
Other
529 stars 99 forks source link

argument 3 matches multiple formal arguments #253

Closed jasoncrucify closed 1 month ago

jasoncrucify commented 4 months ago

hi, Error in RunHarmony.Seurat(object = merged_seurat, group.by.var = "orig.ident", : argument 3 matches multiple formal arguments

when I run seurat <- harmony::RunHarmony(object =seurat, group.by.vars="orig.ident", reduction = "pca", assay.use="RNA", plot_convergence = T, verbose = T)

when I removed reduction = "pca", it worked, but the harmony dimension drops to 4, no idea what happened, it seems the harmony integration worked

seurat was from a merged seurat object from two seurat object by merging a group of sample of each.

do you know what happened the error?

many thanks

pati-ni commented 1 month ago

On the first occasion, you are using group.by.var and the second line group.by.vars. The correct parameter is group.by.vars. Sorry for the confusion it should autocomplete that. Feel free to reopen if something else is broken.

jasoncrucify commented 1 month ago

thanks a lot, indeed, the problem you replied was fixed right after my posting. But I found out, the basic error is from reduction = "pca"

if I remove this (according to the tutorial, by default setting: the reduction is pca), the code could be executed without errors. my concern is should I keep this in the code below? it is mandatory to keep reduction = "pca" in the command line?

I firstly individually clean up 20 single seurat object (individual sample) with workflow of seurat. then, I merged all of them accordingly by group with performed pca then umap reduction. If harmony works well, I could see the normalisation effect after harmonization.

correct me if I am wrong

jasoncrucify commented 1 month ago

thanks a lot, indeed, the problem you replied was fixed right after my posting. But I found out, the basic error is from reduction = "pca" if I remove this (according to the tutorial, by default setting: the reduction is pca), the code could be executed without errors. my concern is should I keep this in the code below? it is mandatory to keep reduction = "pca" in the command line? I firstly individually clean up 20 single seurat object (individual sample) with workflow of seurat. then, I merged all of them accordingly by group with performed pca then umap reduction. If harmony works well, I could see the normalisation effect after harmonization. correct me if I am wrong

pati-ni commented 1 month ago

Ah yes, see #255 ; you need reduction.use instead of reduction