Secondary analysis
In this tutorial, you will learn how to run the complementary pipeline SAW reanalyze for
clusterClusteringlassoExtract feature expression matrices of interest regions.diffExpdifferential expression analysismultiomicsProteome & Transcriptome joint analysismidFilterPerforme manually filtering spatial expression matrices by MID range.removeBackgroundAutomatic 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 datasets. 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.
Leiden algorithm is called for clustering, --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 perform clustering with a bin GEF and set up the command as below:
saw reanalyze cluster \
--gef=/path/to/input/GEF \
--bin-size=20 \
--Leiden-resolution=1.0 \
--marker \
--output=/path/to/output/clusteringClustering outputs based on bin GEF are listed:
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.csvis 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 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.

Run the pipeline for lasso, and set up the command as below:
--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 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.
Selected clusters and lasso regions are recorded in the diffexp GeoJSON.
Perform the analysis simply:
--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:
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:
--gpu-id <NUM> is available for computing accelaration.
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 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.
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