MarioniLab / miloDE

Framework for sensitive DE testing (using neighbourhoods)
Other
57 stars 2 forks source link

Certain values of k cause estimate_neighbourhood_sizes() to freeze #31

Closed Budjavac closed 8 months ago

Budjavac commented 1 year ago

I have noticed the following bug: For one of my sce objects, running stat_k = estimate_neighbourhood_sizes(my_data.sce, k_grid = seq(10,40,5), order = 2, prop = 0.1 , filtering = TRUE, reducedDim_name = "PCA" , plot_stat = TRUE)

causes my R to freeze after estimating the value for k=10. The output is

Running for next k values:
10, 15, 20, 25, 30, 35, 40
100% covered by 92 sets.
Finished for k = 10

after which my RStudio freezes. If k_grid = seq(10,40,10) is passed instead, the function successfully runs for k=10, k=20, k=30, and k=40, and tells me the number of sets for each k value.

Running

my_data_milo= assign_neighbourhoods(my_data.sce , k = 15 , order = 2, 
                                 filtering = TRUE , reducedDim_name = "PCA" , verbose = F)

does work, so the only function that seems to have an issue with k=15 for this object is estimate_neighbourhood_sizes().

Any ideas on what could be causing this bug?

amissarova commented 1 year ago

HI, apologies for the late reply. Truth is - this is a very weird bug, to which I have no intuition of what might cause the problem.

If it is still relevant - could you perhaps share a toy example which I can test on my machine?

amissarova commented 8 months ago

Assuming its not relevant anymore and closing the issue - please reopen if needed