Tools#

InterScale tools provides utilities for analyzing and interpreting 1) local and global embeddings and 2) attention matrix.

Downstream InterScale’s output can be used for gene, cell and tissue level analysis.

InterScale concept

Tissue level#

scale_cls_by_sample

Scale CLS token values to [0, 1] within each sample/window to make them comparable across windows of different sizes.

Cell level#

plot_all_spatial_net_streams

Visualize spatial interaction flows using streamplots overlaid on a spatial scatter plot.

plot_flow_clusters

Visualize identified flow domains as a segmented background for spatial transcriptomics data.

Gene level#

gene_loadings

Compute standardized local + global gene loadings from two linear decoders.

calculate_gene_ranks

Calculate gene ranks comparing local and global model predictions.