> For the complete documentation index, see [llms.txt](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stereotoolss-organization.gitbook.io/saw-user-manual-v8.1/analysis/outputs/count-outputs.md).

# count outputs

## Overview of output structure

&#x20;The `SAW count` pipeline runs in a directory named by `--id` (or by `--sn` in the absence of `--id`). Output files are classified into several folders, in the `outs/` directory.

The exact output files generated from the analysis depend on:

* the version of SAW used
* which pipeline was used, `SAW count` or `SAW realign`
* whether input the microscope image(s)
* the specific parameters added to the analysis

## Spatial Gene Expression

After performing `SAW count` on Stereo-seq T FF, Stereo-seq N FFPE, and Stereo-CITE T FF kits, the following files can be found under the `outs/` directory:

<table><thead><tr><th width="303">Directory/File Name</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>bam/</code></strong></td><td>Files in BAM format.</td></tr><tr><td><code>annotated_bam/</code></td><td>BAM file after alignment and annotation.</td></tr><tr><td><code>&#x3C;SN>.*.bam</code></td><td>Indexed BAM file containing position-sorted reads mapped to CIDs, aligned to the genome, and annotated with GTF/GFF.</td></tr><tr><td><code>&#x3C;SN>.*.bam.csi</code></td><td>Index for <code>&#x3C;SN>.*.bam</code>. </td></tr><tr><td><strong><code>feature_expression/</code></strong></td><td>Feature expression matrices in HDF5 format at different dimensions.</td></tr><tr><td><code>&#x3C;SN>.raw.gef</code></td><td>Feature expression matrix includes the whole information over a complete chip region. It only has bin1 expression counts. </td></tr><tr><td><code>&#x3C;SN>.tissue.gef</code></td><td>Feature expression matrix under the tissue coverage region. It is also a visualization GEF that includes expression counts for bin1, 5, 10, 20, 50, 100, 150, 200.</td></tr><tr><td><code>&#x3C;SN>.cellbin.gef</code></td><td>Cellbin feature expression matrix records the information of cells individually, including the centroid coordinate, boundary coordinates, expression of genes, and cell area.</td></tr><tr><td><code>&#x3C;SN>.adjusted.cellbin.gef</code></td><td>Cellbin expression matrix with cell border expanding, based on <code>&#x3C;SN>_&#x3C;stain_type>_mask_edm_dis_&#x3C;distance>.tif</code>.</td></tr><tr><td><code>&#x3C;SN>.merge.barcodeReadsCount.txt</code></td><td>A mapped CID list file with read counts for each CID, including three columns (x, y, count).</td></tr><tr><td><code>&#x3C;SN>_raw_barcode_gene_exp.txt</code></td><td>An annotated list file with the information of coordinate, gene, MID, read counts, which is prepared to be a sampling file that performs sequence saturation.</td></tr><tr><td><strong><code>analysis/</code></strong></td><td>Secondary analysis files.</td></tr><tr><td><code>&#x3C;SN>.bin20_1.0.h5ad &#x26; &#x3C;SN>.bin50_1.0.h5ad</code></td><td><p>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, based on <code>&#x3C;SN>.tissue.gef</code>. </p><p>This output H5AD is named in the format of <code>&#x3C;SN>.&#x3C;binN>_&#x3C;leiden_res>.h5ad</code>. In the file name, <code>&#x3C;SN></code> stands for the Stereo-seq chip serial number, <code>&#x3C;N></code> for bin size, and <code>&#x3C;leiden_res></code> for the resolution of Leiden clustering.</p></td></tr><tr><td><code>&#x3C;SN>.bin20_1.0.marker_features.csv &#x26; &#x3C;SN>.bin50_1.0.marker_features.csv</code> </td><td>Format-integrated differential expression analysis results, using <code>&#x3C;SN>.tissue.gef</code> of bin20 and bin50.</td></tr><tr><td><code>&#x3C;SN>.cellbin_1.0.h5ad</code></td><td>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, using <code>&#x3C;SN>.cellbin.gef</code>.</td></tr><tr><td><code>&#x3C;SN>.cellbin_1.0.marker_features.csv</code></td><td>Format-integrated differential expression analysis results, using <code>&#x3C;SN>.cellbin.gef</code>.</td></tr><tr><td><code>&#x3C;SN>.cellbin_1.0.adjusted.h5ad</code></td><td>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, using <code>&#x3C;SN>.adjusted.cellbin.gef</code>.</td></tr><tr><td><code>&#x3C;SN>.cellbin_1.0.adjusted.marker_features.csv</code></td><td>Format-integrated differential expression analysis results, using <code>&#x3C;SN>.adjusted.cellbin.gef</code>.</td></tr></tbody></table>

## Spatial Protein Expression

After performing `SAW count` on Strereo-CITE T FF kits, the following files can be found under the `outs/` directory:

