Cell Hashing 由NYGC 技術(shù)創(chuàng)新小組與Satija實驗室合作開發(fā)了袁,使用寡核苷酸標記的抗體標記細胞表面表達的蛋白質(zhì)软驰,在每個單細胞上放置一個"樣本條形碼"稚伍,使不同的樣品能夠一起多路復用疼蛾,并在單次實驗中運行。欲了解更多信息愉舔,請參閱此文
此教程簡要演示如何處理 Seurat 中與Cell Hashing一起生成的數(shù)據(jù)。應(yīng)用于兩個數(shù)據(jù)集伙菜,我們可以成功地將細胞分離到它們原始的來源轩缤,并識別跨樣本的雙細胞。
The demultiplexing 函數(shù) HTODemux()執(zhí)行了以下程序:
- 在標準化的 HTO 值上執(zhí)行 k-medoid 聚類,該值最初將細胞分離為 K(樣本的# )+1 群火的。
- 計算 HTO 的"negative"分布壶愤。對于每個 HTO,我們使用平均值最低的群作為negative組馏鹤。
- 對于每個 HTO征椒,我們選合適的負二元分布到negative組。我們使用此分布的 0.99 分位作為閾值湃累。
- 根據(jù)這些閾值勃救,每個細胞根據(jù) HTO被歸類為 positive 或negative。
- 多于1個 HTO positive 的細胞被注釋為雙細胞治力。
來自人類 PBMC 的 8-HTO 數(shù)據(jù)集
數(shù)據(jù)集描述:
- 數(shù)據(jù)來自八個不同捐贈者的外周血單核細胞 (PBMC)蒙秒。
- 每個捐贈者的細胞都具有獨特的標簽,使用CD45作為hashing抗體宵统。
- 樣品隨后被混樣晕讲,并在 10X v2 系統(tǒng)的單個lane上運行。
- 您可以在此處下載RNA和HTO的計數(shù)矩陣马澈,或來自GEO的 FASTQ 文件
基本設(shè)置
加載包
library(Seurat)
讀取數(shù)據(jù)
# Load in the UMI matrix
pbmc.umis <- readRDS("../data/pbmc_umi_mtx.rds")
# For generating a hashtag count matrix from FASTQ files, please refer to
# https://github.com/Hoohm/CITE-seq-Count. Load in the HTO count matrix
pbmc.htos <- readRDS("../data/pbmc_hto_mtx.rds")
# Select cell barcodes detected by both RNA and HTO In the example datasets we have already
# filtered the cells for you, but perform this step for clarity.
joint.bcs <- intersect(colnames(pbmc.umis), colnames(pbmc.htos))
# Subset RNA and HTO counts by joint cell barcodes
pbmc.umis <- pbmc.umis[, joint.bcs]
pbmc.htos <- as.matrix(pbmc.htos[, joint.bcs])
# Confirm that the HTO have the correct names
rownames(pbmc.htos)
## [1] "HTO_A" "HTO_B" "HTO_C" "HTO_D" "HTO_E" "HTO_F" "HTO_G" "HTO_H"
設(shè)置Seurat對象并添加 HTO 數(shù)據(jù)
# Setup Seurat object
pbmc.hashtag <- CreateSeuratObject(counts = pbmc.umis)
# Normalize RNA data with log normalization
pbmc.hashtag <- NormalizeData(pbmc.hashtag)
# Find and scale variable features
pbmc.hashtag <- FindVariableFeatures(pbmc.hashtag, selection.method = "mean.var.plot")
pbmc.hashtag <- ScaleData(pbmc.hashtag, features = VariableFeatures(pbmc.hashtag))
添加 HTO 數(shù)據(jù)作為獨立assay
可以在此處閱讀更多有關(guān)使用多模式數(shù)據(jù)的信息
# Add HTO data as a new assay independent from RNA
pbmc.hashtag[["HTO"]] <- CreateAssayObject(counts = pbmc.htos)
# Normalize HTO data, here we use centered log-ratio (CLR) transformation
pbmc.hashtag <- NormalizeData(pbmc.hashtag, assay = "HTO", normalization.method = "CLR")
基于 HTO 富集Demultiplex細胞
在這里瓢省,我們使用 Seurat 函數(shù)HTODemux()將單個細胞分配回其樣本來源。
# If you have a very large dataset we suggest using k_function = 'clara'. This is a k-medoid
# clustering function for large applications You can also play with additional parameters (see
# documentation for HTODemux()) to adjust the threshold for classification Here we are using the
# default settings
pbmc.hashtag <- HTODemux(pbmc.hashtag, assay = "HTO", positive.quantile = 0.99)
可視化demultiplexing 的結(jié)果
運行HTODemux()的輸出保存在metadata中痊班。我們可以可視化多少細胞被歸類為單細胞勤婚、雙細胞和負細胞/模糊細胞。
# Global classification results
table(pbmc.hashtag$HTO_classification.global)
##
## Doublet Negative Singlet
## 2598 346 13972
山脊圖可視化選定 HTO的 富集
# Group cells based on the max HTO signal
Idents(pbmc.hashtag) <- "HTO_maxID"
RidgePlot(pbmc.hashtag, assay = "HTO", features = rownames(pbmc.hashtag[["HTO"]])[1:2], ncol = 2)
可視化HTO 信號對 辩块,確認單個細胞中的相互排他性
FeatureScatter(pbmc.hashtag, feature1 = "hto_HTO-A", feature2 = "hto_HTO-B")
比較單細胞蛔六、雙細胞和negative 細胞的 UMI 數(shù)量
Idents(pbmc.hashtag) <- "HTO_classification.global"
VlnPlot(pbmc.hashtag, features = "nCount_RNA", pt.size = 0.1, log = TRUE)
為HTOs生成一個二維tsNE圖。在這里废亭,我們將細胞按單細胞和雙細胞分組国章,以實現(xiàn)簡化。
# First, we will remove negative cells from the object
pbmc.hashtag.subset <- subset(pbmc.hashtag, idents = "Negative", invert = TRUE)
# Calculate a tSNE embedding of the HTO data
DefaultAssay(pbmc.hashtag.subset) <- "HTO"
pbmc.hashtag.subset <- ScaleData(pbmc.hashtag.subset, features = rownames(pbmc.hashtag.subset),
verbose = FALSE)
pbmc.hashtag.subset <- RunPCA(pbmc.hashtag.subset, features = rownames(pbmc.hashtag.subset), approx = FALSE)
pbmc.hashtag.subset <- RunTSNE(pbmc.hashtag.subset, dims = 1:8, perplexity = 100)
DimPlot(pbmc.hashtag.subset)
# You can also visualize the more detailed classification result by running Idents(object) <-
# 'HTO_classification' before plotting. Here, you can see that each of the small clouds on the
# tSNE plot corresponds to one of the 28 possible doublet combinations.
根據(jù)Cell Hashing文章中圖 1C 創(chuàng)建 HTO 熱圖豆村。
# To increase the efficiency of plotting, you can subsample cells using the num.cells argument
HTOHeatmap(pbmc.hashtag, assay = "HTO", ncells = 5000)
使用常規(guī)的 scRNA-seq 工作流對細胞進行聚類和可視化液兽,并檢查潛在的批次效應(yīng)。
# Extract the singlets
pbmc.singlet <- subset(pbmc.hashtag, idents = "Singlet")
# Select the top 1000 most variable features
pbmc.singlet <- FindVariableFeatures(pbmc.singlet, selection.method = "mean.var.plot")
# Scaling RNA data, we only scale the variable features here for efficiency
pbmc.singlet <- ScaleData(pbmc.singlet, features = VariableFeatures(pbmc.singlet))
# Run PCA
pbmc.singlet <- RunPCA(pbmc.singlet, features = VariableFeatures(pbmc.singlet))
# We select the top 10 PCs for clustering and tSNE based on PCElbowPlot
pbmc.singlet <- FindNeighbors(pbmc.singlet, reduction = "pca", dims = 1:10)
pbmc.singlet <- FindClusters(pbmc.singlet, resolution = 0.6, verbose = FALSE)
pbmc.singlet <- RunTSNE(pbmc.singlet, reduction = "pca", dims = 1:10)
# Projecting singlet identities on TSNE visualization
DimPlot(pbmc.singlet, group.by = "HTO_classification")
來自四個人類細胞系的 12個HTO 數(shù)據(jù)集
數(shù)據(jù)集描述:
- 數(shù)據(jù)來源于從四個細胞系HEK掌动、K562四啰、KG1 和 THP1收集的單細胞:
- 每個細胞系被進一步分成三個樣本(總共12個樣本)。
- 每個樣品都標有 hashing抗體混合物(CD29和CD45)粗恢,匯集在一起柑晒,在10X的單lane上運行。
- 基于此設(shè)計眷射,我們應(yīng)該能夠檢測跨細胞類型和細胞類型內(nèi)的雙細胞
- 您可以在此處下載RNA和HTO的計數(shù)矩陣匙赞,并可在GEO上找到
創(chuàng)建Seurat對象佛掖,添加 HTO 數(shù)據(jù)并執(zhí)行標準化
# Read in UMI count matrix for RNA
hto12.umis <- readRDS("../data/hto12_umi_mtx.rds")
# Read in HTO count matrix
hto12.htos <- readRDS("../data/hto12_hto_mtx.rds")
# Select cell barcodes detected in both RNA and HTO
cells.use <- intersect(rownames(hto12.htos), colnames(hto12.umis))
# Create Seurat object and add HTO data
hto12 <- CreateSeuratObject(counts = hto12.umis[, cells.use], min.features = 300)
hto12[["HTO"]] <- CreateAssayObject(counts = t(x = hto12.htos[colnames(hto12), 1:12]))
# Normalize data
hto12 <- NormalizeData(hto12)
hto12 <- NormalizeData(hto12, assay = "HTO", normalization.method = "CLR")
Demultiplex data
hto12 <- HTODemux(hto12, assay = "HTO", positive.quantile = 0.99)
可視化demultiplexing的結(jié)果
選定 HTO 的分布按照分類分組,用山脊圖展示
RidgePlot(hto12, assay = "HTO", features = c("HEK-A", "K562-B", "KG1-A", "THP1-C"), ncol = 2)
在熱圖中可視化 HTO 信號
HTOHeatmap(hto12, assay = "HTO")
可視化RNA聚類
- 下面涌庭,我們使用標準的 scRNA-seq 工作流對細胞進行聚類芥被。正如預期的那樣,我們看到四個主要群坐榆,對應(yīng)于細胞系
- 此外拴魄,我們看到中間有小群,表示正確注釋為雙細胞的混合轉(zhuǎn)錄組席镀。
- 我們還看到細胞亞型內(nèi)的雙細胞匹中,它們與同一細胞類型的單細胞混合在一起
# Remove the negative cells
hto12 <- subset(hto12, idents = "Negative", invert = TRUE)
# Run PCA on most variable features
hto12 <- FindVariableFeatures(hto12, selection.method = "mean.var.plot")
hto12 <- ScaleData(hto12, features = VariableFeatures(hto12))
hto12 <- RunPCA(hto12)
hto12 <- RunTSNE(hto12, dims = 1:5, perplexity = 100)
DimPlot(hto12) + NoLegend()