Global Moran’s I is defined as
where is the number of spots or locations, and are different locations, or spots in the Visium context, is a variable with values at each location, and is a spatial weight, which can be inversely proportional to distance between spots or an indicator of whether two spots are neighbors, subject to various definitions of neighborhood.
Local Moran’s I (Anselin 1995) is defined as
It’s similar to global Moran’s I, but the values at locations are not summed and there’s no normalization by the sum of spatial weights.
Below is a list of vignettes that use local Moran’s I. The links point to the sections that use local Moran’s I. The corresponding Google Colab notebooks are also linked to. The list is sorted by technology.
Vignette | Colab Notebook | Description |
---|---|---|
Spatial analysis with 10X example Visium dataset | Colab Notebook | Perform local Moran’s I on QC metrics and gene expression in mouse olfactory bulb dataset from 10X website. |
Spatial Visium exploratory data analysis | Colab Notebook | Perform Moran’s I on gene Myh2 (myosin heavy chain 2) in mouse skeletal muscle dataset |
CosMX NSCLC analysis | Colab Notebook | Perform local Moran’s I on QC metrics and on marker genes in a human non-small cell lung cancer dataset |
Xenium breast cancer analysis | Colab Notebook | Perform local Moran’s I on QC metrics and marker genes in a human breast cancer dataset |
MERFISH mouse liver analysis | Colab Notebook | Perform local Moran’s I on QC metrics in a mouse liver dataset |
10X v3 Basic | Colab Notebook | Apply local Moran’s I to QC metrics and marker genes in non-spatial human PBMC scRNA-seq dataset, with k nearest neighbor graph in gene expression PCA space rather than histological space |