【问题标题】:FindVariableFeatures Function in Seurat Producing "Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments"Seurat 中的 FindVariableFeatures 函数产生“匹配错误(x,表,nomatch = 0L):'匹配'需要向量参数”
【发布时间】:2019-11-18 15:24:15
【问题描述】:

我在 RStudio 中运行 Seurat V3 并尝试在新的子集对象上运行 PCA。作为该过程的一部分,我正在使用以下命令:

 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))

第一个过程似乎有效,但我不确定它是否真的有效,如果是,我是否需要在第二个命令中指定“功能”应该引用这些功能。无论哪种方式,每次我尝试运行第二个命令时,都会产生此错误以及三个警告消息:

 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

有谁知道为什么会产生这些错误/警告?我尝试将FindVariableFeatures 的输出强制为向量和数据框,但无济于事。我还想问:从一个较大的数据集子集新数据集后,我是否需要重新运行 FindVariableFeatures?

【问题讨论】:

    标签: r bioinformatics seurat


    【解决方案1】:

    可变特征已经存储在 Seurat 对象中。您可以使用 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" 
    

    然后就可以这样运行了,虽然默认会使用对象中存储的变量特征:

    pbmc_small <- RunPCA(pbmc_small,features = VariableFeatures(pbmc_small))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-14
      相关资源
      最近更新 更多