<table><thead><tr><th width="303">Directory/File Name</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>feature_expression/</code></strong></td><td>Feature expression matrices in HDF5 format at different dimensions.</td></tr><tr><td><code>&#x3C;SN>.protein.raw.gef</code></td><td>Feature expression matrix includes the whole information over a complete chip region. It only has bin1 expression counts. </td></tr><tr><td><code>&#x3C;SN>.protein.tissue.gef</code></td><td>Feature expression matrix under the tissue coverage region. It is also a visualization GEF that includes expression counts for bin1, 5, 10, 20, 50, 100, 150, 200.</td></tr><tr><td><code>&#x3C;SN>.protein.cellbin.gef</code></td><td>Cellbin feature expression matrix records the information of cells individually, including the centroid coordinate, boundary coordinates, expression of genes, and cell area.</td></tr><tr><td><code>&#x3C;SN>.protein.adjusted.cellbin.gef</code></td><td>Cellbin expression matrix with cell border expanding, based on <code>&#x3C;SN>_&#x3C;stain_type>_mask_edm_dis_&#x3C;distance>.tif</code>.</td></tr><tr><td><code>&#x3C;SN>.protein.tissue.rmbg.gem.gz</code></td><td>Feature expression matrix from automatic protein background removal.  It shows bin1 expression counts. </td></tr><tr><td><code>&#x3C;SN>_cid_pid_mid_reads.tsv</code></td><td>A list file with coordinate, PID, MID, and read counts,  which is prepared to be a sampling file that performs sequence saturation for all proteins. </td></tr><tr><td><code>&#x3C;SN>_valid_cid_reads.tsv</code></td><td>A mapped CID list file from all ADT FASTQs, with read counts for each CID, including three columns (x, y, count).</td></tr><tr><td><strong><code>analysis/</code></strong></td><td>Secondary analysis files.</td></tr><tr><td><code>&#x3C;SN>.protein.bin20_0.1.h5ad &#x26; &#x3C;SN>.protein.bin50_0.1.h5ad</code></td><td><p>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, based on <code>&#x3C;SN>.protein.tissue.gef</code>. </p><p>This output H5AD is named in the format of <code>&#x3C;SN>.&#x3C;binN>_&#x3C;leiden_res>.h5ad</code>. In the file name, <code>&#x3C;SN></code> stands for the Stereo-seq chip serial number, <code>&#x3C;N></code> for bin size, and <code>&#x3C;leiden_res></code> for the resolution of Leiden clustering.</p></td></tr><tr><td><code>&#x3C;SN>.protein.cellbin_0.1.h5ad</code></td><td>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, using <code>&#x3C;SN>.protein.cellbin.gef</code>.</td></tr><tr><td><code>&#x3C;SN>.protein.cellbin_0.1.adjusted.h5ad</code></td><td>An AnnData H5AD records preprocessing, filtering, normalization, dimensionality reduction, clustering and differential expression analysis, using <code>&#x3C;SN>.protein.adjusted.cellbin.gef</code>.</td></tr></tbody></table>

## Image

<table><thead><tr><th width="306">Directory/File Name</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>image/</code></strong></td><td>Images are generated from automatic or manual workflows.</td></tr><tr><td><code>&#x3C;SN>_&#x3C;stainType>_regist.tif</code></td><td>The panoramic image after the registration with <code>&#x3C;SN>.raw.gef</code> matrix.</td></tr><tr><td><code>&#x3C;SN>_&#x3C;stainType>_tissue_cut.tif</code></td><td>The tissue segmentation image, based on the aligned panoramic image.</td></tr><tr><td><code>&#x3C;SN>_&#x3C;stainType>_mask.tif</code></td><td>The cell segmentation image, based on the aligned panoramic image.</td></tr><tr><td><code>&#x3C;SN>_&#x3C;stainType>_mask_edm_dis_&#x3C;distance>.tif</code></td><td>The adjusted image, based on the cell segmentation image</td></tr></tbody></table>

## Report and Visualization

<table><thead><tr><th width="303">Directory/File Name</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>&#x3C;SN>.report.html</code></strong></td><td>Analysis summary report of metrics and plots in HTML format.</td></tr><tr><td><strong><code>visualization.tar.gz</code></strong></td><td>StereoMap visualization file to presentation and manual processing.</td></tr><tr><td><code>&#x3C;SN>.stereo</code></td><td>A manifest file in JSON format includes experiment and pipeline information, basic analysis statistics, and references to image and spatial matrix files in the SAW output visualization file folder.</td></tr></tbody></table>

## `visualization.tar.gz`

The compressed visualization TAR file integrates all the output results needed by StereoMap for visualization. The contents of an unpacked one are listed:

```
visualization
├── C04042E3.adjusted.cellbin.gef
├── C04042E3.bin20_1.0.h5ad
├── C04042E3.bin50_1.0.h5ad
├── C04042E3.cellbin_1.0.adjusted.h5ad
├── C04042E3.rpi
├── C04042E3_SC_20240930_141410_4.1.0.tar.gz
├── C04042E3.stereo
├── C04042E3.tissue.gef
└── HE_matrix_template.txt
```

The compressed visualization TAR file from Stereo-CITE analysis:

```
visualization
├── A02677B5.adjusted.cellbin.gef
├── A02677B5.bin20_1.0.h5ad
├── A02677B5.bin50_1.0.h5ad
├── A02677B5.cellbin_1.0.adjusted.h5ad
├── A02677B5.protein.adjusted.cellbin.gef
├── A02677B5.protein.bin20_0.1.h5ad
├── A02677B5.protein.bin50_0.1.h5ad
├── A02677B5.protein.cellbin_0.1.adjusted.h5ad
├── A02677B5.protein.tissue.gef
├── A02677B5.rpi
├── A02677B5_SC_20240930_094017_4.1.0.tar.gz
├── A02677B5.stereo
├── A02677B5.tissue.gef
└── DAPI_matrix_template.txt
```

### `.stereo`

`.stereo` is a manifest file in JSON format that records

* information about the task in SAW pipelines,
* information of the tissue sample,&#x20;
* basic analysis statistics,&#x20;
* records of image files and expression data for **StereoMap** exploration.

*\*More details about these files can be found in other parts of Outputs.*
