# Stereo-seq T FF

## Stereo-seq kit information

SAW analyzes the sequencing data from the Stereo-seq chip for fresh frozen (FF) samples. The workflow graph is shown below:

<figure><img src="https://1692821827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F33hMinoADCychkEZKBYW%2Fuploads%2F3svqgHm4OuqKbprCJ4IZ%2FSAW_counf_for_FF_8.2%404x.png?alt=media&#x26;token=6b542240-0c1f-41fc-9eaa-f96cef640493" alt=""><figcaption></figcaption></figure>

`--kit-version` for analysis is important to be known, according to the STOmics Stereo-seq Transcriptomics Set User Manual.

<table><thead><tr><th width="254">Stereo-seq Solution</th><th align="center">Stereo-seq Kit</th><th width="164" align="center">--kit-version</th><th>--sequencing-type</th></tr></thead><tbody><tr><td>Stereo-seq Transcriptomics Solution</td><td align="center">V1.2.1</td><td align="center">"Stereo-seq T FF V1.2"</td><td>"PE100_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics mIF Solution</td><td align="center">V1.2</td><td align="center">"Stereo-seq T FF V1.2"</td><td>"PE100_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics H&#x26;E Solution</td><td align="center">V1.2.1</td><td align="center">"Stereo-seq T FF V1.2"</td><td>"PE100_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics Mini Chip Solution</td><td align="center">V1.2</td><td align="center">"Stereo-seq T FF V1.2"</td><td>"PE100_50+100"</td></tr><tr><td>Stereo-seq Large Chip Designs</td><td align="center">V1.0</td><td align="center">"Stereo-seq T FF V1.2"</td><td>"PE100_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics Solution</td><td align="center">V1.3</td><td align="center">"Stereo-seq T FF V1.3"</td><td>"PE75_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics mIF Solution</td><td align="center">V1.3</td><td align="center">"Stereo-seq T FF V1.3"</td><td>"PE75_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics H&#x26;E Solution</td><td align="center">V1.3</td><td align="center">"Stereo-seq T FF V1.3"</td><td>"PE75_50+100"</td></tr><tr><td>Stereo-seq Transcriptomics Mini Chip Solution</td><td align="center">V1.3</td><td align="center">"Stereo-seq T FF V1.3"</td><td>"PE75_50+100"</td></tr><tr><td>Stereo-seq Large Chip Designs</td><td align="center">V1.3</td><td align="center">"Stereo-seq T FF V1.3"</td><td>"PE75_50+100"</td></tr></tbody></table>

*\*T and N stand for Chip T and Chip N respectively.*

According to the relational reference table, confirm your `--kit-version` for the analysis.

## Input files

`SAW count` pipeline requires input files as below:

* The mask file of the Stereo-seq Chip T (`--mask`)
* Stereo-seq sequencing FASTQ files (`--fastqs`)

{% hint style="info" %}
`--sequencing-type` is related to FASTQs, for example, "PE75\_50+100" indicates 75 bp of paired-end sequencing for the product kit, where the read length of read 1 is 50 and that of read 2 is 100. You can find this information in the sequencing report.
{% endhint %}

* The microscopic staining image in `TIFF` or `.tar.gz` format (from **SteroMap**)
  * `--image` for brightfield or fluorescent images in `TIFF`
  * `--image-tar` for brightfield or fluorescent image `.tar.gz` from **StereoMap**
* The reference, including the FASTA genome and GTF/GFF annotation files for the species from which the sample was obtained (`--reference`)
  * reference index files should be built in advance, using [`SAW makeRef`](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/tutorials/preparation-of-reference#saw-makeref)
  * annotation files will be checked for compliance with the standard format automatically, using [`SAW checkGTF`](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/tutorials/preparation-of-reference#saw-checkgtf)

## Run SAW count

For a list of available parameters, please refer to the [command-line arguments](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/pipelines/saw-commands), or simply type `saw count --help`. Before running the pipeline, ensure you have downloaded the chip mask file from our website, which is significant for analysis.

After preparation of input files, choose a suitable workflow according to the image QC result.

### Automatic workflow

To generate spatial feature expression matrices for a Stereo-seq Chip from a fresh frozen (FF) sample using automatic registration, tissue detection, cell segmentation and cell border expanding on a microscope image, run `SAW count` with the following arguments.

{% hint style="warning" %}
If the QC result of the input image is unsuccessful, `SAW count` will not call image-related algorithms for the processing, and will only perform tissue detection based on expression data.
{% endhint %}

```sh
cd /saw/runs

saw count \
    --id=<task_id> \
    --sn=<SN> \
    --omics=transcriptomics \
    --kit-version="Stereo-seq T FF V1.3" \
    --sequencing-type="PE75_50+100" \
    --chip-mask=/path/to/chip/mask \
    --organism=<organism> \
    --tissue=<tissue> \
    --fastqs=/path/to/fastq/folders \
    --reference=/path/to/reference/folder \
    --image-tar=/path/to/image/tar

```

More in [Stereo-seq FF tutorial](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/tutorials/run-main-pipeline/stereo-seq-ff).

### Manual processing

After the first `SAW count` run, you can get the files from `visualization.tar.gz` for both presentation and manual processing in StereoMap. After a series of manual processes, an image `.tar.gz` will be passed back to `SAW realign` for the new results.

{% hint style="info" %}
A QC-failed image should be performed registration between the image and the matrix in StereoMap. After that, `SAW realign` will restart the analysis, calling image-related algorithms based on the aligned image. But manually processed results (tissue and cell segmentation) from StereoMap will not be overwritten.
{% endhint %}

```sh
cd /saw/runs

saw realign \
    --id=<task_id2> \
    --sn=<SN> \
    --count-data=/path/to/previous/SAW/count/task/folder \
    --realigned-image-tar=/path/to/realigned/image/tar

```

More in [Manual Processing tutorial](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/tutorials/with-manually-processed-files).

## Output files

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

```sh
Demo_Mouse_Brain
├── 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%2Fcg85N2IqJTQ62X7GUeFH%2FAnalysis_outputs.png?alt=media&#x26;token=b00298b6-ffac-49c6-b356-e6abceedaae5" 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/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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/pipelines/count/stereo-seq-t-ff.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
