Seurat scRNA-seq 數(shù)據(jù)整合

Integrative analysis in Seurat v5

Reference

Introduction

  • 單細(xì)胞測(cè)序數(shù)據(jù)集的整合葵蒂,例如跨實(shí)驗(yàn)批次悴了、donor條件的整合,通常是scRNA-seq工作流程中的重要一步扎谎。整合分析可以幫助匹配數(shù)據(jù)集之間的共享細(xì)胞類型和狀態(tài)藕施,這可以提高統(tǒng)計(jì)能力摩幔,最重要的是劳殖,有助于跨數(shù)據(jù)集進(jìn)行準(zhǔn)確的比較分析铐尚。【選擇合適整合方法哆姻,去除批次效應(yīng)帶來(lái)的細(xì)胞差異宣增,關(guān)注細(xì)胞在生物學(xué)上的真實(shí)分群、差異表達(dá)】

  • Seurat v5使用IntegrateLayers功能實(shí)現(xiàn)了簡(jiǎn)化的整合分析矛缨。目前支持五種方法爹脾。這些方法中的每一種都在低維空間中執(zhí)行集成,并返回降維(即integrated.xxx)箕昭,該降維旨在跨批次共同嵌入共享細(xì)胞類型誉简。

  1. Anchor-based CCA integration (method=CCAIntegration)
  2. Anchor-based RPCA integration (method=RPCAIntegration)
  3. Harmony (method=HarmonyIntegration)
  4. FastMNN (method= FastMNNIntegration)
  5. scVI (method=scVIIntegration)

選一種方法整合 IntegrateLayers

obj <- IntegrateLayers(
  object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE
)
obj <- IntegrateLayers(
  object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.rpca",
  verbose = FALSE
)
obj <- IntegrateLayers(
  object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = "harmony",
  verbose = FALSE
)
obj <- IntegrateLayers(
  object = obj, method = FastMNNIntegration,
  new.reduction = "integrated.mnn",
  verbose = FALSE
)
# For example, scVI integration requires `reticulate` which can be installed from CRAN (`install.packages("reticulate")`) as well as `scvi-tools` and its dependencies installed in a conda environment.
#Please see scVI installation instructions [here](https://docs.scvi-tools.org/en/stable/installation.html).

obj <- IntegrateLayers(
  object = obj, method = scVIIntegration,
  new.reduction = "integrated.scvi",
  conda_env = "../miniconda3/envs/scvi-env", verbose = FALSE
)

選一種方法,可視化+聚類

  • FindNeighbors(),FindClusters(),RunUMAP()
## CCA--------------------------------------------------
obj <- FindNeighbors(obj, reduction = "integrated.cca", dims = 1:30)
obj <- FindClusters(obj, resolution = 2, cluster.name = "cca_clusters")
obj <- RunUMAP(obj, reduction = "integrated.cca", dims = 1:30, reduction.name = "umap.cca")
p1 <- DimPlot(
  obj,
  reduction = "umap.cca",
  group.by = c("Method", "predicted.celltype.l2", "cca_clusters"),
  combine = FALSE, label.size = 2
)

## SCVI--------------------------------------------------
obj <- FindNeighbors(obj, reduction = "integrated.scvi", dims = 1:30)
obj <- FindClusters(obj, resolution = 2, cluster.name = "scvi_clusters")
obj <- RunUMAP(obj, reduction = "integrated.scvi", dims = 1:30, reduction.name = "umap.scvi")
p2 <- DimPlot(
  obj,
  reduction = "umap.scvi",
  group.by = c("Method", "predicted.celltype.l2", "scvi_clusters"),
  combine = FALSE, label.size = 2
)

wrap_plots(c(p1, p2), ncol = 2, byrow = F)
兩種整合方法 比較
  • 在選擇方法時(shí)盟广,主要考慮聚類中保留的生物學(xué)信息∥驮浚【看不同聚類marker gene 的特異性 :聚類是不是一個(gè)類型聚在一起筋量,而不是一個(gè)批次聚在一起(marker gene 在好幾類都高表達(dá))】

比較整合結(jié)果--Marker Gene

p1 <- VlnPlot(
  obj,
  features = "rna_CD8A", group.by = "unintegrated_clusters"
) + NoLegend() + ggtitle("CD8A - Unintegrated Clusters")
p2 <- VlnPlot(
  obj, "rna_CD8A",
  group.by = "cca_clusters"
) + NoLegend() + ggtitle("CD8A - CCA Clusters")
p3 <- VlnPlot(
  obj, "rna_CD8A",
  group.by = "scvi_clusters"
) + NoLegend() + ggtitle("CD8A - scVI Clusters")
p1 | p2 | p3
maker gene violinplot
  • 看看CCA整合后的聚類烹吵,在其他整合中的分布 :
