Install SpaceRanger
https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest
copycd ~/APP wget -O spaceranger-2.0.1.tar.gz "https://cf.10xgenomics.com/releases/spatial-exp/spaceranger-2.0.1.tar.gz?Expires=1676232276&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZi4xMHhnZW5vbWljcy5jb20vcmVsZWFzZXMvc3BhdGlhbC1leHAvc3BhY2VyYW5nZXItMi4wLjEudGFyLmd6IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjc2MjMyMjc2fX19XX0_&Signature=D6VyUgHG8R0b0pJyGSGmQn2HbRURCTTQxokVTg7ePFFzG55vFKlcc2G2RPWIHa9twQ9x85MJ1SpHcqDzaWpFwja6PanzBNWGJobyS3fAdQcl6AF6OQ3bUXyVzmGPwlq1CyTuX4ptAG4G7l2LS6jetavvK6qFhhWcwWw5tlDCfOV-2klkug2QIN9qd5rVgaZNs6lYx7O1uOhNcyDIxZjn2PXSgatcmmOE7wN2O1hGjtyhq-RWyqPUmVghSGnqIvoKH3loiQTLWUJdrl7m3VCKWlElyIjyNt2jLhZ0AEagmlxTfXL9Q7K0dSBfnnU7lDhaw4a-tavB27SBMl-zKMROwQ__&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA" tar -xf spaceranger-2.0.1.tar.gz ln -s ~/APP/spaceranger-2.0.1/bin/spaceranger ~/APP/bin/spaceranger export PATH=$HOME/APP/bin:$PATH
Reference Genome Index
10X provides the genome reference index of human and mouse, and other species can be constructed by themselves with cellranger
The index of the transcriptome is the same as that of ordinary scRNA-seq
copy#>>>down10Xref.sh>>> # Human reference (GRCh38) md5sum: dfd654de39bff23917471e7fcc7a00cd wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-GRCh38-2020-A.tar.gz md5sum refdata-gex-GRCh38-2020-A.tar.gz # Mouse reference md5sum: 886eeddde8731ffb58552d0bb81f533d wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-mm10-2020-A.tar.gz md5sum refdata-gex-mm10-2020-A.tar.gz #<<<down10Xref.sh<<<d nohup zsh down10Xref.sh &> down10Xref.sh.log &
Download raw data
Most of the articles only provide FASTQ files and do not provide image information, so the mouse brain data set on the 10X official website is used.
Different tissue storage methods (fresh frozen fresh tissue) and FFPE (paraffin embedding) have different data analysis processes, and the H&E image and fluorescence image analysis processes are different, so you need to refer to the pipeline on the 10X official website.
The samples selected here are fresh frozen and HE stained samples
- Official website introduction
copyhttps://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/choosing-pipelines https://www.10xgenomics.com/resources/datasets/mouse-brain-serial-section-1-sagittal-anterior-1-standard-1-1-0 https://www.10xgenomics.com/resources/datasets/mouse-brain-serial-section-1-sagittal-posterior-1-standard-1-1-0
- data download
Include tiff images and fastq files
copycurl -O https://s3-us-west-2.amazonaws.com/10x.files/samples/spatial-exp/1.1.0/V1_Mouse_Brain_Sagittal_Anterior/V1_Mouse_Brain_Sagittal_Anterior_fastqs.tar curl -O https://cf.10xgenomics.com/samples/spatial-exp/1.1.0/V1_Mouse_Brain_Sagittal_Anterior/V1_Mouse_Brain_Sagittal_Anterior_image.tif curl -O https://s3-us-west-2.amazonaws.com/10x.files/samples/spatial-exp/1.1.0/V1_Mouse_Brain_Sagittal_Posterior/V1_Mouse_Brain_Sagittal_Posterior_fastqs.tar curl -O https://cf.10xgenomics.com/samples/spatial-exp/1.1.0/V1_Mouse_Brain_Sagittal_Posterior/V1_Mouse_Brain_Sagittal_Posterior_image.tif
- unzip
copytar -xf V1_Mouse_Brain_Sagittal_Anterior_fastqs.tar tar -xf V1_Mouse_Brain_Sagittal_Posterior_fastqs.tar rm *tar
SpaceRanger count
Run SpaceRanger count on two samples separately for quantification
Parameter introduction
- id
The name of the output folder, the output files of the two samples are named A and P respectively
- slide
Visium slide serial number. Refer to the Slide Parameters for information on supported slide versions. Required unless --unknown-slide is passed.
- area
Visium capture area identifier. Required unless --unknown-slide is passed. Options for Visium are A1, B1, C1, D1.
- loupe-alignment
There are two ways to align pictures when spaceranger count is running. One is to automatically identify the pictures and align them with the software, and the other is to manually align them with Loupe software, generate a json file and provide it to the subsequent software and specify it with the loupe-alignment parameter.
Schematic diagram of the sequencing process

