10X转录组流程 : Space Ranger 与Cell Ranger 比较

不知道大家看到这两款软件的设计图有没有一种想法: 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

map|cr-counter
map|sr-counter

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,451评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,172评论 3 394
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,782评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,709评论 1 294
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,733评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,578评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,320评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,241评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,686评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,878评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,992评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,715评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,336评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,912评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,040评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,173评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,947评论 2 355