(yes, sample and Sample are different.) The first time, it converged after 7 iterations. I looked and my samples do not appear to be well integrated. I ran it again on the new PCA and it ran for 10 iterations before converging. It looked much better. Just for fun, I ran it again multiple times (changing the harmony output adata.obsm['X_pca_harmony'] to adata.obsm['X_pca'] each time) and it converged after 3 iterations, then 3 iterations, then 3 iterations, then 6 iterations, then 4 iterations...and so on.
Can someone help me understand what is going on and how I know when I should stop? Especially since the output from the first run looked so bad?
Apologies for the delayed reply. Is this still an issue? If I understand correctly you run sequentially the output on the corrected object. Plotting the convergence values during runtime would be useful.
I am running harmony through the scanpy wrapper and it doesn't do too well.
As an example, I have scRNA Seq data from 4 samples. I merged them after doing some cell QC and ran
sce.pp.harmony_integrate(adata, ['sample','Sample'])
(yes, sample and Sample are different.) The first time, it converged after 7 iterations. I looked and my samples do not appear to be well integrated. I ran it again on the new PCA and it ran for 10 iterations before converging. It looked much better. Just for fun, I ran it again multiple times (changing the harmony output adata.obsm['X_pca_harmony'] to adata.obsm['X_pca'] each time) and it converged after 3 iterations, then 3 iterations, then 3 iterations, then 6 iterations, then 4 iterations...and so on.
Can someone help me understand what is going on and how I know when I should stop? Especially since the output from the first run looked so bad?
Thanks!!