spatialtis.spatial_heterogeneity#

spatialtis.spatial_heterogeneity(data, method='leibovici', d=None, cut=3, export_key='heterogeneity', **kwargs)[source]#

Evaluate tissue heterogeneity based on entropy

Entropy describes the amount of information.

  • Shannon entropy (No spatial info included): To compare the difference within a group (eg. different samples from same tumor), Kullback–Leibler divergences for each sample within the group are computed, smaller value indicates less difference within group.

  • Leibovici entropy: You can specific the distance threshold to determine co-occurrence events.

  • Altieri entropy: You can specific the distance interval to determine co-occurrence events.

Parameters
dataAnnData

The AnnData to work with.

method{‘shannon’, ‘leibovici’, ‘altieri}, default: ‘leibovici’
dfloat

Parameters for method=’leibovici’, The distance threshold to determine co-occurrence events.

cutint

Parameters for method=’altieri’, The number of distance interval to have.

export_keystr

The key used to store result.

**kwargs

Config for the analysis, for details check spatialtis.abc.AnalysisBase.