spatialtis.cell_dispersion

class spatialtis.cell_dispersion(data, method='id', min_cells=10, pval=0.01, r=None, resample=1000, quad=None, rect_size=None, **kwargs)[source]

Cell distribution pattern

There are three type of distribution pattern (0 if no cells)

  • Random (1)

  • Regular (2)

  • Cluster (3)

Three methods are provided

Notice that clark evans’ index usually failed to detect local aggregation.

Random

Regular

Cluster

Index of dispersion: ID

ID = 1

ID < 1

ID > 1

Morisita’s index of dispersion: I

I = 1

I < 1

I > 1

Clark and Evans aggregation index: R

R = 1

R > 1

R < 1

Parameters
  • data (anndata._core.anndata.AnnData) – AnnData object to perform analysis

  • method (Optional[str]) – “id”, “morisita”, and “clark_evans” (Default: “id”)

  • min_cells (int) – The minimum number of the specific type of cells in a ROI to perform analysis

  • pval (float) – The p-value threshold to determine significance

  • r (Optional[Union[int, float]]) – method="id", determine diameter of sample window, should be in [0, 1], default is 0.1 this take 1/10 of the shortest side of the ROI as the diameter.

  • resample (int) – method="id", the number of random permutations to perform

  • quad (Optional[Tuple[int, int]]) – method="morisita", A tuple (X, Y), Use a grid that is X * Y to tessellation your ROI

  • rect_size (Optional[Union[int, float]]) – method="morisita", {rect_size}

  • **kwargs – Pass to spatialtis.abc.AnalysisBase

“quad” is quadratic statistic, it cuts a ROI into few rectangles, quad=(10,10) means the ROI will have 10*10 grid.