Secondary analysis

In this tutorial, you will learn how to run the complementary pipeline SAW reanalyze for

  • cluster: clustering spots (cell/binN).

  • lasso : extract feature expression matrices of interest regions.

  • diffExp: gene differential expression analysis.

  • coExp: spatial gene co-expression analysis.

  • multiomics : proteome & Transcriptome joint analysis.

  • midFilter : perform manually filtering spatial expression matrices by MID range.

  • removeBackground: automatic protein background removal.

Clustering

In bioinformatic downstream analysis, clustering is a critical and fundamental method that creates groups of spatial expression points with similar characteristics. The process helps uncover the underlying structure and patterns within the expression data. Clustering plays a crucial role in bioinformatics research because of its versatility in finding gene expression patterns, investigating cell types, and studying disease subtypes.

Choose an appropriate bin size for your expression matrix. For example, the diameter of a mammalian cell is about 10 µm, based on the physical spacing of a pair of DNBs being 500 nm, so it can be roughly estimated that bin20 is a suitable starting point.

Different bin levels on the expression matrix

Leiden algorithm is called for clustering analysis. --Leiden-resolution , default to 1.0, controls the coarseness of the clustering when performing Leiden. Higher values lead to more clusters.

Differential expression analysis can be performed through --marker based on the clusters categorized by Leiden algorithm.

You can run clustering with a bin GEF and set up the command as below:

Clustering outputs based on a bin GEF are listed:

circle-info

If turn --marker on to the analysis, you will get results related to differential expression analysis, namely find_marker_genes.csv and <bin_size>_marker_features.csv.

  • find_marker_genes.csv is the original output file.

  • <bin_size>_marker_features.csv. is a formatted CSV that records mean MID counts, L2FC, adjusted p-value, and expression ratio of marker features for each cluster.

Or begin with a cellbin GEF:

Clustering outputs based on a cellbin GEF are listed:

Lasso

The interactive tool in StereoMap can manually delineate closed regions of interest. It needs SAW reanalyze lasso to extract feature expression matrices of regions, using the GeoJSON from StereoMap.

Lasso in StereoMap

Run the pipeline for lasso, and set up the command as below:

circle-info

--bin-size parameter can accept a list of INTs to generate expression matrices with multiple bin sizes at once.

Lasso outputs based on bin GEF are listed:

Or begin with:

Lasso outputs based on a cellbin GEF are listed:

Differential expression analysis

SAW reanalyze can perform differential expression analysis based on both clustering and lasso areas, using the diffexp GeoJSON file from StereoMap.

circle-info

Selected clusters and lasso regions are recorded in the diffexp GeoJSON.

Perform the analysis simply:

circle-info

--count-data accepts an output directory of the last SAW count, SAW reanalyze will detect all files, needed for differential expression analysis. Related information is recorded in the *.diffexp.geojson.

Differential expression analysis outputs are listed:

Or:

Spatial gene co-expression analysis

Spatial gene co-expression analysis is a computational approach that constructs gene-gene correlation networks by integrating gene expression data and spatial location information. This method aims to elucidate the interaction patterns between genes, identify highly co-varying gene sets, and uncover gene functions and core regulatory genes.

Perform the analysis simply:

Spatial gene co-expression outputs based on a bin GEF are listed:

When you examine the output analysis CSV file, there are four columns that describe the module information related to gene-gene co-expression: gene ID, gene name, and the Moran's Index rank of each gene.

circle-exclamation

Or begin with a cellbin GEF:

Spatial gene co-expression outputs based on a cellbin GEF are listed:

Proteome & Transcriptome joint analysis

SAW multiomics can integrate RNA and protein data and compute the latent space by Total Variational Inference. Perform clustering analysis for latent space and do one-vs-all differential expression analysis to find marker genes and proteins.

You can perform joint analysis with gene and protein bin GEF and set up the command as below:

Or begin with gene and protein cellbin GEF files:

circle-info

Find the corresponding protein panel used in SAW count. You can also use --ref-libraries <CSV> instead of --protein-panel <PANEL>.

Joint analysis outputs are listed:

Or:

MID filtering

The interactive tool in StereoMap can manually set the MID range.

MID filtering outputs are listed:

Or:

Automatic protein background removal

A method for automatically removing non-specific binding protein signals. Find more algorithm details in Proteom background removal.

circle-info

Find the corresponding protein panel used in SAW count. You can also use --ref-libraries <CSV> instead of --protein-panel <PANEL>.

removeBackground outputs based on protein bin GEF are listed:

Last updated