API

Import MESA as:

import mesa as ms

Multiomics

multiomics.multiomics_spatial.get_spatial_knn_indices(...)

Compute the k-nearest neighbors (k-NN) of each location in a given data matrix.

multiomics.multiomics_spatial.get_neighborhood_composition(...)

Compute the global composition of neighbors for each sample, either in percentage or count form, based on k-nearest neighbors (k-NN) indices and specific cluster labels.

multiomics.multiomics_spatial.get_avg_expression_neighbors(...)

Calculate the average expression values over the neighbors of each data point.

Ecospatial

ecospatial.generate_patches(spatial_data, ...)

Generate a list of patches from a spatial data object, scaling them according to a given factor.

ecospatial.calculate_shannon_entropy(counts)

Calculate the Shannon entropy of a set of counts.

ecospatial.calculate_diversity_index(...[, ...])

Calculate the heterogeneity index for a set of patches using specified metrics.

ecospatial.diversity_heatmap(spatial_data, ...)

Visualize the diversity indices as a heatmap on the original spatial data, optionally returning the plot figure for further customization.

ecospatial.global_spatial_stats(grid[, ...])

Perform global spatial autocorrelation analysis on a 2D grid of diversity indices.

ecospatial.local_spatial_stats(grid[, mode, ...])

Compute local indicators of spatial association (LISA) for local spatial autocorrelation on a 2D grid of diversity indices, identifying significant hotspots and coldspots based on the chosen statistical method.

ecospatial.calculate_MDI(spatial_data, ...)

Calculate the multiscale diversity index (MDI) for spatial data.

ecospatial.calculate_GDI(spatial_data, ...)

Calculate a Global Diversity Index (GDI) for specified samples within spatial data, incorporating spatial statistics under chosen analysis modes.

ecospatial.calculate_DPI(spatial_data, ...)

Calculate the Diversity Proximity Index (DPI) for specified samples within spatial data.

ecospatial.spot_cellfreq(spatial_data, ...)

Analyze cell frequency and co-occurrence across different spots in spatial data.