原文: https://mp.weixin.qq.com/s/gBj60iMNP1r2pjG9W77s9w
SpaceRanger 下载安装使用
下载安装
当前版本 Space Ranger - 2.0.0 (July 18, 2022), 运行在Linux 系统, 硬件需满足最小硬件要求:
- 8-core Intel or AMD processor (32 cores recommended)
- 64GB RAM (128GB recommended)
- 1TB free disk space
- 64-bit CentOS/RedHat 7.0 or Ubuntu 14.04
通过命令行下载:
wget -O spaceranger-2.0.0.tar.gz "https://cf.10xgenomics.com/releases/spatial-exp/spaceranger-2.0.0.tar.gz?Expires=1659709773&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZi4xMHhnZW5vbWljcy5jb20vcmVsZWFzZXMvc3BhdGlhbC1leHAvc3BhY2VyYW5nZXItMi4wLjAudGFyLmd6IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjU5NzA5NzczfX19XX0_&Signature=e5SDaYIQejtDwKcXHPwJRnw5TFEvMW~QtdxUk9Yrd07KkAlLhBPsfu4u68jCKLNXAF~mYmpX11SwYkCNB5xjZu0QjIIEXeq61JydUb6oL-D3FRb1Ucf26o~FCM1kyQjna0N5c2cHGD3n2Bv4Vbozut5vYhZHI37LDGBVvkXoUnM7KZT7CNem51ZY58sVJSXsFwv5PEjl8Db2Ypyi6ErdSy2rNqpZ5k~8pVdyIYGaXv95qDsuaI9LlvDnYDRtZWp0hB~yg7bqvhWWk69zz4oAqeHzuZ~ysdzpqD044Iu4Z6~hWFMDilZM42yQNGLskyg5xi7aGxjS3bUAq5Mj2vfBRQ__&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA"
解压spaceranger-2.0.0.tar.gz
tar -zxvf spaceranger-2.0.0.tar.gz
添加环境变量,打开~/.bashrc 添加下面代码
# ~/software/bioinfo/spaceranger-2.0.0 换成自己的路径
export PATH=~/software/bioinfo/spaceranger-2.0.0:$PATH
保存后,使之立即生效
source ~/.bashrc
该命令用来检查系统是否满足软件运行所需最小配置,检测报告保存在sitecheck.txt文件里。
spaceranger sitecheck > sitecheck.txt
测试是否安装成功
spaceranger testrun --no-internet --id=verify_install
没问题的话,运行完终端应该输出
Waiting 6 seconds for UI to do final refresh.
Pipestance completed successfully!
2022-08-05 12:14:58 Shutting down.
Saving pipestance info to "verify_install/verify_install.mri.tgz"
数据下载
数据基本信息
- 10x Genomics obtained fresh frozen mouse brain tissue (Strain C57BL/6)from BioIVT Asterand.
- Tissue section of 10 µm thickness
- H&E image acquired using a Nikon Ti2-E microscope
- Sequencing Depth: 115,569 read pairs per spot
- Sequencing Coverage: Read 1 - 28 bp (includes 16 bp Spatial Barcode, 12 bp UMI); Read 2 - 120 bp (transcript); i7 sample index - 10 bp; i5 sample index - 10 bp
- Visium Slide: V19L01-041
- Capture Area: C1
数据URL:
https://www.10xgenomics.com/resources/datasets/mouse-brain-section-coronal-1-standard-1-1-0
参考数据
下载小鼠的参考数据
$ wget https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-mm10-2020-A.tar.gz
$ tar -xzvf refdata-gex-mm10-2020-A.tar.gz
数据下载
下载fastqs文件:
$ wget -c https://s3-us-west-2.amazonaws.com/10x.files/samples/spatial-exp/1.1.0/V1_Adult_Mouse_Brain/V1_Adult_Mouse_Brain_fastqs.tar
$ tar -xvf V1_Adult_Mouse_Brain_fastqs.tar
以及图像文件
$ wget -c https://cf.10xgenomics.com/samples/spatial-exp/1.1.0/V1_Adult_Mouse_Brain/V1_Adult_Mouse_Brain_image.tif
准备好的数据如下:
datasets/
├── V1_Adult_Mouse_Brain_fastqs
└── V1_Adult_Mouse_Brain_image.tif
refdata-gex-mm10-2020-A/
├── fasta
├── genes
├── pickle
├── reference.json
└── star
其中fastq数据由spaceranger mkfastq生成:
$ ll -h datasets/V1_Adult_Mouse_Brain_fastqs | cut -f 5- -d" "
974M Nov 15 2019 V1_Adult_Mouse_Brain_S5_L001_I1_001.fastq.gz
1020M Nov 15 2019 V1_Adult_Mouse_Brain_S5_L001_I2_001.fastq.gz
3.0G Nov 15 2019 V1_Adult_Mouse_Brain_S5_L001_R1_001.fastq.gz
8.6G Nov 15 2019 V1_Adult_Mouse_Brain_S5_L001_R2_001.fastq.gz
986M Nov 15 2019 V1_Adult_Mouse_Brain_S5_L002_I1_001.fastq.gz
1.1G Nov 15 2019 V1_Adult_Mouse_Brain_S5_L002_I2_001.fastq.gz
3.0G Nov 15 2019 V1_Adult_Mouse_Brain_S5_L002_R1_001.fastq.gz
8.7G Nov 15 2019 V1_Adult_Mouse_Brain_S5_L002_R2_001.fastq.gz
spaceranger mkfastq的输出文件,其命名规则 samplename_S1_L001_R1_001.fastq.gz.
- samplename, 样本名
- S1 ,sample number,以1起始
- L001, flow cell 中的 lane number, 以1起始
- R1, R1 指 read1, R2指 read 2
- 001, 文件命名的最后一部分,总是001.
流程选择
SpaceRanger 分析中,需根据样本类型,物种和成像方式确定合适的pipeline参数设置。
上图是部分pipeline设置选择,完整表格参考:
https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/choosing-pipelines
主要影响Visium Spatial Gene Expression pipeline选择的因素有:
- 样本制作类型,是fresh frozen(FF),还是 formalin fixed paraffin embedded(FFPE), 其中FFPE类型在spaceranger count 计算时需设置--probe-set 来指定species specific probe set reference file
- 成像图片是Brightfield image 还是Fluorescence image, 其中Fluorescence image需要人工通过Loupe Browser进行手动比对处理
Running spaceranger count (FF)
使用spaceranger count pipeline , 该pipeline 以visium slide的显微镜图像(TIFF或JPEG格式)和FastQ文件作为输入来计算fresh frozen (FF) tissue 的空间基因表达, 包含功能有alignment, tissue , fiducial detection and barcode/UMI counting.
visium slide是Visium spatial gene expression 的关键,slide 上有A1,B1,C1,D1四个捕获区, 每个捕获区域上有4992 spots ,边上为Fiducial frame(下图红色部分), 四角为Fiducial marker, 用于后续图像比对识别,不同slide会有所不同, 所以才需通过参数--slide指定特定slide序列号。 而每个 spots 根据组织类型,细胞大小, 组织切片厚度可以捕获的细胞数量在 1-10 个。每个spot有其对应坐标信息, 即组织细胞的空间信息。
命令,适用于可以正常上网的机器上运行:
spaceranger count --id="V1_Adult_Mouse_Brain" \
--description="Adult Mouse Brain (Coronal)" \
--transcriptome=refdata-gex-mm10-2020-A \
--fastqs=datasets/V1_Adult_Mouse_Brain_fastqs \
--image=datasets/V1_Adult_Mouse_Brain_image.tif \
--slide=V19L01-041 \
--area=C1 \
--localcores=40 \
--localmem=128
参数含义:
- -id: 输出文件夹名
- --description:数据描述,会在web_summary.html 呈现
- --transcriptome:参考转录组
- --fastqs:fastqs文件目录
- --image: brightfield image with H&E staining, TIFF或者JPEG格式
- --slide: visium slide serial number
- --area: The capture area, 可以为A1,B1,C1,D1
- --localcores: CPU核数
- --localmem: 最大内存
输出内容
outs
文件夹内 包含了所有pipeline最终运行输出结果
对于输出结果
- 对于输出的单个文件,可以去Understanding Outputs进一步了解
- 可以打开
web_summary.html
来了解初步质控,分析数据结果 - 可以在Loupe Brower中打开.cloupe文件进行下一步分析
- 还可使用 Seurat, DropletUtils, Giotto等工具进行分析
参考
Running spaceranger count (FF) -Software -Spatial Gene Expression -Official 10x Genomics Support
bcl2fastq2 Conversion Software v2.20 Software Guide (15051736) (illumina.com)