API

Import Squidpy as:

import squidpy as sq

Graph

gr.spatial_neighbors(adata[, spatial_key, …])

Create a graph from spatial coordinates.

gr.nhood_enrichment(adata, cluster_key[, …])

Compute neighborhood enrichment by permutation test.

gr.centrality_scores(adata, cluster_key[, …])

Compute centrality scores per cluster or cell type.

gr.interaction_matrix(adata, cluster_key[, …])

Compute interaction matrix for clusters.

gr.ligrec(adata, cluster_key[, …])

Perform the permutation test as described in [Efremova et al., 2020].

gr.spatial_autocorr(adata[, …])

Calculate Global Autocorrelation Statistic (Moran’s I or Geary’s C).

gr.ripley_k(adata, cluster_key[, …])

Calculate Ripley’s K statistics for each cluster in the tissue coordinates.

gr.co_occurrence(adata, cluster_key[, …])

Compute co-occurrence probability of clusters.

Image

im.process(img[, layer, method, size, …])

Process an image by applying a transformation.

im.segment(img[, layer, method, channel, …])

Segment an image.

im.calculate_image_features(adata, img[, …])

Calculate image features for all observations in adata.

Plotting

pl.nhood_enrichment(adata, cluster_key[, …])

Plot neighborhood enrichment.

pl.centrality_scores(adata, cluster_key[, …])

Plot centrality scores.

pl.interaction_matrix(adata, cluster_key[, …])

Plot cluster interaction matrix.

pl.ligrec(adata[, cluster_key, …])

Plot the result of a receptor-ligand permutation test.

pl.ripley_k(adata, cluster_key[, palette, …])

Plot Ripley’s K estimate for each cluster.

pl.co_occurrence(adata, cluster_key[, …])

Plot co-occurrence probability ratio for each cluster.

pl.extract(adata[, obsm_key, prefix])

Create a temporary anndata.AnnData object for plotting.

Datasets

datasets.four_i([path])

Pre-processed subset 4i dataset from Gut et al.

datasets.imc([path])

Pre-processed subset IMC dataset from Jackson et al.

datasets.seqfish([path])

Pre-processed subset seqFISH dataset from Lohoff et al.

datasets.visium_hne_adata([path])

Pre-processed 10x Genomics Visium H&E dataset.

datasets.visium_hne_adata_crop([path])

Pre-processed subset 10x Genomics Visium H&E dataset.

datasets.visium_fluo_adata([path])

Pre-processed 10x Genomics Visium Fluorecent dataset.

datasets.visium_fluo_adata_crop([path])

Pre-processed subset 10x Genomics Visium Fluorescent dataset.

datasets.visium_hne_image([path])

H&E image from 10x Genomics Visium dataset.

datasets.visium_hne_image_crop([path])

Cropped H&E image from 10x Genomics Visium dataset.

datasets.visium_fluo_image_crop([path])

Cropped Fluorescent image from 10x Genomics Visium dataset.