You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

scRNAseq分析:FindVariableFeatures报错'VST.default'未实现的解决

scRNA-seq分析报错:VST.default未实现的解决方法

问题背景

我是自学单细胞RNA测序(scRNA-seq)分析的新手,若问题较为基础还请见谅!已获取SmartSeq2 scRNA-seq数据集的元数据与TPM计数,目标是生成UMAP图并按感兴趣的基因着色。

初始分析代码

NSCs_annotation <- read.csv(file = "count_table/cell_annotation_NSC_Astro/cell_annotation.csv" , row.names = 1)
TPM_NSCs <- read.csv(file = "count_table/TPM_NSC_and_Astro/old_young_combined/Gene_expression_matrix_TPM_all.csv" , row.names = 1)
rownames(NSCs_annotation) <- NSCs_annotation$cell
head( NSCs_annotation )
TPM_NSC <- remove_rownames(TPM_NSCs) %>% column_to_rownames( var = "gene_id")
seurat_sms2 <- CreateSeuratObject(counts = TPM_NSC  , 
                              project = "young_vs_old_SmartSeq2",
                              min.cells = 3 ,
                              min.features = 200)

报错情况

执行后续标准化及降维代码时触发错误:

obj <- seurat_sms2
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj) #Error: 'VST.default' is not implemented yet
obj <- ScaleData(obj)
obj <- RunPCA(obj)

使用环境

  • 系统:Mac
  • RStudio版本:2023.06.0+421
  • Seurat版本:4.9.9.9049

解决方法

经排查,报错根源是创建Seurat对象时传入的counts参数为data.frame格式,Seurat的FindVariableFeatures函数无法处理该格式数据,从而触发VST.default未实现的错误。将数据转换为稀疏矩阵后问题解决,转换及更新后的代码如下:

# 将data.frame转换为稀疏矩阵
counts_matrix = Matrix(as.matrix(TPM_NSC) , sparse=TRUE)
# 重新创建Seurat对象
seurat_sms2 <- CreateSeuratObject(counts = counts_matrix  , 
                              project = "young_vs_old_SmartSeq2",
                              min.cells = 3 ,
                              min.features = 200)

内容的提问来源于stack exchange,提问作者Jemima Becker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 04:50:07