单细胞转录组Seurat去批次-RPCA算法

探序基因已入锐竞平台

要将每个样本的矩阵都单独建立Seurat对象。

如果所有样本在一个Seurat对象中,并且在meta表格中有一列记载细胞对应的样本名,可按如下方法切分:

复制代码
# split the dataset into a list of two seurat objects (stim and CTRL)
ifnb.list <- SplitObject(ifnb, split.by = "stim")

# normalize and identify variable features for each dataset independently
ifnb.list <- lapply(X = ifnb.list, FUN = function(x) {
    x <- NormalizeData(x)
    x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000)
})

或者:

例如在Seurat对象中,meta表格的Samples记录了细胞对应的样本名,运行如下代码切分

project.Seurat[["RNA"]] <- split(project.Seurat[["RNA"]], f = project.Seurat$Samples)

最后count矩阵会按样本切分:

> project.Seurat[["RNA"]]

Assay (v5) data with xxx features for xxx cells

First 10 features:

xxx

Layers:

counts.S1, counts.S2, counts.S3, counts.S4

切分完后:

project.Seurat <- NormalizeData(project.Seurat)

project.Seurat <- FindVariableFeatures(project.Seurat)

project.Seurat <- ScaleData(project.Seurat)

project.Seurat <- RunPCA(project.Seurat)

project.Seurat <- IntegrateLayers(

object = project.Seurat, method = RPCAIntegration,

orig.reduction = "pca", new.reduction = "rpca",

verbose = FALSE

)

大细胞量评测:

细胞量:大约90万个,Seurat版本:5.5.0,SeuratObject版本:5.4.0

报错:

Warning in svd.function(A = t(x = object), nv = npcs, ...) :

You're computing too large a percentage of total singular values, use a standard svd instead.

Warning in svd.function(A = t(x = object), nv = npcs, ...) :

You're computing too large a percentage of total singular values, use a standard svd instead.

Warning in svd.function(A = t(x = object), nv = npcs, ...) :

You're computing too large a percentage of total singular values, use a standard svd instead.

Error in idx[i, ] <- res[[i]][[1]] : 被替换的项目不是替换值长度的倍数

Calls: IntegrateLayers ... resolve.list -> signalConditionsASAP -> signalConditions

停止执行

参考:

Seurat Tutorial 5:使用 reciprocal PCA (RPCA) 快速整合https://zhuanlan.zhihu.com/p/653865719Seurat4.0系列教程13:使用RPCA快速整合数据https://cloud.tencent.com/developer/article/1931214单细胞:IntegrateLayers函数中这几种主流的单细胞数据整合方法https://cloud.tencent.com/developer/article/2616679

相关推荐
BirdenT1 小时前
20260519紫题训练
c++·算法
csdn_aspnet6 小时前
C语言 Lomuto分区算法(Lomuto Partition Algorithm)
c语言·开发语言·算法
谙弆悕博士7 小时前
【附C源码】从零实现C语言堆数据结构:原理、实现与应用
c语言·数据结构·算法··数据结构与算法
gaosushexiangji10 小时前
DIC系统推荐:基于千眼狼三维数字图像相关的无人机旋翼疲劳试验全场应变与位移测量
人工智能·算法
小王C语言12 小时前
【线程概念与控制】:线程封装
jvm·c++·算法
kyle~12 小时前
工程数学---点云配准卡布施(Kabsch)算法(求解最优旋转矩阵)
线性代数·算法·矩阵
张二娃同学12 小时前
03_变量常量与输入输出_printf与scanf详解
算法
江南十四行13 小时前
并发编程(一)
java·jvm·算法
z2005093013 小时前
今日算法(依旧二叉树)
算法·leetcode·职场和发展
Zxc_13 小时前
《遗传算法:从自然选择到Rastrigin函数优化,手写一个完整的进化求解器》
算法