API Reference#

Config#

config._Config()

Global configurations for spatialtis.

Cell quantification from Images#

read_images

Read single cell data from images and masks.

Read from 10x visium#

read_visium

Read visium data from visium result folders.

WKT Format helper#

wkt_points

Transform normal coordination in AnnData.obs to wkt-format.

wkt_shapes

Transform normal coordination in AnnData.obs to wkt-format.

IO#

get_result

Read spatialtis result from AnnData.uns as pandas.DataFrame object.

Basic analysis#

cell_components

Count the proportion of each types of cells in each group.

cell_density

Calculating cell density in each ROI.

cell_morphology

Cell morphology variation between different groups.

cell_co_occurrence

The likelihood of two type of cells occur simultaneously in a ROI.

Spatial analysis#

find_neighbors

To find the neighbors of each cell.

spatial_weights

A generator that return spatial weight in CSR matrix

hotspot

Getis-ord hotspot detection

cell_dispersion

Cell distribution pattern

cell_interaction

Profiling cell-cell interaction using permutation test

cell_community

Spatial communities detection

spatial_heterogeneity

Evaluate tissue heterogeneity based on entropy

spatial_autocorr

Spatial auto-correlation for every marker.

spatial_enrichment

Profiling markers spatial enrichment using permutation test

spatial_coexp

Identifying spatial co-expression markers using correlation

NCD_marker

Identify neighbor cells dependent marker

NMD_marker

Identify neighbor markers dependent marker

somde

This is a wrapper around somde

GCNG

A pytorch reimplementation of GCNG

Base class#

abc.AnalysisBase

The base class for all analysis function

To use plotting, import it in following schema:

>>> import spatialtis.plotting as sp

ROI Visualization#

plotting.cell_map

Visualize cells and neighbors relationship in ROI

plotting.expression_map

Visualize marker expression in ROI

Analysis Visualization#

plotting.cell_components

Visualization of the cell components

plotting.cell_density

Visualization of cell density

plotting.cell_morphology

Visualization of cell morphology

plotting.cell_co_occurrence

Visualization of cell co-occurrence

plotting.cell_dispersion

Parameters

plotting.spatial_heterogeneity

Visualization of spatial heterogeneity analysis

plotting.cell_interaction

Visualization of the cell interaction analysis

plotting.spatial_enrichment

Visualization of the spatial enrichment analysis