obj <- RunUMAP(obj, reduction = "integrated.rpca", dims = 1:30, reduction.name = "umap.rpca")
p4 <- DimPlot(obj, reduction = "umap.unintegrated", group.by = c("cca_clusters"))
p5 <- DimPlot(obj, reduction = "umap.rpca", group.by = c("cca_clusters"))
p6 <- DimPlot(obj, reduction = "umap.scvi", group.by = c("cca_clusters"))
p4 | p5 | p6
cca_cluster check

將選擇的整合后的結(jié)果作為新layer進(jìn)行分析

Seurat v5 assays store data in layers. These layers can store raw, un-normalized counts (layer='counts'), normalized data (layer='data'), or z-scored/variance-stabilized data (layer='scale.data').

obj <- JoinLayers(obj)
obj

## An object of class Seurat 
## 35789 features across 10434 samples within 5 assays 
## Active assay: RNA (33694 features, 2000 variable features)
##  3 layers present: data, counts, scale.data
##  4 other assays present: prediction.score.celltype.l1, prediction.score.celltype.l2, prediction.score.celltype.l3, mnn.reconstructed
##  12 dimensional reductions calculated: integrated_dr, ref.umap, pca, umap.unintegrated, integrated.cca, integrated.rpca, harmony, integrated.mnn, integrated.scvi, umap.cca, umap.scvi, umap.rpca

  • SCT normalization +整合 示例:
options(future.globals.maxSize = 3e+09)
obj <- SCTransform(obj)
obj <- RunPCA(obj, npcs = 30, verbose = F)
obj <- IntegrateLayers(
  object = obj,
  method = RPCAIntegration,
  normalization.method = "SCT",
  verbose = F
)
obj <- FindNeighbors(obj, dims = 1:30, reduction = "integrated.dr")
obj <- FindClusters(obj, resolution = 2)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市桨武,隨后出現(xiàn)的幾起案子肋拔,更是在濱河造成了極大的恐慌,老刑警劉巖呀酸,帶你破解...
    沈念sama閱讀 216,324評(píng)論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件凉蜂,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡性誉,警方通過(guò)查閱死者的電腦和手機(jī)窿吩,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,356評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)错览,“玉大人纫雁,你說(shuō)我怎么就攤上這事∏悴福” “怎么了轧邪?”我有些...
    開封第一講書人閱讀 162,328評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)羞海。 經(jīng)常有香客問(wèn)我忌愚,道長(zhǎng),這世上最難降的妖魔是什么却邓? 我笑而不...
    開封第一講書人閱讀 58,147評(píng)論 1 292
  • 正文 為了忘掉前任硕糊,我火速辦了婚禮,結(jié)果婚禮上申尤,老公的妹妹穿的比我還像新娘癌幕。我一直安慰自己,他們只是感情好昧穿,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,160評(píng)論 6 388
  • 文/花漫 我一把揭開白布勺远。 她就那樣靜靜地躺著,像睡著了一般时鸵。 火紅的嫁衣襯著肌膚如雪胶逢。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,115評(píng)論 1 296
  • 那天饰潜,我揣著相機(jī)與錄音初坠,去河邊找鬼。 笑死彭雾,一個(gè)胖子當(dāng)著我的面吹牛碟刺,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播薯酝,決...
    沈念sama閱讀 40,025評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼半沽,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼爽柒!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起者填,我...
    開封第一講書人閱讀 38,867評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤浩村,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后占哟,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體心墅,經(jīng)...
    沈念sama閱讀 45,307評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,528評(píng)論 2 332
  • 正文 我和宋清朗相戀三年榨乎,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了怎燥。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,688評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡谬哀,死狀恐怖刺覆,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情史煎,我是刑警寧澤谦屑,帶...
    沈念sama閱讀 35,409評(píng)論 5 343
  • 正文 年R本政府宣布,位于F島的核電站篇梭,受9級(jí)特大地震影響氢橙,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜恬偷,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,001評(píng)論 3 325
  • 文/蒙蒙 一悍手、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧袍患,春花似錦坦康、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,657評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至肆良,卻和暖如春筛璧,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背惹恃。 一陣腳步聲響...
    開封第一講書人閱讀 32,811評(píng)論 1 268
  • 我被黑心中介騙來(lái)泰國(guó)打工夭谤, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人巫糙。 一個(gè)月前我還...
    沈念sama閱讀 47,685評(píng)論 2 368
  • 正文 我出身青樓朗儒,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子采蚀,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,573評(píng)論 2 353