> For the complete documentation index, see [llms.txt](https://help.connected.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.connected.illumina.com/dragen-stratamap/dragen-spatial-transcriptome/outputs/intermediates-folder.md).

# Intermediates Folder

**Analysis Output**

When the analysis run completes, the DRAGEN Spatial Transcriptome analysis software generates an intermediate analysis output folder in a specified location. This folder contains outputs from each of the modules within the analysis pipeline, created as the pipeline runs. To view analysis output, navigate to the analysis output folder and select the files that you want to view.

## Analysis Output Folder Structure

The `intermediate_results` directory contains the following top-level folders and files:

* `00_bclconvert/` - BCL conversion outputs
* `01_alignments/` - Alignment results and statistics
* `02_sequencing_saturation/` - Sequencing saturation curves
* `03_matrix_metrics/` - Matrix metrics reports (10 µm bin, cell bin, and SBC reports)
* `04_heatmap/` - Heatmap visualizations
* `05_clustering/` - Clustering results (cell-binned and grid-binned)
* `06_cell_segmentation/` - Cell segmentation masks and contours
* `fastqs/` - BCL Convert output files
* `logs/` - Pipeline logs
* `params_inputs/` - Input parameters
* `stats/` - Consolidated statistics per sample
* `summary/` - Aggregated run-level summaries
* `samplesheet.csv` - Sample sheet for the run

In folders with sample-specific results, all files are organized by sample ID. For example:

* `01_alignments/Sample_ID1/`
* `01_alignments/Sample_ID2/`

Note: Some samples may have multiple sub-samples with suffixes like `_x001`, `_x002`, `_x003` in the alignments folder.

### 00 BCLconvert

Contains the outputs from BCLconvert, including Reports and Logs folders.

**Directory structure:**

```
00_bclconvert/
├── Logs_{FlowCellID}/
│   └── Logs/
└── Reports_{FlowCellID}/
    └── Reports/
```

The FlowCell ID (Substrate ID) of the sequencing read is appended to the Logs and Reports folder names to differentiate runs with multiple flow cell runs of sequencing data.

DRAGEN Spatial Transcriptome runs an updated BCLconvert that demultiplexes by SBC sequence.

### 01 Alignments

Contains alignment results for each sample, organized by Sample\_ID.

#### Files per Sample

**Alignment Statistics Files:**

* `{Sample_ID}_alignment_table_user_friendly.csv` - User-friendly alignment summary
* `Alignment_stats.csv` - Detailed alignment statistics
* `Fastqc_stats.csv` - FastQC quality metrics
* `Quant_stats.csv` - Quantification statistics
* `Trimming_stats.csv` - Trimming statistics

**Multimapping Files (produced when multimappers are included, which is the default):**

* `{Sample_ID}.spatial.multimap_ties_summary.csv` - Summary of multimapping ties
* `{Sample_ID}.spatial.multimap_ties.tsv` - Detailed multimapping information

These files are not produced when `include_only_uniquely_aligned` is set to `true`.

**BAM file (if enabled by user):**

* `{Sample_ID}.spatial.bam` and `{Sample_ID}.spatial.bam.bai` - Output only when the `output-bam` flag is enabled. Not produced by default.

#### Alignment Stats.csv

| Metric                                                                          | Description                                                                                                                                        |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `n_dragen_input_reads`                                                          | Number of reads given to DRAGEN for alignment                                                                                                      |
| `n_reads_mapped_to_genome` / `percent_reads_mapped_to_genome`                   | Number/percent of reads that map to the genome                                                                                                     |
| `n_reads_unmapped` / `percent_reads_unmapped`                                   | Number/percent of reads that do not map to the genome                                                                                              |
| `n_reads_multimapped_to_genome` / `percent_reads_multimapped_to_genome`         | Number/percent of reads that map to multiple places in the genome                                                                                  |
| `n_reads_uniquely_mapped_to_genome` / `percent_reads_uniquely_mapped_to_genome` | Number/percent of unique, unambiguous alignments                                                                                                   |
| `n_unique_SBC`                                                                  | Number of unique spatial barcodes (SBCs) detected                                                                                                  |
| `n_reads_w_error_free_barcodes`                                                 | Number of reads with error-free barcodes                                                                                                           |
| `n_reads_w_corrected_barcodes`                                                  | Number of reads with corrected barcodes                                                                                                            |
| `n_deduplicated_reads`                                                          | Number of reads remaining after de-duplication (i.e., the number of unique molecules)                                                              |
| `sequencing_saturation`                                                         | The fraction of reads that were the second or greater occurrence of a molecular identity. Calculated as 1 - (# deduplicated reads / # total reads) |
| `n_reads_mapped_to_gene` / `percent_reads_mapped_to_gene`                       | Number/percent of alignments assigned to genes                                                                                                     |
| `n_reads_unique_exon_matches`                                                   | Number of unique alignments that were assigned to exons                                                                                            |
| `n_reads_unique_intron_matches`                                                 | Number of unique alignments that were assigned to introns                                                                                          |
| `n_multimapped_reads_filtered`                                                  | Number of multimapped reads that were filtered out                                                                                                 |
| `n_multimapped_reads_with_gene_matches`                                         | Number of multimapped reads that matched to genes                                                                                                  |

#### **Fastqc stats.csv**

| Metric                                | Description                    |
| ------------------------------------- | ------------------------------ |
| `after_trimming_mean_payload_quality` | Average Q-score after trimming |

#### **Quant Stats**

| Metric                                                    | Description                                                                                                                                          |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Exonic_Forward_strand`                                   | Number of reads that match transcripts on the forward strand                                                                                         |
| `Exonic_Reverse_stand`                                    | Number of reads that match transcripts on the reverse strand (note: "stand" is misspelled in actual output)                                          |
| `Exonic_Mismatch_Strand`                                  | In the case of stranded library orientation, number of reads that do not match the expected strand of the transcript                                 |
| `Exonic_Ambiguous_strand`                                 | Reads that match transcripts in both forward and reverse orientation                                                                                 |
| `Exonic_Unknown_transcript`                               | Reads that overlap with an exon of a gene, but do not match any transcript (mismatched splice sites)                                                 |
| `exonic_alignments` / `exonic_alignments_percent`         | Number/percent of alignments assigned to an exon                                                                                                     |
| `intronic_alignments` / `intronic_alignments_percent`     | Number/percent of alignments assigned to an intron                                                                                                   |
| `intergenic_alignments` / `intergenic_alignments_percent` | Number/percent of alignments to regions between genes                                                                                                |
| `5_prime_bias`                                            | Average 5' bias in transcripts with assigned alignments. Calculated as (Average coverage in 5' region) / (average coverage across entire transcript) |
| `3_prime_bias`                                            | Average 3' bias in transcripts with assigned alignments. Calculated as (Average coverage in 3' region) / (average coverage across entire transcript) |

#### **Trimming stats**

DRAGEN Spatial Transcriptome trims in one step: it trims adapters, low-quality bases, polyA, and polyG, and filters any reads that are too short (<22 nt).

| Metric                                                                   | Description                                                                           |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| `n_reads_mapped_to_SBCs`                                                 | Number of reads successfully mapped to spatial barcodes (SBCs)                        |
| `polyg_trimmed_percentage`                                               | Percentage of payload reads trimmed due to polyG nucleotides                          |
| `quality_trimmed_percentage`                                             | Percentage of payload reads trimmed due to low-quality sequences (Q-score < 20)       |
| `adapter_trimmed_percentage`                                             | Percentage of payload reads trimmed by adapter trimming                               |
| `polya_trimmed_percentage`                                               | Percentage of payload reads trimmed by polyA trimming                                 |
| `n_reads_removed_by_trimming` / `n_reads_removed_by_trimming_percentage` | Number/percent of reads that were removed by trimming due to being too short          |
| `n_reads_passing_trimming` / `n_reads_passing_trimming_percentage`       | Number/percent of reads that were kept by trimming and passed to the alignment module |

### 02 Sequencing Saturation

Contains sequencing saturation curves and metrics for each sample.

**Directory structure:**

```
02_sequencing_saturation/{Sample_ID}/
```

#### Files per Sample

**Saturation Curve Data:**

* `{Sample_ID}_saturation_curve_cell.csv` - Cell-binned saturation curve data
* `{Sample_ID}_saturation_curve_grid.csv` - Grid-binned saturation curve data

**Saturation at Fixed Depths:**

* `{Sample_ID}_saturation_at_fixed_depths_cell.csv` - Saturation metrics at specific sequencing depths (cell-binned)
* `{Sample_ID}_saturation_at_fixed_depths_grid.csv` - Saturation metrics at specific sequencing depths (grid-binned)

**Saturation Plots (PNG):**

Multiple saturation-curve plot variants are produced per sample (molecules and genes, per cell and per 10 µm bin, plotted against SBC-filtered reads or total aligned reads). File names follow the pattern `{Sample_ID}_{mol|genes}_saturation_{percell|perbin10}_{SBC_filtered_reads|reads_aligned}.png`.

### 03 Matrix Metrics

Contains detailed matrix metrics for each sample with three types of reports:

1. **10 µm bin report** - Grid-binned at 10 µm resolution
2. **Cell bin report** - Cell-based binning
3. **SBC report** - Spatial-barcode-level metrics
   * May be downsampled depending on sample size.

**Directory structure:**

```
03_matrix_metrics/{Sample_ID}/
├── {Sample_ID}_10umbin_report/
├── {Sample_ID}_cell_report/
└── {Sample_ID}_SBC_report/
```

#### 10 µm Bin Report Files

**Files in `{Sample_ID}_10umbin_report/`:**

* `{Sample_ID}_10umbin_summary_report.csv` - Summary statistics
* `{Sample_ID}_10umbin_total_gene_counts.csv` - Total UMI counts per gene
* `{Sample_ID}_10umbin_top100_genes.csv` - Top 100 genes with the highest UMI counts
* `{Sample_ID}_10umbin_all_hist.png` - Combined histogram of UMI/gene/rRNA/mtRNA counts per 10 µm bin
* `{Sample_ID}_10umbin_all_vln.png` - Combined violin plot of UMI/gene/rRNA/mtRNA counts per 10 µm bin
* `{Sample_ID}_10umbin_individual_hist.png` - Individual histograms of UMI/gene/rRNA/mtRNA counts per 10 µm bin
* `{Sample_ID}_10umbin_individual_vln.png` - Individual violin plots of UMI/gene/rRNA/mtRNA counts per 10 µm bin

**Summary Report Metrics (`{Sample_ID}_10umbin_summary_report.csv`):**

| Metric                                                              | Description                                |
| ------------------------------------------------------------------- | ------------------------------------------ |
| `num_10umbins_wUMI`                                                 | Number of 10 µm bins with at least one UMI |
| `umi_total`                                                         | Total UMI counts in the whole sample       |
| `rRNA_total`                                                        | Total rRNA counts in the whole sample      |
| `rRNA_per`                                                          | Total rRNA percentage in the whole sample  |
| `mtRNA_total`                                                       | Total mtRNA counts in the whole sample     |
| `mtRNA_per`                                                         | Total mtRNA percentage in the whole sample |
| `umi_mean`, `umi_median`, `umi_min`, `umi_max`, `umi_std`           | Statistics of UMIs detected per 10 µm bin  |
| `gene_mean`, `gene_median`, `gene_min`, `gene_max`, `gene_std`      | Statistics of genes detected per 10 µm bin |
| `rRNA_mean`, `rRNA_median`, `rRNA_min`, `rRNA_max`, `rRNA_std`      | Statistics of rRNA detected per 10 µm bin  |
| `mtRNA_mean`, `mtRNA_median`, `mtRNA_min`, `mtRNA_max`, `mtRNA_std` | Statistics of mtRNA detected per 10 µm bin |

#### Cell Bin Report Files

**Files in `{Sample_ID}_cell_report/`:**

* `{Sample_ID}_cell_summary_report.csv` - Summary statistics
* `{Sample_ID}_cell_total_gene_counts.csv` - Total UMI counts per gene
* `{Sample_ID}_cell_top100_genes.csv` - Top 100 genes with the highest UMI counts
* `{Sample_ID}_cell_all_hist.png` - Combined histogram of UMI/gene/rRNA/mtRNA counts per cell
* `{Sample_ID}_cell_all_vln.png` - Combined violin plot of UMI/gene/rRNA/mtRNA counts per cell
* `{Sample_ID}_cell_individual_hist.png` - Individual histograms of UMI/gene/rRNA/mtRNA counts per cell
* `{Sample_ID}_cell_individual_vln.png` - Individual violin plots of UMI/gene/rRNA/mtRNA counts per cell

**Summary Report Metrics (`{Sample_ID}_cell_summary_report.csv`):** Same structure as the 10 µm bin report, but with cell-level statistics instead of grid bins.

#### SBC Report Files

**Files in `{Sample_ID}_SBC_report/`:**

* `{Sample_ID}_SBC_summary_report.csv` - Summary statistics
* `{Sample_ID}_SBC_total_gene_counts.csv` - Total UMI counts per gene
* `{Sample_ID}_SBC_top100_genes.csv` - Top 100 genes with the highest UMI counts
* `{Sample_ID}_SBC_top100_SBC.csv` - Top 100 spatial barcodes by UMI count
* `{Sample_ID}_SBC_all_hist.png` - Combined histogram of UMI/gene/rRNA/mtRNA counts per SBC
* `{Sample_ID}_SBC_all_vln.png` - Combined violin plot of UMI/gene/rRNA/mtRNA counts per SBC
* `{Sample_ID}_SBC_individual_hist.png` - Individual histograms of UMI/gene/rRNA/mtRNA counts per SBC
* `{Sample_ID}_SBC_individual_vln.png` - Individual violin plots of UMI/gene/rRNA/mtRNA counts per SBC
* `{Sample_ID}_SBC_umi_distribution.png` - UMI distribution plot per SBC
* `{Sample_ID}_SBC_umi_cumulative_distribution.png` - Cumulative UMI distribution per SBC

**Summary Report Metrics (`{Sample_ID}_SBC_summary_report.csv`):** Same structure as the 10 µm bin report, but with SBC-level statistics instead of grid bins.

#### Notes:

* **rRNA** is defined as genes from reference GTF files with `gene_type` or `gene_biotype` labeled as `rRNA`, `mt-rRNA`, or `rRNA_pseudogene`.
* **mtRNA** is defined as any gene on the mitochondrial chromosome. The mitochondrial chromosome is either user-defined (using the `mitochondrial_chr` parameter) or is detected by the pipeline, which looks for a chromosome named `chrm`, `m`, or `mt`.

### 04 Heatmap

The following outputs are produced for every sample:

* All transcript counts per 10 µm bin
* All transcript counts per cell bin

### 05 Clustering

Contains Leiden clustering results for both cell-binned and grid-binned data.

**Directory structure:**

```
05_clustering/
├── {Sample_ID}_cell_binned/
└── {Sample_ID}_grid_binned_10um/
```

#### Cell-Binned Clustering Files

**Files in `{Sample_ID}_cell_binned/`:**

* `{Sample_ID}_cell_raw.h5ad` - Raw cell-binned AnnData object
* `{Sample_ID}_cell_filtered.h5ad` - Filtered cell-binned AnnData object
* `{Sample_ID}_cell_clustered.h5ad` - Clustered cell-binned AnnData object
* `{Sample_ID}_cell_umap.png` - UMAP visualization
* `{Sample_ID}_cell_sc_spatial.png` - Spatial clustering visualization

#### Grid-Binned (10 µm) Clustering Files

**Files in `{Sample_ID}_grid_binned_10um/`:**

* `{Sample_ID}_10um_raw.h5ad` - Raw 10 µm grid-binned AnnData object
* `{Sample_ID}_10um_filtered.h5ad` - Filtered 10 µm grid-binned AnnData object
* `{Sample_ID}_10um_clustered.h5ad` - Clustered 10 µm grid-binned AnnData object
* `{Sample_ID}_10um_umap.png` - UMAP visualization
* `{Sample_ID}_10um_sc_spatial.png` - Spatial clustering visualization

**Note:** The AnnData (.h5ad) files are in the standard single-cell analysis format compatible with Scanpy and other Python-based analysis tools.

### 06 Cell Segmentation

* This directory contains segmentation results for the registered images.
* The cell mask file (or nuclei mask file) is in TIFF format, where pixel intensities correspond to cell IDs (pixel intensity 0 means no-cell or no-nuclei region).
* The contour coordinates CSV files include three columns: cell-ID, x-coordinate (µm), and y-coordinate (µm). There is one CSV file for nuclei contours (`*nuclei_contour_coords.csv`) and one for cell contours (`*Expanded_5um_cell_contour_coords.csv`). Contour coordinates are in *substrate* coordinate space, so they can be overlaid with spatial data (raw, 10 µm binned, and cell binned) without any further adjustment.
* To overlay cell or nuclei masks with spatial data (raw, 10 µm binned, and cell binned), you must translate the coordinates in `barcodes.tsv.gz` from *substrate* coordinate space to the local coordinate space of the *sample* region. This can be done by subtracting the global shifts (described above) from the *substrate* coordinates reported in `barcodes.tsv.gz` for each sample.
* Cell regions are obtained by expanding detected nuclei regions.
* More detailed information about the segmentation output structure can be found here: [Illumina Spatial Cell Segmentation Tool](/dragen-stratamap/dragen-spatial-transcriptome/illumina-spatial-cell-segmentation-tool.md)

Contains cell segmentation results, including masks and contour coordinates.

**Directory structure:**

```
06_cell_segmentation/{Sample_ID}/
├── nuclei_segmentation/
├── cell_border_expansion5um/
└── nuclei_segmentation_preview/
    └── preview_tiles/
```

#### Nuclei Segmentation Files

**Files in `nuclei_segmentation/`:**

* `{Sample_ID}_nuclei_segmentation_mask.tif` - Nuclei mask in TIFF format, where pixel intensities correspond to cell IDs (pixel intensity 0 means no-nuclei region)
* `{Sample_ID}_nuclei_contour_coords.csv` - Contour coordinates CSV with three columns: cell-ID, x-coordinate (µm), y-coordinate (µm)
* `{Sample_ID}_nuclei_information.csv` - Detailed information about each detected nucleus
* `{Sample_ID}_cell_counts.txt` - Number of detected nuclei

#### Cell Border Expansion (5 µm) Files

**Files in `cell_border_expansion5um/`:**

* `{Sample_ID}_Expanded_5um_cell_segmentation_mask.tif` - Cell mask in TIFF format, where pixel intensities correspond to cell IDs (pixel intensity 0 means no-cell region)
* `{Sample_ID}_Expanded_5um_cell_contour_coords.csv` - Cell contour coordinates CSV with three columns: cell-ID, x-coordinate (µm), y-coordinate (µm)
* `{Sample_ID}_Expanded_5um_cell_information.csv` - Detailed information about each cell region
* `{Sample_ID}_Expanded_5um_cell_counts.txt` - Number of detected cell regions

#### Nuclei Segmentation Preview Files

The `nuclei_segmentation_preview/` folder provides a quick visual QC of cell segmentation performance on your tissue. A diverse set of ROIs is automatically selected from across the tissue so you can easily assess how well the cell segmentation model performs on your sample without opening the full-resolution mask.

**Files in `nuclei_segmentation_preview/`:**

* `{Sample_ID}_tile_locations.png` - Whole-tissue overview image with green boxes indicating the locations of the automatically selected ROI tiles.
* `{Sample_ID}_segmentation_preview.png` - Grid figure showing each ROI image tile side-by-side with its nuclei contour overlay for quick visual QC.
* `preview_tiles/` - Subfolder containing the individual ROI tile images with nuclei contour overlays:
  * `{Sample_ID}_tile_{N}_img_with_nuclei_contours.png` - Individual ROI tile image with nuclei contour overlay (one file per selected ROI).

#### Important Notes:

1. **Coordinate Space:** Contour coordinates are in substrate coordinate space, so they can be overlaid with spatial data (raw, 10 µm binned, and cell binned) without any further adjustment.
2. **Cell Region Definition:** Cell regions are obtained by expanding detected nuclei regions by 5 µm.
3. **Overlaying Masks with Spatial Data:** To overlay cell or nuclei masks with spatial data (raw, 10 µm binned, and cell binned), you must translate the coordinates in `barcodes.tsv.gz` from substrate coordinate space to the local coordinate space of the sample region. This can be done by subtracting the global shifts (found in the registered image metadata) from the substrate coordinates reported in `barcodes.tsv.gz` for each sample. See [this page](/dragen-stratamap/dragen-spatial-transcriptome/outputs/results-folder/global-and-local-coordinates.md#overview) for more details about global and local coordinates
4. **Mask File Format:** The TIFF mask files use pixel intensity values to encode cell IDs. Each unique non-zero intensity value represents a different cell or nucleus, with 0 representing the background.

### Stats

Contains consolidated statistics for each sample, aggregating metrics from all pipeline modules.

### Logs

Various logs output by the pipeline.

### Summary

Aggregated tables and plots of the outputs of the pipeline.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.connected.illumina.com/dragen-stratamap/dragen-spatial-transcriptome/outputs/intermediates-folder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