- Anterior sample quantification
copy#>>>A.sh>>> human_index_dir=~/DataHub/10X/refdata-gex-GRCh38-2020-A mouse_index_dir=~/DataHub/10X/refdata-gex-mm10-2020-A fastqs_dir=~/Project/ST/data/V1_Mouse_Brain_Sagittal_Anterior_Section_1_fastqs image_path=~/Project/ST/data/V1_Mouse_Brain_Sagittal_Anterior_image.tif output_dir=~/Project/ST/data cd ${output_dir} spaceranger count \ --id A \ --description Mouse_Brain_Sagittal_Anterior_Section_1 \ --transcriptome ${mouse_index_dir} \ --fastqs ${fastqs_dir} \ --image ${image_path} \ --slide V19L29-035 \ --area B1 \ --localcores 20 \ --localmem 128 #<<<A.sh<<< cd ~/Project/ST/data nohup zsh A.sh &> A.sh.log &
- Posterior sample quantification
copy#>>>P.sh>>> human_index_dir=~/DataHub/10X/refdata-gex-GRCh38-2020-A mouse_index_dir=~/DataHub/10X/refdata-gex-mm10-2020-A fastqs_dir=~/Project/ST/data/V1_Mouse_Brain_Sagittal_Posterior_Section_1_fastqs image_path=~/Project/ST/data/V1_Mouse_Brain_Sagittal_Posterior_image.tif output_dir=~/Project/ST/data cd ${output_dir} spaceranger count \ --id P \ --description Mouse_Brain_Sagittal_Posterior_Section_1 \ --transcriptome ${mouse_index_dir} \ --fastqs ${fastqs_dir} \ --image ${image_path} \ --slide V19L29-035 \ --area A1 \ --localcores 20 \ --localmem 128 #<<<P.sh<<< cd ~/Project/ST/data nohup zsh P.sh &> P.sh.log &
output file
Some key output results
copy├── filtered_feature_bc_matrix.h5 ├── spatial │ ├── aligned_fiducials.jpg │ ├── detected_tissue_image.jpg │ ├── scalefactors_json.json │ ├── spatial_enrichment.csv │ ├── tissue_hires_image.png │ ├── tissue_lowres_image.png │ ├── tissue_positions.csv └── web_summary.html
Files to be checked under the outs folder
- web_summary.html: This is a must-see, a rough look at the running quality of the 10x sample in the SpaceRanger count process
- filtered_feature_bc_matrix.h5: Python read expression matrix
- spatial: image information; the folder includes Visium-specific outs: QC images to check image processing pipeline, downsampled input images, and files that describe spot barcode locations in the images
Other output file descriptions can be viewed on the official website https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/output/overview
The expression matrix and corresponding picture information have been obtained, and the next step is to go to the downstream analysis process of scanpy and squidpy.
Reference
copyhttps://mp.weixin.qq.com/s/VWUmJZnzT7m_7QDjxkbrJw https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/count https://zhuanlan.zhihu.com/p/335673562 # Introduction to the principle of FFPE (paraffin embedding) idle sequencing https://mp.weixin.qq.com/s/YlsuIC61K9fuDwOH9OcitQ # Idle sequencing requires several repetitions, how to combine sequencing with scRNA-seq https://mp.weixin.qq.com/s/jbPYJkF9dS15zJeanWoSEg