# Stereo-CITE FF

This tutorial will teach you how to run SAW count pipeline on the Stereo-seq chip derived from a fresh frozen (FF) mouse spleen in Stereo-CITE Proteo-Transcriptomics Solution.

## Prerequisites

To run `SAW count` pipeline smoothly, you should:

* Be acquainted with the Linux system.
* Be familiar with running command line tools.
* Ensure access to a system that meets the [minimum system requirements](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/download-center#system-requirements).

{% hint style="info" %}
**Adequate storage** and **sufficient permissions** should be paid more attention to, before running pipelines.
{% endhint %}

## Overview of SAW count pipeline

Stereo-seq sequencing data from FF tissues is analyzed with `SAW count`.

The pipeline usually begins with:

* a chip mask file (recording CIDs of the Stereo-seq chip),
* gene expression and ADT FASTQ files (from Stereo-seq sequencing),
* a reference library (chosen by the organism information), including the protein panel and transcriptome reference. You can refer to [#reference-libraries-1](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/preparation-of-reference#reference-libraries-1 "mention") and build the reference library in CSV format.
* one or more microscope images (TIFF or image `.tar.gz` from **StereoMap**).

{% hint style="info" %}
The compressed image `.tar.gz` file, from StereoMap, saves the original microscope images and the QC information.
{% endhint %}

<figure><img src="https://1692821827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F33hMinoADCychkEZKBYW%2Fuploads%2Ff2nEem1reHvaXVHbloSR%2FSAW_counf_for_CITE_FF_8.2%404x.png?alt=media&#x26;token=45181991-2963-45fc-9708-8c1a62d4c83f" alt=""><figcaption></figcaption></figure>

Output results mainly include:

* BAMs of alignment and annotation,
* processed images,
* gene and protein expression  matrices at different dimensions,
* transcriptomics clustering and differential expression analysis,
* proteomics clustering,
* an integrated `visualization.tar.gz` for **StereoMap**.

## Demo data

Demo data of the mouse spleen from Stereo-seq Chip T is provided in this tutorial.

Key features of demo - C04776D6:

* Chip size: 1cm \* 1cm (S1)
* Bin1: 500nm \* 500nm
* Tissue section of 10μm thickness
* DAPI-stained image acquired using Motic

[The dataset page](http://116.6.21.110:8090/share/21bb9df9-e6c5-47c5-9aa8-29f2d23a6df4) allows you to download the chip mask file, the raw sequencing files in FASTQ format, a TIFF image or an image `tar.gz`,  a transcriptome reference, and a protein panel. For better organization, creating new folders for corresponding data is a wise choice.

```sh
$ cd /saw

# Create sub-folders of different datasets
$ mkdir -p datasets/STOmics-RNA-fastqs datasets/STOmics-ADT-fastqs datasets/mask datasets/image datasets/reference
```

## Command lines

{% hint style="info" %}
Please create the reference library `ref_libraries.csv` before submitting the task. You can refer to [#reference-libraries-1](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/preparation-of-reference#reference-libraries-1 "mention") and build the reference library.
{% endhint %}

Set up `SAW count` analysis command in your working directory.

```sh
saw count \    
    --id=<task_id> \
    --sn=<SN> \
    --omics=transcriptomics,proteomics \
    --kit-version="Stereo-CITE T FF V1.1" \
    --sequencing-type="PE75_50+100" \
    --chip-mask=/path/to/chip/mask \
    --organism=<organism> \
    --tissue=<tissue> \
    --fastqs=/saw/datasets/STOmics-RNA-fastqs \
    --adt-fastqs=/saw/datasets/STOmics-ADT-fastqs \
    --ref-libraries=/saw/datasets/reference/ref_libraries.csv \
    --image-tar=/path/to/image/tar

```

Brief descriptions of the mentioned parameters in command lines:

<table><thead><tr><th width="208">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>--id</code></td><td>(Optional, default to None) A unique task id ([a-zA-Z0-9_-]+) which will be displayed as the output folder name and the title of HTML report. If the parameter is absent, <code>--sn</code> will play the same role.</td></tr><tr><td><code>--sn &#x3C;SN></code></td><td>(Required, default to None) SN (serial number) of the Stereo-seq chip.</td></tr><tr><td><code>--omics &#x3C;OMICS></code></td><td>(Required, default to "transcriptomics") Omics information. "transcriptomics,proteomics" for Stereo-CITE analysis.</td></tr><tr><td><code>--kit-version &#x3C;TEXT></code></td><td>(Required, default to None) The version of the product kit. More in <a href="../../analysis/pipelines/count">count pipeline introduction</a>.</td></tr><tr><td><code>--sequencing-type &#x3C;TEXT></code></td><td>(Required, default to None) Sequencing type of FASTQs which is recorded in the sequencing report.</td></tr><tr><td><code>--chip-mask &#x3C;MASK></code></td><td>(Required, default to None) Stereo-seq chip mask file.</td></tr><tr><td><code>--organism &#x3C;TEXT></code></td><td>(Optional, default to None) Organism type of sample, usually referring to species.</td></tr><tr><td><code>--tissue &#x3C;TEXT></code></td><td>(Optional, default to None) Physiological tissue of sample.</td></tr><tr><td><code>--ref-libraries &#x3C;CSV></code></td><td>(Optional, default to None) Path to a <a href="../../preparation-of-reference#reference-libraries-1"><code>ref_libraries.csv</code></a> which declares the Transcriptome reference index built by <code>SAW makeRef --mode=STAR</code> , and the protein panel. Not compatible with <code>--reference</code>.</td></tr><tr><td><code>--fastqs &#x3C;PATH></code></td><td>(Required, default to None) Path(s) to folder(s), containing all needed gene expression FASTQs. If FASTQs are stored in multiple directories, use it as: <code>--fastqs=/path/to/directory1,/path/to/directory2,...</code>.  Notice that all FASTQ files under these directories will be loaded for analysis. </td></tr><tr><td><code>--adt-fastqs &#x3C;PATH></code></td><td>(Optional, default to None) Path(s) to folder(s), containing all needed ADT FASTQs. If FASTQs are stored in multiple directories, use it as: <code>--adt-fastqs=/path/to/directory1,/path/to/directory2,...</code>.  Notice that all FASTQ files under these directories will be loaded for analysis. </td></tr><tr><td><code>--image &#x3C;TIFF></code></td><td>(Optional, default to None) TIFF image for QC (quality control), combined with expression matrix for analysis.<br><strong>Name rule for input TIFF :</strong><br>a. <code>&#x3C;SN>_&#x3C;stain_type>.tif</code><br>b. <code>&#x3C;SN>_&#x3C;stain_type>.tiff</code><br>c. <code>&#x3C;SN>_&#x3C;stain_type>.TIF</code><br>d. <code>&#x3C;SN>_&#x3C;stain_type>.TIFF</code><br><strong>&#x3C;stainType> includes:</strong><br>a. ssDNA<br>b. DAPI<br>c. HE (referring to H&#x26;E)<br>d. &#x3C;_IF_name1>_IF, &#x3C;IF_name2>_IF, ...</td></tr><tr><td><code>--image-tar &#x3C;TAR></code></td><td>(Optional, default to None) The compressed image <code>.tar.gz</code> file from StereoMap has been through prepositive QC (quality control).</td></tr></tbody></table>

## Run SAW count

Set up `SAW count` analysis command in your working directory.

```sh
cd /saw/runs

saw count \
    --id=Demo_Mouse_Spleen \
    --sn=C04776D6 \
    --omics=transcriptomics,proteomics \
    --kit-version="Stereo-CITE T FF V1.1" \
    --sequencing-type="PE75_50+100" \
    --chip-mask=/saw/datasets/mask/C04776D6.barcodeToPos.h5 \
    --organism=mouse \
    --tissue=spleen \
    --fastqs=/saw/datasets/STOmics-RNA-fastqs \
    --adt-fastqs=/saw/datasets/STOmics-ADT-fastqs \
    --ref-libraries=/saw/datasets/reference/ref_libraries.csv \
    --image-tar=/saw/datasets/image/C04776D6_SC_20250306_110538_4.1.1.tar.gz
```

{% hint style="info" %}
Content of ref\_libraries.csv :

```
Reference,Type
/saw/datasets/reference/reference-data-mouse_SAW_v8,STAR
/saw/datasets/reference/ProteinPanel_128_mouse_V2.list,ProteinMap
```

{% endhint %}

{% hint style="info" %}
If you input a or certain images in TIFF, the prefixes of the file names should be:

**\<SN>\_\<stain\_type>\_\*.tif**

e.g.:

* C04144D5\_ssDNA.tif
* SS200000135TL\_D1\_DAPI.tif
  {% endhint %}

## Explore the output structure

After pipeline analysis is completed, a new folder named `Demo_Mouse_Spleen` (which is provided by `--id`, or by `--sn` in the absence of `--id`) will appear in your working directory.

All the metadata and outputs generated from `SAW count` are listed below:

```
Demo_Mouse_Thymus
├── pipeline-logs
├── STEREO_ANALYSIS_WORKFLOW_PROCESSING
└── outs
    ├── analysis
    ├── bam
    ├── feature_expression
    ├── image
    ├── <SN>.report.html
    └── visualization.tar.gz
```

<figure><img src="https://1692821827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F33hMinoADCychkEZKBYW%2Fuploads%2F40SAPoKCC9b2rGDSMr59%2FAnalysis_outputs.png?alt=media&#x26;token=0f29228e-5946-466e-b3c5-8e87812b6b86" alt=""><figcaption></figcaption></figure>

If you want to dig deeper into the results,

* Jump to the [`report.html`](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/outputs/html-report) inside `<SN>.report.tar.gz`.
* Explore the [`visualization.tar.gz`](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/outputs/count-outputs#visualization.tar.gz) in **StereoMap**.
* Learn more about the individual files on the [Outputs](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/outputs) page.
