mesa.multiomics.multiomics_spatial.get_avg_expression_neighbors
- mesa.multiomics.multiomics_spatial.get_avg_expression_neighbors(exp_df, spatial_knn_indices)
Calculate the average expression values over the neighbors of each data point.
- Parameters:
exp_df (pd.DataFrame) – The DataFrame to process. Each row represents a data point (e.g., a cell in single-cell data), and each column represents an attribute of the data points (e.g., gene expression values).
spatial_knn_indices (np.ndarray) – The indices that represent the k-nearest neighbors for each data point in a spatial data structure.
- Returns:
The resulting np.ndarray represents the average expression values over the neighbors of a data point.
- Return type:
np.ndarray