單細(xì)胞數(shù)據(jù)用Harmony算法進(jìn)行批次矯正

Harmony

整合單細(xì)胞RNAseq數(shù)據(jù)進(jìn)行批校正和后續(xù)分析

System requirements

Harmony必須在R版本3.4以上運(yùn)行,支持 Linux, OS X, and Windows 平臺(tái)。

Installation

老方法

library(devtools)
install_github("immunogenomics/harmony")

安裝過(guò)程可能包括從源代碼編譯C ++代碼,因此可能需要幾分鐘。

Usage

Quick Start

PCA matrix

Harmony算法迭代地校正PCA嵌入。要直接輸入您自己的低維嵌入,請(qǐng)?jiān)O(shè)置do_pca = FALSE。 Harmary與一個(gè)小的數(shù)據(jù)集打包在一起。

library(harmony)
my_harmony_embeddings <- HarmonyMatrix(my_pca_embeddings, meta_data, "dataset", do_pca=FALSE)
Normalized gene matrix

也可以在庫(kù)大小歸一化的表達(dá)式計(jì)數(shù)的稀疏矩陣上運(yùn)行Harmony。Harmony將擴(kuò)展這些計(jì)數(shù),運(yùn)行PCA,最后執(zhí)行整合。

library(harmony)
my_harmony_embeddings <- HarmonyMatrix(normalized_counts, meta_data, "dataset")
Seurat

您可以在Seurat工作流程中運(yùn)行Harmony。 您只需要對(duì)代碼進(jìn)行兩項(xiàng)更改。

1、使用RunHarmony()函數(shù)運(yùn)行Harmony
2、在下游分析中,使用Harmony嵌入代替PCA。
egs:
seuratObj <- RunHarmony(seuratObj, "dataset")
seuratObj <- RunUMAP(seuratObj, reduction = "harmony")

也就是說(shuō)用RunHarmony的方法代替PCA。

Harmony with two or more covariates

和諧可以整合多個(gè)協(xié)變量。 為此,請(qǐng)指定要積分的向量協(xié)變量。(就是去除批次效應(yīng))

my_harmony_embeddings <- HarmonyMatrix(my_pca_embeddings, meta_data, c("dataset", "donor", "batch_id"), do_pca=FALSE)

Do the same with your Seurat object:

seuratObject <- RunHarmony(seuratObject, c("dataset", "donor", "batch_id"))

這個(gè)方法跟Seurat根據(jù)樣本去除批次效應(yīng)有點(diǎn)類(lèi)似

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
禁止轉(zhuǎn)載,如需轉(zhuǎn)載請(qǐng)通過(guò)簡(jiǎn)信或評(píng)論聯(lián)系作者。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容