You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The computation of the co-occurrence gr.co_occurrence() currently automatically computes a min and max value (_find_min_max(spatial) in squidpy.gr._ppatterns). If I understand the code correctly, the minimum distance is computed by looking at the two cells with the lowest coordinate sums (x+y coordinate) and taking the Euclidean distance between the two. This method works fine as long as the cells fill out a rectangular image. However, it breaks when considering other shapes, such as TMA cores (see attached image).
In this specific case, the methodology returns a minimum threshold of 413 (see co-occurence plot), presumably due to some of the cells detected outside of the core (could also be a result of the core not being perfectly centered).
Naturally, I am interested in interactions below a distance of 400 as well. So, as a fix, I would propose to add a min_dist and max_dist parameter to gr.co_occurrence(), to give users full flexibility over the distance range they look at. The existing computation could still be used as a default.
The text was updated successfully, but these errors were encountered:
Description
The computation of the co-occurrence
gr.co_occurrence()
currently automatically computes a min and max value (_find_min_max(spatial)
insquidpy.gr._ppatterns
). If I understand the code correctly, the minimum distance is computed by looking at the two cells with the lowest coordinate sums (x+y coordinate) and taking the Euclidean distance between the two. This method works fine as long as the cells fill out a rectangular image. However, it breaks when considering other shapes, such as TMA cores (see attached image).In this specific case, the methodology returns a minimum threshold of 413 (see co-occurence plot), presumably due to some of the cells detected outside of the core (could also be a result of the core not being perfectly centered).
Naturally, I am interested in interactions below a distance of 400 as well. So, as a fix, I would propose to add a
min_dist
andmax_dist
parameter togr.co_occurrence()
, to give users full flexibility over the distance range they look at. The existing computation could still be used as a default.The text was updated successfully, but these errors were encountered: