qingnanl / LSGI

Local Spatial Gradient Inference
5 stars 0 forks source link

Error in validate_input_optimal_anticlustering(x, K, "diversity", solver) The selected method can only be used for equal-sized groups #1

Open 964612858j5 opened 2 months ago

964612858j5 commented 2 months ago

Dear Author, It is a great honor to use such a meaningful algorithm. While testing with my own 10x spatial transcriptomics data, I encountered the following error. Could you please provide me with some advice? Thank you very much! > lsgi.res <- local.traj.preprocessing(spatial_coords = spatial_coords, n.grids.scale = 5, embeddings = embeddings, n.cells.per.meta = 25) Error in validate_input_optimal_anticlustering(x, K, "diversity", solver) : The selected method can only be used for equal-sized groups And the following are my data:

print(head(spatial_coords)) X Y AAACAACGAATAGTTC-1 1898 3244 AAACAAGTATCTCCCA-1 11385 13105 AAACAATCTACTAGCA-1 2406 6278 AAACACCAATAACTGC-1 13369 3868 AAACAGAGCGACTCCT-1 4403 12035 AAACAGCTTTCAGAAG-1 10284 2671

print(embeddings[1:5, 1:5]) nmf_1 nmf_2 nmf_3 nmf_4 AAACAACGAATAGTTC-1 0.0002120944 0.0001232160 5.711837e-04 2.518285e-04 AAACAAGTATCTCCCA-1 0.0001217158 0.0004353288 1.630653e-04 1.265147e-04 AAACAATCTACTAGCA-1 0.0003653729 0.0001540895 5.688589e-04 1.945493e-04 AAACACCAATAACTGC-1 0.0004786414 0.0001693591 2.482226e-04 2.606442e-04 AAACAGAGCGACTCCT-1 0.0000000000 0.0002097748 7.458087e-05 6.398756e-05 nmf_5 AAACAACGAATAGTTC-1 0.0002759154 AAACAAGTATCTCCCA-1 0.0003939987 AAACAATCTACTAGCA-1 0.0002476983 AAACACCAATAACTGC-1 0.0004592025 AAACAGAGCGACTCCT-1 0.0002548031

Thank you very much for your help!

qingnanl commented 1 month ago

Thanks for using the package. Have you tried using an older version of the dependency 'anticlust' (such as 0.6.1)?