immunogenomics / harmony

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

mutiple covariates - error number of lambdas specified #223

Closed antoine4ucsd closed 9 months ago

antoine4ucsd commented 9 months ago

Hello I am interested in running harmony with multiple covariates.

this works

RunHarmony(data, c("pid"))

this works

RunHarmony(data, c("status"))

this failed with the following error message:

RunHarmony(data, c("pid", "status"))

Transposing data matrix Error in tryCatchList(expr, classes, parentenv, handlers) : You specified a lambda value for each covariate but the number of lambdas specified (1) and the number of covariates (2) mismatch.

it may be obvious but I dont see how to adjust the lambdas? thank you!

pati-ni commented 9 months ago

Hi @antoine4ucsd

If you look at the manual ?RunHarmony, there is an argument lambda. By default this is 1, so setting it to c(1,1) would do the trick? You can also set it in lambda=NULL in which case it will set lambdas automatically for you (beta feature).

Feel free to re-open if you run into issues.

antoine4ucsd commented 9 months ago

I confirm it works! thank you. (maybe for newbies like me, you can edit the vignette) Best,