单细胞转录组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 idxi, <- 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

相关推荐
罗西的思考19 小时前
机器人 / 强化学习】HIL-SERL:人类在环驱动的具身智能进化框架
人工智能·算法·机器学习
美团技术团队1 天前
LongCat 开源 VitaBench 2.0:长期动态智能体基准新标杆
人工智能·算法
To_OC2 天前
LC 207 课程表:刚学图论那会儿,我连这是拓扑排序都没看出来
javascript·算法·leetcode
To_OC2 天前
LC 208 实现 Trie 前缀树:曾被名字劝退,写完发现是送分题
javascript·算法·leetcode
BadBadBad__AK2 天前
线段树维护区间 k 次方和
c++·数学·算法·stl
_清歌2 天前
DSpark 深度解读:DeepSeek-V4 如何用「半自回归」把推理速度提升 85%
算法
统计实现局2 天前
SVD 的三步走:双对角化、Givens 收敛、排序
算法
躬行见万象2 天前
《VLA 系列》UniLab 强化训练 | G1 机器人 |复现
算法
统计实现局2 天前
对称不定分解(Bunch-Kaufman):为什么 Cholesky 不够用
算法