Compute the cost matrix between single cells and spatial spots based on expression similarity. The cost matrix is used as input to the linear assignment problem solver.
Usage
compute_cost_matrix(
sc_data,
st_data,
method = c("pearson", "spearman", "euclidean"),
use_cpp = TRUE
)Arguments
- sc_data
Normalized single-cell expression matrix (genes x cells).
- st_data
Normalized spatial expression matrix (genes x spots).
- method
Distance/similarity metric:
- "pearson"
Pearson correlation (default). Cost = -correlation.
- "spearman"
Spearman rank correlation. Cost = -correlation.
- "euclidean"
Euclidean distance.
- use_cpp
Logical. If TRUE, use C++ implementation. Default is TRUE.