10X单细胞(10X空间转录组)数据分析的一些分析细节

hello,大家好,随着单细胞数据越来越火,我们需要的基础知识也越来越多,也越来越精细,今天给大家分享一些分析的细节知识,所谓细节决定成败,也许自己的数据分析的不好,就是细节没有做好,话不多说,进入正题

首先第一个问题,空油滴的问题,也就是没有捕获到细胞的GEMs,如何识别呢?我们先来看下面的图:

图片.png

这个图大家应该都很熟悉吧,(不知道的自动面壁去😄),目前的cellranger版本对于空油滴(背景)的识别很粗糙,UMI数量在500以上的全部保留,但是对保留的细胞中,有一部分是否为细胞提供了概率值,当然我们一般都当作细胞来处理,进行下游分析了,很明显,这个方法很粗糙,这个地方需要留心,当然,下游分析无论是Seurat还是scanpy都不会对背景再次的识别,只是去除低质量的细胞,那么很多时候,我们需要一个科学的方法来帮助我们去掉“背景的细胞”。

Raw UMI count matrices were imported into R for further processing. For each scRNA-Seq sample, cell calling was performed using ‘emptyDrops’ function from DropletUtils (version 1.4.3) on the full raw count matrices in order to distinguish cells from empty droplets containing only ambient RNA(采用一定的算法,也就是软件辅助去除空油滴,而不再是简单粗暴的去除). Raw count matrices were corrected for Illumina index swapping using ‘swapped-Drops’ . This identified 140,264 non-empty droplets across all single cell pools.这个分析来自于文章Spatiotemporal analysis of human intestinal development at single-cell resolution,2021年初发表于Cell,值得借鉴,其中用到的软件DropletUtils,文章在EmptyDrops: distinguishing cells from empty droplets in droplet-based single-cell RNA sequencing data,2019年发表于Genome Biology,影响因子11分,软件在DropletUtils,代码相对简单,但是背后的算法原理,大家需要认真学习一下了。

第二个问题,低质量细胞的过滤,其实关于10X单细胞数据过滤的问题,在我分享的文章10X单细胞(10X空间转录组)数据分析之细胞过滤那些事,大家感兴趣可以看一下,而今天我们需要更进一步了。

droplet barcodes for which a high percentage of total UMIs originated from mitochondrial RNAs were filtered out, as well as low total UMI count barcodes. These thresholds were derived individually for cells within each compartment following an initial clustering solution of all cells by examining and thresholding empirical distributions within each compartment, as total RNA content (notably higher in endothelial and myeloid cell populations) and mitochondrial RNA content (notably higher in epithelial cells) are highly cell type dependent.这个地方一定要注意,我已经标红了,线粒体和低UMI的细胞过滤不是一刀切的过程,每种细胞类型的过滤阈值依据最初的聚类方案做出的,换句话讲,每个细胞类型的线粒体过滤阈值都不一样,所以在过滤的时候,每种细胞类型都有一个阈值,以此来过滤细胞,怎么样,是不是不符合你最初的认识??如果有能力,这样做是最好。

第三个问题,非线性降维的问题

For each individual pool, Seurat (Butler et al., 2018) R package (version 3.1.5.9900) was used to normalize expression values for total UMI counts per cell. Highly variable genes were identified by fitting the mean-variance relationship and dimensionality reduction was performed using principal-component analysis. Scree plots were used to determine principal components to use for clustering analyses for each pool. Cells were then clustered using Louvain algorithm for modularity optimization using kNN graph as input. Cell clusters were visualized using UMAP algorithm (McInnes et al., 2018) with principal components as input and n.neighbors = 30, spread = 1 and min.dist = 0.1.

看起来很常规,但是我们需要注意这里 n.neighbors = 30, spread = 1 and min.dist = 0.1,我相信很多人在进行UMAP降维的时候都采用默认是,我们先来看看默认值是多少,n.neighbors = 30, spread = 1 and min.dist = 0.3,这三个参数的意义我们来看一下:

  • n.neighbors: This determines the number of neighboring points used in local approximations of manifold structure. Larger values will result in more global structure being preserved at the loss of detailed local structure. In general this parameter should often be in the range 5 to 50.(跟流形学习有关,值越大更加保留全局结构而损失local结构,这里不详细展开聊了,在我分享的文章10X单细胞(10X空间转录组)降维分析之tSNE(算法基础知识)已经有过详细的介绍了)。
  • spread:The effective scale of embedded points. In combination with min.dist this determines how clustered/clumped the embedded points are.(决定降维结构点)。
  • min.dist:This controls how tightly the embedding is allowed compress points together. Larger values ensure embedded points are moreevenly distributed, while smaller values allow the algorithm to optimise more accurately with regard to local structure. Sensible values are in the range 0.001 to 0.5.(决定点降维的紧密程度,较大的值可确保嵌入点分布更均匀,而较小的值可使算法在局部结构方面进行更准确的优化。)。

这三个参数很重要,不过大家通常分析样本的时候默认参数就可以,但是在某个群细分的时候,参数就要根据自己的需要变化了。注意参数的意义。

第四个问题,批次矫正的问题

Cells from separate pools were merged and pool batch effect signal was corrected using harmony (version 1.0) algorithm(harmony矫正)。Merged cell clustering and visualization of cells from all pools was performed as before using Louvain and UMAP algorithms, using harmony dimensionality reduction as input instead of principal components. Merged pool clusters were compared with cell types obtained from individual pools to ensure cell type heterogeneity was not lost due to batch correction.

这个地方,个人认为最为关键,首先矫正采用的是harmony,这个可能大家都有过了解,甚至在用,但是看一看这里的做法,10X单细胞数据也要进行数据分析和定义,整合之后的分析结果要确保单样本分析得到的细胞类型没有因此矫正而丧失其异质性,这个地方很关键,也是我一直坚持的观点,大家一定要深入挖掘自己的数据,不可马虎大意。。

第五个问题,再分群问题

Merged cell data was then divided into compartments based on clustering analysis and marker gene expression, as outlined above. Cells from epithelial, endothelial, pericyte, muscularis, neural, fibroblast, immune, myofibroblast and mesothelial compartments were subset for further analysis. For each compartment, we carried out compartment-specific QC, batch correction and clustering analyses as described above.

注意了,多样本整合后的结果每种细胞类型再分群分析的时候,For each compartment, we carried out compartment-specific QC, batch correction and clustering analyses as described above。一定要注意,千万别用老式的那一套。

看到了吧,细节决定成败,这就是别人发Nature、Cell、Science,你只能发几分的原因,加油吧,路漫漫其修远兮,吾将上下而求索。

天行健,君子以自强不息

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

推荐阅读更多精彩内容