10X单细胞(空间转录组)数据整合分析批次矫正之liger

各位童鞋,大家好,又到周一了,今天我们来分享一下一个批次矫正的方法-----liger,在这个之前呢,我分享过Seurat多样本整合去批次的原理,文章在Seurat包其中的FindIntegrationAnchors函数解析,分享了一些去批次的软件,文章在批次效应,单细胞数据用Harmony算法进行批次矫正, 今天我们来分享另外一个批次去除的方法,liger,文章在Single-Cell Multi-omic Integration Compares and Contrasts Features of Brain Cell Identity, 2019年6月发表与cell(顶级期刊了),而同时在另一篇文献中A benchmark of batch-effect correction methods for single-cell RNA sequencing data比较了很多种批次去除批次方法,对Seurat,harmony,liger三种方法的评价最高,但是其中Seurat矫正存在严重的过矫正问题,而harmony目前已经普遍运用,我们今天分享的liger,它的独到之处又是什么呢?为什么可以发到cell,今天我们来参透它,还是原来的方法,先分享文章,后示例代码。

SUMMARY

Defining cell types requires integrating diverse single-cell measurements from multiple experiments and biological contexts(这个不用多介绍了,一个样本发文章的时代早就过去了). To flexibly model singlecell datasets, we developed LIGER, an algorithm that delineates shared and dataset-specific features of cell identity. We applied it to four diverse and challenging analyses of human and mouse brain cells.
(1) First, we defined region-specific and sexually dimorphic gene expression in the mouse bed nucleus of the stria terminalis.(这个地方用到了形态学方法方面的辅助,以检验整合结果的优劣
(2)Second, we analyzed expression in the human substantia nigra, comparing cell states in specific donors and relating cell types to those in the mouse.(跨物种之间的整合结果检验
(3)Third, we integrated in situ and singlecell expression data to spatially locate fine subtypes of cells present in the mouse frontal cortex.(原位和单细胞共同的分析检验)。
Finally, we jointly defined mouse cortical cell types using single-cell RNA-seq and DNA methylation profiles(DNA甲基化,这个不是我们今天的重点), revealing putative mechanisms of cell-type-specific epigenomic regulation(表观调控). Integrative analyses using LIGER promise to accelerate investigations of celltype definition, gene regulation, and disease states(让我们拭目以待)。

INTRODUCTION

The function of the mammalian brain is dependent upon the coordinated activity of highly specialized cell types.(第一句话就很重要,强调了细胞空间位置的重要性,这也是为什么现在推出10X空间转录组的原因)。单细胞技术have provided an unprecedented opportunity to systematically identify these cellular specializations,across multiple regions,in the context of perturbations,and in related species(每次读到这里,都会想空间转录组如果也是单细胞精度就非常完美了),Furthermore, new technologies can now measure DNA methylation(甲基化的结果也是非常的重要,大家可以深入的学习,这个方面你的大牛是汤富筹(不知道名字打对了没)),chromatin accessibility(这个就是ATAC),and in situ expression(原位杂交),in thousands to millions of cells.(庞大的单细胞数据目前也是一个大问题,其中张泽民团队研究的新冠文章细胞数量达到恐怖的百万级)Each of these experimental contexts and measurement modalities provides a different glimpse into cellular identity.

Integrative computational tools that can flexibly combine individual single-cell datasets into a unified, shared analysis offer many exciting biological opportunities.(整合分析的必要性),The major challenge of
integrative analysis lies in reconciling the immense heterogeneity observed across individual datasets.(现在不止免疫的个体异质性了,很多都设及到批次)。However, in many kinds of analysis, both dataset similarities and differences are biologically important, such as when we seek to compare and contrast scRNA-seq data from healthy and disease-affected individuals。
To address these challenges, we developed a new computational method called LIGER (linked inference of genomic experimental relationships). We show here that LIGER enables the identification of shared cell types across individuals, species, and multiple modalities (gene expression, epigenetic, or spatial data), as well as dataset-specific features, offering a unified analysis of heterogeneous single-cell datasets.(在这里我们只关注样本的差异去除,至于物种可以了解一下)。

Result1 Comparing and Contrasting Single-Cell Datasets with Shared and Dataset-Specific Factors

LIGER takes as input multiple single-cell datasets, which may be scRNA-seq experiments from different individuals, time points, or species—or measurements from different molecular modalities, such as single-cell epigenome data or spatial gene expression data(个体,物种,技术

LIGER then employs integ

<think>我们正在处理单细胞RNA测序(scRNA-seq)和空间转录组数据之间的分辨率差异问题。单细胞数据提供了单个细胞的分辨率,而空间转录组数据通常捕获的是包含多个细胞的spot(点)的基因表达。因此,为了整合这两种数据,我们需要将单细胞数据映射到空间数据上,或者将空间数据分解为单细胞水平。以下是一些常用的方法: ### 1. **细胞类型解卷积(Cell Type Deconvolution)** **原理**:利用单细胞数据作为参考,将空间转录组数据中的每个spot分解为不同细胞类型的比例,从而推断空间数据中每个spot的细胞组成。 **常用工具**: - **SPOTlight**:使用非负矩阵分解(NMF)或回归模型,将空间spot的表达分解为单细胞数据中定义的细胞类型的混合[^1]。 - **Stereoscope**:基于概率模型,利用单细胞数据训练细胞类型特异性表达模型,然后推断空间数据中每个spot的细胞类型组成[^2]。 - **RCTD**(Robust Cell Type Decomposition):使用一个统计模型来分解空间转录组数据,并考虑技术噪声和生物学变异[^3]。 **代码示例(SPOTlight)**: ```r library(SPOTlight) # scRNA-seq数据作为参考 sc_ref <- scRNAseq_data # 空间转录组数据 spatial_data <- spatial_obj # 运行SPOTlight deconv_result <- spotlight_deconvolution( sc_data = sc_ref, spatial_data = spatial_data, clust_vr = "cell_type", # 单细胞数据中细胞类型所在的列名 n_top = 2000 # 使用前2000个高变基因 ) ``` ### 2. **单细胞空间映射(Single-Cell to Spatial Mapping)** **原理**:通过将单细胞数据中的每个细胞映射到空间数据中的某个位置,实现单细胞分辨率的空间重建。这种方法通常需要空间数据具有较高的分辨率(如Slide-seqV2,Stereo-seq等接近单细胞水平的分辨率)。 **常用工具**: - **Seurat v4中的整合方法**:使用锚点(anchors)将单细胞数据空间数据整合,然后预测每个细胞在空间中的位置。 - **Tangram**:利用深度学习模型(如条件生成对抗网络)将单细胞数据映射到空间数据上,同时保留空间结构[^4]。 - **NovoSpaRc**:基于最优传输理论,利用单细胞数据重建空间表达模式[^5]。 **代码示例(Seurat v4)**: ```r library(Seurat) # 单细胞数据 sc_obj <- CreateSeuratObject(scRNA_counts) sc_obj <- NormalizeData(sc_obj) sc_obj <- FindVariableFeatures(sc_obj) sc_obj <- ScaleData(sc_obj) sc_obj <- RunPCA(sc_obj) # 空间数据 spatial_obj <- Load10X_Spatial("spatial_data_path") spatial_obj <- SCTransform(spatial_obj, assay="Spatial") # 寻找锚点 anchors <- FindTransferAnchors( reference = sc_obj, query = spatial_obj, normalization.method = "SCT", reference.reduction = "pca" ) # 将单细胞数据映射到空间数据 spatial_obj <- MapQuery( anchorset = anchors, reference = sc_obj, query = spatial_obj, refdata = list(celltype = "cell_type") ) ``` ### 3. **空间增强单细胞数据(Spatially Enhanced Single-Cell Data)** **原理**:将空间数据的信息(如空间位置关系)整合单细胞数据中,从而为单细胞数据赋予空间背景。这种方法通常用于生成伪空间数据,或者通过图神经网络(GNN)等模型学习空间模式。 **常用工具**: - **SpaGE**:使用主成分分析空间坐标来预测单细胞数据空间位置[^6]。 - **Giotto**:提供多种工具,包括空间网络构建和空间基因表达模式分析,可以将单细胞数据映射到空间数据上[^7]。 **代码示例(Giotto)**: ```r library(Giotto) # 创建Giotto单细胞对象 sc_giotto <- createGiottoObject(scRNA_counts) sc_giotto <- normalizeGiotto(sc_giotto) sc_giotto <- createSpatialNetwork(sc_giotto) # 创建Giotto空间对象 spatial_giotto <- createGiottoObject(spatial_counts, spatial_locs = spatial_coords) spatial_giotto <- normalizeGiotto(spatial_giotto) # 将单细胞数据映射到空间数据 sc_giotto <- runSpatialDeconvolution( gobject = sc_giotto, spatial_network_name = "spatial_network", expression_values = "normalized" ) ``` ### 4. **联合降维与嵌入(Joint Dimensionality Reduction and Embedding)** **原理**:将单细胞数据空间数据一起进行降维,使它们在同一个低维空间中表示,从而可以直接比较或整合。 **常用工具**: - **Harmony**:用于整合单细胞空间数据批次校正工具[^8]。 - **LIGER**:使用整合非负矩阵分解(iNMF)将多个数据集(包括单细胞空间数据整合到同一个低维空间[^9]。 **代码示例(LIGER)**: ```r library(liger) # 创建LIGER对象 ligerex <- createLiger(list(scRNA = scRNA_counts, spatial = spatial_counts)) ligerex <- normalize(ligerex) ligerex <- selectGenes(ligerex) ligerex <- scaleNotCenter(ligerex) # 整合数据 ligerex <- optimizeALS(ligerex, k=20) # k为因子数 ligerex <- quantileAlignSNF(ligerex) # 可视化 ligerex <- runTSNE(ligerex) plotByDatasetAndCluster(ligerex) ``` ### 5. **空间转录组数据的超分辨率重建** **原理**:通过计算模型提升空间转录组数据的分辨率,使其接近单细胞水平。这类方法通常利用单细胞数据作为先验知识,或者利用空间数据的连续性。 **常用工具**: - **SpaGCN**:结合图卷积网络(GCN)和空间信息,提升空间数据的基因表达分辨率[^10]。 - **STdeconvolve**:一种无参考的解卷积方法,不需要单细胞数据,直接推断空间spot中的细胞类型组成[^11]。 **代码示例(SpaGCN)**: ```python from SpaGCN import SpaGCN import pandas as pd # 加载空间数据 spatial_data = pd.read_csv("spatial_counts.csv", index_col=0) spatial_coords = pd.read_csv("spatial_coords.csv") # 创建SpaGCN对象 spagcn = SpaGCN() spagcn.set_data(spatial_data, spatial_coords) # 设置参数 spagcn.set_params(p=0.5, r=1) # p为平滑参数,r为邻域半径 # 运行模型 spagcn.run() # 获取超分辨率重建结果 enhanced_data = spagcn.enhanced_expression ``` ### 总结 解决单细胞空间转录组数据分辨率差异的核心在于将单细胞水平的信息与空间位置信息进行整合。具体方法包括: - **解卷积**:推断空间spot中的细胞类型组成(如SPOTlight, RCTD)。 - **映射**:将单细胞映射到空间位置(如Tangram, Seurat v4)。 - **联合降维**:在低维空间整合两种数据(如LIGER, Harmony)。 - **超分辨率重建**:提升空间数据的分辨率(如SpaGCN)。 选择哪种方法取决于研究目标和数据特点。例如,如果目标是分析空间数据中的细胞类型分布,解卷积方法更合适;如果希望将单细胞数据映射到空间位置,则映射方法更合适。 --- §§相关问题§§ 1. 如何评估单细胞数据映射到空间位置的准确性? 2. 在解卷积方法中,如何选择最合适的参考单细胞数据集? 3. 空间转录组数据解卷积后如何验证结果可靠性? 4. 联合降维方法在整合单细胞空间数据时有哪些常见陷阱?</think>### 解决单细胞RNA测序与空间转录组数据分辨率差异的核心方法 #### 1. **细胞类型解卷积(Cell Type Deconvolution)** **原理**:将空间转录组的spot视为细胞混合物,利用单细胞数据作为参考,推断spot内的细胞类型比例 **关键工具**: - **Stereoscope**:基于概率模型,将单细胞表达谱映射到空间数据[^1] ```python import stereoscope as st sc_model = st.sc_ranef.fit(sc_counts, cell_labels) # 训练单细胞模型 st.sp_softmax.fit(spatial_counts, sc_model) # 映射到空间数据 ``` - **SPOTlight**:使用非负矩阵分解(NMF)分解spot表达 ```r library(SPOTlight) deconv <- spotlight_deconvolution( sc_data = scRNA_obj, spatial_data = spatial_obj, clust_vr = "cell_type", # 单细胞注释列名 n_top = 2000 # 使用前2000个高变基因 ) ``` **优势**:保留空间位置信息的同时获得单细胞分辨率[^2] #### 2. **空间嵌入映射(Spatial Embedding)** **原理**:将单细胞数据投影到空间坐标系统 **创新方法**: - **Tangram**:利用深度学习对齐单细胞空间数据 ```python import tangram as tg ad_map = tg.map_cells_to_space( ad_sc=sc_anndata, ad_sp=spatial_anndata, device="cuda" # GPU加速 ) tg.plot_cell_annotation(ad_map, "cell_type") # 可视化映射结果 ``` - **Seurat v4锚点转换**: ```r anchors <- FindTransferAnchors( reference = sc_obj, query = spatial_obj, normalization.method = "SCT" ) predictions <- TransferData( anchorset = anchors, refdata = sc_obj$cell_type ) spatial_obj <- AddMetaData(spatial_obj, predictions) ``` #### 3. **空间超分辨率重建** **原理**:通过机器学习提升空间数据分辨率 **工具比较**: | 工具 | 算法基础 | 输出分辨率 | 优势领域 | |------------|------------------|----------------|-----------------| | **SpaGCN** | 图卷积网络 | 亚spot级(5-10μm)| 肿瘤微环境[^3] | | **STdeconvolve** | LDA主题模型 | 细胞类型概率图 | 无需参考数据 | | **DestVI** | 变分推断 | 连续空间梯度 | 炎症区域分析 | **SpaGCN示例**: ```python from SpaGCN import SpaGCN spagcn = SpaGCN() spagcn.set_data(spatial_counts, spatial_coords) spagcn.train(p=0.5, r=1) # p=平滑参数, r=邻域半径 enhanced_expression = spagcn.predict_expression() ``` #### 4. **联合降维与对齐** **跨平台整合框架**: - **LIGER**:整合非负矩阵分解(iNMF) ```r library(rliger) combined <- createLiger(list(sc=sc_data, spatial=spatial_data)) combined <- normalize(combined) combined <- selectGenes(combined) combined <- scaleNotCenter(combined) combined <- optimizeALS(combined, k=30) # k=因子数 combined <- quantileAlignSNF(combined) # 空间对齐 ``` - **Harmony**:批次校正后联合聚类 ```r library(harmony) merged <- merge(sc_obj, spatial_obj) merged <- RunHarmony(merged, "dataset", theta=2, # 校正强度 lambda=0.5) # 空间约束权重 ``` #### 5. **空间约束聚类** **针对空间数据优化**: ```r library(Giotto) giotto_obj <- createGiottoObject(spatial_counts, spatial_locs) giotto_obj <- createSpatialNetwork(giotto_obj, method="Delaunay") giotto_obj <- doClusterSpatial( gobject = giotto_obj, cluster_method = "leiden", spatial_weight = 0.8 # 空间权重系数 ) ``` ### 技术选择建议 1. **当有高质量单细胞参考时**:优先使用Stereoscope或SPOTlight进行解卷积 2. **需细胞级空间分布**:选择Tangram或Seurat v4映射 3. **无参考数据时**:采用STdeconvolve或空间约束聚类 4. **分析连续梯度表达**:DestVI或SpaGCN更优 > **关键验证步骤**:通过空间smFISH[^4]验证关键基因(如IL33)的预测空间分布,计算预测位置与实际位置的Pearson相关系数(通常要求$r > 0.75$) ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值