squidpy
squidpy copied to clipboard
Add parameter to `sliding_window` to end up with windows of (approximately) same number of cells
Could add a heuristic that tries to optimise the number of cells per window (and unassigned cells) so that on average, most windows have a number of cells assigned that is as close as possible to what the user specified.
Hi Tim, I agree this would be a really useful feature. More specifically, we could add the following parameters:
-
max_nr_cells: int = None.- If not
None, it calculates thewindow_sizesuch that the number of cells in a sliding window is <=max_nr_cells(e.i. 1k).
- If not
Considering that given multiple library_key's the FOVs have different sizes or densities we could introduce a separate parameter that differentiates between whether the window sizes should be equal across all library_key's or not. For example:
-
window_size_per_library_key: 'equal', 'unique'- 'equal': calculate one window size for all library_keys
- 'unique': calculate a unique window size for all library keys
Hi @timtreis and @FrancescaDr , I'll work on this.