paste3.helper.match_spots_using_spatial_heuristic
- paste3.helper.match_spots_using_spatial_heuristic(a_spatial_dist, b_spatial_dist, use_ot=True)[source]
Matches spatial coordinates between two datasets using either optimal transport or bipartite matching based on spatial proximity.
- Parameters:
a_spatial_dist (np.ndarray) -- Spot distance matrix in the first slice.
b_spatial_dist (np.ndarray) -- Spot distance matrix in the second slice.
use_ot (bool, Optional) -- If True, matches spots using optimal transport (OT); if False, uses minimum-weight full bipartite matching.
- Returns:
A transport matrix (pi) representing matching weights between the points in a_spatial_dist and b_spatial_dist.
- Return type:
np.ndarray