Secondary analysis

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

  • cluster Clustering

  • lasso Extract feature expression matrices of interest regions.

  • diffExp differential expression analysis

  • multiomics Proteome & Transcriptome joint analysis

  • midFilter Performe 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 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/clustering

Clustering outputs based on 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 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 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:

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:

circle-info

--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.

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