# Start with 10x Genomics Visium fastq files

* [Add files to the project](#add-files-to-the-project)
* [Pre-processing the unaligned fastq files with Space Ranger](#pre-processing-the-unaligned-fastq-files-with-space-ranger)
* [Annotate Visium image](#annotate-visium-image)

The fastq files are not pre-processed. The steps covered here will show you how to import and pre-process of the Visium Spatial Gene Expression data with brightfield and fluorescence microscope images.

## Add files to the project

The sample used for this tutorial can be found in the [10x Genomics Datasets](https://www.10xgenomics.com/resources/datasets?query=\&page=1\&configure%5Bfacets%5D%5B0%5D=chemistryVersionAndThroughput\&configure%5Bfacets%5D%5B1%5D=pipeline.version\&configure%5BhitsPerPage%5D=50\&configure%5BmaxValuesPerFacet%5D=1000\&menu%5Bproducts.name%5D=Single%20Cell%20Immune%20Profiling\&refinementList%5Bproduct.name%5D=). We will use the [Control, replicate 1 mouse brain sample](https://www.10xgenomics.com/resources/datasets/visium-cytassist-gene-expression-libraries-of-post-xenium-mouse-brain-ff-using-the-mouse-whole-transcriptome-probe-set-2-standard).

* Choose the **10x Genomics Visium fastq** import format
* Click **Next**

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-ec182d61e88e2aa54db2c724132c5d420bbbbd5d%2Fimage2023-12-11_22-8-26.png?alt=media)

If you have not [transferred files to the server](https://help.partek.illumina.com/partek-flow/user-manual/importing-data) already, [click here for more details](https://help.partek.illumina.com/user-manual/importing-data#navigating-the-file-browser-to-transfer-files-to-the-server) and choose to **Transfer files to the server**.

* Select the fastq files in the upload folder used for file transfer (select all sample files at one time; including R1 and R2 for each sample)
* Click **Finish**

The prefix used for R1 and R2 fastq files should match; one sample is shown in this example.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-414bbf3e05f56f308003d4dfe937e4255ae68cce%2Fimage2023-12-11_23-15-4.png?alt=media)

The fastq files will be imported into the project as an *Unaligned reads* node.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-4ce0f02fd26adc188cf6e864ae35216f00fe8d1e%2Fimage2023-12-11_23-23-57.png?alt=media)

## Pre-processing the unaligned fastq files with Space Ranger

The unaligned reads must be preprocessed before proceeding with the analysis steps covered here: [Spatial data analysis](https://help.partek.illumina.com/partek-flow/tutorials/10x-genomics-visium-spatial-data-analysis/spatial-data-analysis-steps).

* From the unaligned reads node, select **Space Ranger** from the *10x Genomics* drop-down in the toolbox.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-80787305e493c775c71085beac5b776c6a7e2be8%2Fimage2023-12-11_23-24-51.png?alt=media)

[For more information about Space Ranger click here.](https://help.partek.illumina.com/partek-flow/user-manual/task-menu/10x-genomics/space-ranger)

* Specify the type of 10x Visium assay; this tutorial uses the *Visium CytAssist gene expression* library as the assay type
* If you have not done so already, a Cell Ranger reference should be created
* Specify the Reference assembly
* Select the Image and Probe set files that have already been transferred to the server for all samples
* Choose *visium-2-large* as the *Slide parameter* because this Visium CystAssist sample used a 11 x 11 slide capture area
* Click Finish

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-7dcb590be32fe4b1b5b57f42be58ce23915ff9aa%2Fimage2023-12-12_14-18-47.png?alt=media)

The *Space Ranger* task output results in a *Single cell counts* node.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-8b1c786846cd26100a4c9c08fce26a4cc008061a%2Fimage2023-12-12_15-16-50.png?alt=media)

## Annotate Visium image

The tissue image must be annotated to associate the microscopy image with the expression data.

* Click the newly created *Single cell counts* data node
* Click the **Annotation/Metadata** section in the toolbox
* Click **Annotate Visium image**
* Click on the **Browse** button to open the file browser and point to the file **\_spatial.zip**, created by the *Space Ranger* task
* Click **Finish**

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-001b33ae2684a3577bc04c5c14d6a4a63514cbe4%2Fimage2023-12-12_15-11-35.png?alt=media)

Select the zipped image folder for each sample. The image zip file should contain 6 files including image files and tissue position text file with a scale factor json file. The setup page shows the sample table (one sample per row).

You can find the location of the *\_spatial.zip* file using the following steps. Select the **Space Ranger** task node (i.e. the rectangle) and then click on the **Task Details** (toolbox). Click on the **Output files** link to open the page with the list of files created by the *Space Ranger* task. **Mouse over** any of the files to see the directory in which the file is located. The figure below shows the path to the .zip file which is required for *Annotate Visium image*.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-2104a56a77be04ef1c6c4fda34fa37a0664ef89f%2Fimage2023-12-12_15-5-57.png?alt=media)

Mousing over a file on the Output files page shows a balloon with the file location.

A new data node, *Annotated counts*, will be generated.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-999803f382baaadbeafcbc448643a2781cca94a3%2Fimage2023-12-12_15-17-26.png?alt=media)

The *Annotated counts* node is **Split by sample**. This means that any tasks performed from this node will also be split by sample. Invoke tasks from the Single cell counts node to combine samples for analyses.

*Annotate Visium image* task creates a new node, *Annotated counts*. Double click on the **Annotated counts** node to invoke the *Data Viewer* showing data points overlaid on top of the microscopy image.

![](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-7d10f58d2421211674a344d707180076619781d4%2Fimage2023-12-12_15-20-54.png?alt=media)

Data Viewer session as a result of opening an Annotated counts data node. Each data point is a tissue spot.

Proceed with analysis from the *Single cell counts* node. [Click here to learn about viewing the multiple tissue images in the Data Viewer.](https://github.com/illumina-swi/partek-docs/blob/main/docs/partek-flow/tutorials/10x-genomics-visium-spatial-data-analysis/view-tssue-images.md)

## Additional Assistance

If you need additional assistance, please visit [our support page](http://www.partek.com/support) to submit a help ticket or find phone numbers for regional support.
