[英]FindVariableFeatures Function in Seurat Producing “Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments”
I am running Seurat V3 in RStudio and attempting to run PCA on a newly subsetted object.我在 RStudio 中运行 Seurat V3,并尝试在新的子集 object 上运行 PCA。 As part of that process, I am using the commands:
作为该过程的一部分,我正在使用以下命令:
tnk.cells <- FindVariableFeatures(tnk.cells, assay = "RNA", selection.method = "vst", nfeatures = 2000)
tnk.cells <- RunPCA(tnk.cells, verbose = TRUE, npcs = 30, features = FindVariableFeatures(tnk.cells))
The first process seems to work, but I am unsure if it actually did, and if so, whether I need to specify that "features" in the second command should refer to those features.第一个过程似乎有效,但我不确定它是否真的有效,如果是这样,我是否需要在第二个命令中指定“功能”应该引用这些功能。 Either way, every time I attempt to run the second command, it produces this error, along with three warning messages:
无论哪种方式,每次我尝试运行第二个命令时,都会产生此错误以及三个警告消息:
Error in match(x, table, nomatch = 0L) :
'match' requires vector arguments
In addition: Warning messages:
1: In FindVariableFeatures.Assay(object = assay.data, selection.method = selection.method, :
selection.method set to 'vst' but count slot is empty; will use data slot instead
2: In eval(predvars, data, env) : NaNs produced
3: In hvf.info$variance.expected[not.const] <- 10^fit$fitted :
number of items to replace is not a multiple of replacement length
Does anyone have any idea why these errors/warnings are being produced?有谁知道为什么会产生这些错误/警告? I have tried coercing the output of
FindVariableFeatures
as a vector and a dataframe, to no avail.我尝试将 FindVariableFeatures 的
FindVariableFeatures
为向量和 dataframe,但无济于事。 I also want to ask: do I need to rerun FindVariableFeatures after subsetting a new dataset from a larger one?我还想问:从较大的数据集子集新数据集后,我是否需要重新运行 FindVariableFeatures?
The variable features are already stored in the Seurat object.变量特征已经存储在 Seurat object 中。 You can access them using
VariableFeatures()
, for example:您可以使用
VariableFeatures()
访问它们,例如:
library(Seurat)
pbmc_small =SCTransform(pbmc_small)
pbmc_small = FindVariableFeatures(pbmc_small,nfeatures=20)
head(VariableFeatures(pbmc_small))
[1] "GNLY" "PPBP" "PF4" "S100A8" "VDAC3" "CD1C"
Then you can run it is like this, although by default, it will use the variable features stored in the object:然后你可以像这样运行它,虽然默认情况下,它会使用存储在 object 中的变量特征:
pbmc_small <- RunPCA(pbmc_small,features = VariableFeatures(pbmc_small))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.