不知道大家看到这两款软件的设计图有没有一种想法: Space Ranger真的是在Cell Ranger基础上做出来的啊!
基本流程都是:
- 输入序列文件:判断试剂类型
- 比对: 得到表达矩阵
- 分析: pca、cluster、tsne(这部分几乎一样)
- Loup可视化
区别部分卑微小王已经在图中备注出来了:空间信息的对齐(ALIGN),这也是10X空间转录组Visium的特色,虽然是嫁接在Cell Ranger基础上的。
其实源码一部分也是直接从Cell Ranger迁移过来的:
cell ranger :
├── builtwith.json
├── cellranger -> cellranger-cs/3.1.0/bin/cellranger
├── cellranger-cs
│ └── 3.1.0
│ ├── bin
│ ├── konfigurator
│ ├── lib
│ ├── LICENSE
│ ├── mro
│ └── tenkit
├── cellranger-shell
├── cellranger-tiny-fastq
│ └── 3.0.0
│ ├── tinygex_S1_L001_I1_001.fastq.gz
│ ├── tinygex_S1_L001_R1_001.fastq.gz
│ ├── tinygex_S1_L001_R2_001.fastq.gz
│ ├── tinygex_S1_L002_I1_001.fastq.gz
│ ├── tinygex_S1_L002_R1_001.fastq.gz
│ └── tinygex_S1_L002_R2_001.fastq.gz
├── cellranger-tiny-ref
│ └── 3.0.0
│ ├── fasta
│ ├── genes
│ ├── pickle
│ ├── reference.json
│ └── star
├── lz4
│ └── v1.8.1.2
│ └── lz4
├── martian-cs
│ └── v3.2.3
│ ├── adapters
│ ├── bin
│ ├── go.mod
│ ├── go.sum
│ ├── jobmanagers
│ ├── mailer
│ ├── tools
│ ├── web
│ ├── WORKSPACE
│ └── xena
├── miniconda-cr-cs
│ └── 4.3.21-miniconda-cr-cs-c10
│ ├── bin
│ ├── compiler_compat
│ ├── conda-bld
│ ├── conda-meta
│ ├── etc
│ ├── include
│ ├── lib
│ ├── libexec
│ ├── LICENSE.txt
│ ├── man
│ ├── share
│ ├── ssl
│ └── x86_64-conda_cos6-linux-gnu
├── product.json
├── sourceme.bash
├── sourceme.csh
└── STAR
└── 5dda596
└── STAR
space ranger
.
├── bin
│ ├── rna
│ │ ├── _includes
│ │ ├── mat2csv
│ │ ├── mkgtf
│ │ └── mkref
│ ├── spaceranger
│ └── spatial_rna
│ ├── count
│ ├── mkfastq
│ └── testrun
├── builtwith.json
├── external
│ ├── anaconda
│ │ ├── bin
│ │ ├── compiler_compat
│ │ ├── doc
│ │ ├── etc
│ │ ├── include
│ │ ├── lib
│ │ ├── libexec
│ │ ├── man
│ │ ├── mkspecs
│ │ ├── phrasebooks
│ │ ├── plugins
│ │ ├── qml
│ │ ├── resources
│ │ ├── share
│ │ ├── ssl
│ │ ├── translations
│ │ ├── var
│ │ └── x86_64-conda_cos6-linux-gnu
│ ├── illuminate
│ │ └── illuminate
│ ├── martian
│ │ ├── adapters
│ │ ├── bin
│ │ ├── jobmanagers
│ │ └── web
│ ├── spaceranger_tiny_inputs
│ │ ├── fastqs
│ │ └── image
│ ├── spaceranger_tiny_ref
│ │ └── 1.0.0
│ ├── tsne
│ │ ├── bh_sne_3d.so
│ │ ├── bh_sne.so
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── _version.py
│ │ └── _version.pyc
│ └── umap
│ └── umap
├── lib
│ ├── bin
│ │ ├── annotate_reads
│ │ ├── bamtofastq
│ │ ├── chunk_reads
│ │ ├── cloupetiler
│ │ ├── convert
│ │ ├── crconverter
│ │ ├── cr_stage
│ │ ├── detect_chemistry
│ │ ├── gprreader
│ │ ├── louvain
│ │ ├── STAR
│ │ └── tiffer
│ └── python
│ ├── cellranger
│ ├── fbpca
│ └── websummary
├── LICENSE
├── mro
│ └── rna
│ ├── _basic_sc_rna_counter.mro
│ ├── _basic_sc_rna_counter_stages.mro
│ ├── chemistry_detector.mro
│ ├── _chemistry_detector_stages.mro
│ ├── _common_cloupe_stages.mro
│ ├── _common_stages.mro
│ ├── sc_rna_analyzer.mro
│ ├── _sc_rna_analyzer_stages.mro
│ ├── _sc_rna_counter_stages.mro
│ ├── _spatial_cloupe_stages.mro
│ ├── _spatial_imaging_cs.mro
│ ├── _spatial_imaging_stages.mro
│ ├── _spatial_reporting_stages.mro
│ ├── spatial_rna_counter_cs.mro
│ ├── spatial_rna_counter.mro
│ ├── spatial_rna_counter_prep.mro
│ └── stages
├── sourceme.bash
├── sourceme.csh
├── spaceranger -> bin/spaceranger
└── tenkit
├── bin
│ ├── check_fastq_params
│ ├── check_fastq_paths
│ ├── common
│ ├── demux
│ ├── docopts
│ ├── get_flowcell
│ ├── _mkfastq
│ ├── sitecheck
│ ├── tarmri
│ ├── _truncate
│ └── upload
├── lib
│ ├── bin
│ └── python
└── mro
├── bcl_processor_cs.mro
├── bcl_processor.mro
├── _bcl_processor_stages.mro
├── make_fastqs_cs.mro
├── make_fastqs.mro
├── _make_fastqs_stages.mro
└── stages
大家看得到space ranger 内部 cellranger的脚本了吗?
.
├── bin
│ ├── annotate_reads
│ ├── bamtofastq
│ ├── chunk_reads
│ ├── cloupetiler
│ ├── convert
│ ├── crconverter
│ ├── cr_stage
│ ├── detect_chemistry
│ ├── gprreader
│ ├── louvain
│ ├── STAR
│ └── tiffer
└── python
├── cellranger
├── fbpca
└── websummary
再看二者的运行方式:
cellranger :
$ cd /home/jdoe/runs
$ cellranger count --id=sample345 \
--transcriptome=/opt/refdata-cellranger-GRCh38-3.0.0 \
--fastqs=/home/jdoe/runs/HAWT7ADXX/outs/fastq_path \
--sample=mysample \
--expect-cells=1000
space ranger :
$ cd /home/jdoe/runs
$ spaceranger count --id=sample345 \
--transcriptome=/opt/refdata/GRCh38-3.0.0 \
--fastqs=/home/jdoe/runs/HAWT7ADXX/outs/fastq_path \
--sample=mysample \
--image=/home/jdoe/runs/images/sample345.tif \
--slide=V19J01-123 \
--area=A1
鉴于 图像文件自动对齐可能不准,space ranger 支持从loup中手动对齐后输入:
$ cd /home/jdoe/runs
$ spaceranger count --id=sample345 \
--transcriptome=/opt/refdata/GRCh38-3.0.0 \
--fastqs=/home/jdoe/runs/HAWT7ADXX/outs/fastq_path \
--sample=mysample \
--image=/home/jdoe/runs/images/sample345.tif \
--slide=V19J01-123 \
--area=A1 \
--loupe-alignment=sample345.json # 我是从loup中导出来的
再看输出结果,spaceranger :
├── analysis
│?? ├── clustering
│?? ├── diffexp
│?? ├── pca
│?? ├── tsne
│?? └── umap
├── cloupe.cloupe
├── filtered_feature_bc_matrix
│?? ├── barcodes.tsv.gz
│?? ├── features.tsv.gz
│?? └── matrix.mtx.gz
├── filtered_feature_bc_matrix.h5
├── metrics_summary.csv
├── molecule_info.h5
├── possorted_genome_bam.bam
├── possorted_genome_bam.bam.bai
├── raw_feature_bc_matrix
│?? ├── barcodes.tsv.gz
│?? ├── features.tsv.gz
│?? └── matrix.mtx.gz
├── raw_feature_bc_matrix.h5
├── spatial # 空间信息全在这 :这些文件是用户提供的原始全分辨率brightfield图像的下采样版本。
下采样是通过box滤波实现的,它对全分辨率图像中像素块的RGB值进行平均,得到下采样图像中一个像素点的RGB值。
│?? ├── aligned_fiducials.jpg 这个图像的尺寸是tissue_hires_image.png。由基准对齐算法发现的基准点用红色高亮显示。此文件对于验证基准对齐是否成功非常有用。
│?? ├── detected_tissue_image.jpg
│?? ├── scalefactors_json.json
│?? ├── tissue_hires_image.png 图像的最大尺寸为2,000像素
│?? ├── tissue_lowres_image.png 图像的最大尺寸为600像素。
│?? └── tissue_positions_list.csv
└── web_summary.html
scalefactors_json.json: This file contains the following fields:
cd /home/jdoe/runs/sample345/spatial/outs
$ cat scalefactors_json.json
{"spot_diameter_fullres": 89.45248682925602, "tissue_hires_scalef": 0.17699115, "fiducial_diameter_fullres": 144.5001710318751, "tissue_lowres_scalef": 0.053097345}
- tissue_hires_scalef:将原始全分辨率图像中的像素位置转换为tissue_hires_image.png中的像素位置的比例因子。
- tissue_lowres_scalef:将原始全分辨率图像中的像素位置转换为tissue_lowres_image.png中的像素位置的比例因子。
- fiducial_diameter_fullres:原始全分辨率图像中跨越基准点直径的像素数。
- spot_diameter_fullres:在原始全分辨率图像中,跨越组织点直径的像素数。
tissue_positions_list。txt:这个文本文件包含一个表,其中的行与点对应。它有4992行,这是空间数组中的点的数量。列的名称没有在文件中指定,对应于以下字段:
- barcode: 与现场有关的条码序列。
- in_tissue:二进制,表示这个点是在组织的内部(1)还是外部(0)。
- array_row:数组中从0到77的点的行坐标。数组有78行。
- array_col: 为了表示点的橙色板条箱排列,这个列索引对偶数行使用从0到126的偶数,对奇数行使用从1到127的奇数。注意,每一行(偶数或奇数)有64个位置。
- pxl_col_in_fullres:全分辨率图像中点中心的列像素坐标。
- pxl_row_in_fullres:全分辨率图像中点中心的行像素坐标。
$ cd /home/jdoe/runs/sample345/spatial/outs
$ head -2 tissue_positions_list.txt
ACGCCTGACACGCGCT-1,0,0,0,910,1261
TACCGATCCAACACTT-1,0,1,1,1030,1329
Type | Description |
---|---|
Unfiltered feature-barcode matrix | Contains every barcode from fixed list of known-good barcode sequences. This includes background and spot associated barcodes. |
Filtered feature-barcode matrix | Contains only spot associated barcodes under tissue. |
cellranger :
.
├── analysis
│ ├── clustering
│ ├── diffexp
│ ├── pca
│ ├── tsne
│ └── umap
├── cloupe.cloupe
├── filtered_feature_bc_matrix
│ ├── barcodes.tsv.gz
│ ├── features.tsv.gz
│ └── matrix.mtx.gz
├── filtered_feature_bc_matrix.h5
├── metrics_summary.csv
├── molecule_info.h5
├── pbmc5k_web_summary.html
├── possorted_genome_bam.bam
├── possorted_genome_bam.bam.bai
├── raw_feature_bc_matrix
│ ├── barcodes.tsv.gz
│ ├── features.tsv.gz
│ └── matrix.mtx.gz
├── raw_feature_bc_matrix.h5
└── web_summary.html
报错的排查
Space Ranger排除故障其实和cellranger并无二样,让我们看报错信息。主要从输入,过程,输出来检查。自己解决不了就把sample_id.mri.tgz文件发给support support@10xgenomics.com:
spaceranger upload your@email.edu sample_id.mri.tgz
警告信息的处理
-
WARN: 警报指示某些参数不是最优的,但管道输出中可能仍然有有用的数据。
WARN
ERROR: 警报指出一个主要问题,并且输出中不太可能有可用的结果。
ERROR