mesa.ecospatial.calculate_GDI
- mesa.ecospatial.calculate_GDI(spatial_data, scale, library_key, library_id, spatial_key, cluster_key, hotspot=True, whole_tissue=False, p_value=0.01, restricted=False, mode='MoranI', **kwargs)
Calculate a Global Diversity Index (GDI) for specified samples within spatial data, incorporating spatial statistics under chosen analysis modes.
- Parameters:
spatial_data (Union[
ad.AnnData,pd.DataFrame]) – The spatial data containing library and clustering information for analysis.scale (float) – The scaling factor to adjust spatial coordinates for analysis.
library_key (str) – Key associated with the library information in spatial_data.
library_id (Union[tuple, list]) – Identifiers for the libraries to be analyzed.
spatial_key (Union[str, List[str]]) – Key(s) identifying the spatial coordinates within spatial_data.
cluster_key (str) – Key used to access cluster information within spatial_data.
hotspot (bool, optional) – Determines whether to analyze spatial hotspots or coldspots. Default is True.
whole_tissue (bool, optional) – Specifies whether to analyze the entire tissue or specific regions. Default is False.
p_value (float, optional) – The p-value threshold for determining statistical significance in spatial analysis. Default is 0.01.
restricted (bool, optional) – Restricts the analysis to specified conditions or tissue types. Default is False.
mode (str, optional) – The mode of spatial statistics used in the analysis, such as ‘MoranI’. Default is ‘MoranI’.
**kwargs – Additional keyword arguments for customization and specific parameters in underlying functions.
- Returns:
A DataFrame with indices representing library identifiers and a single column ‘GDI’ containing the calculated Global Diversity Index for each sample.
- Return type: