raphael-group / paste2

Probabilistic Alignment of Spatial Transcriptomics Experiments v.2
BSD 3-Clause "New" or "Revised" License
31 stars 2 forks source link

GlmpcaError: Numerical divergence #5

Open kennypavan opened 9 months ago

kennypavan commented 9 months ago

Greetings,

Thanks for crafting this alignment package. I'm attempting to run PASTE2 on two partial Starmap coronal slices that are 10um thick with roughly 500um z distance between the two slices. When running, I receive the following error:

GlmpcaError: Numerical divergence (deviance no longer finite), try increasing the penalty to improve stability of optimization.

When increasing the penalty, the issue persists. Could this indicate too much variance between the two slices is preventing an alignment?

x-h-liu commented 9 months ago

Hi,

If rerunning does not resolve the issue, you can try dissimilarity='pca' as it should always work. By default, PCA reduces the dimensionality of the top 2000 highly variable genes to 20, but you can change these numbers by passing different parameters on line 258 of PASTE2.py. For example, if you don't want to filter highly variable genes, you can do M = pca_distance(sliceA, sliceB, None, 20).