【问题标题】:Create a hierarchical clustering dendrogram for integrated Seurat object in R?为R中的集成Seurat对象创建层次聚类树状图?
【发布时间】:2020-11-03 01:08:18
【问题描述】:

有人知道如何为集成的 Seurat 对象创建树状图吗?我可以为非集成对象执行此操作,但是当我尝试时:

immune.combined <- BuildClusterTree(object = immune.combined, slot = "data")

我看到了错误:

Error in hclust(d = data.dist) : NA/NaN/Inf in foreign function call (arg 10)

【问题讨论】:

  • 如果您包含一个简单的reproducible example,其中包含可用于测试和验证可能解决方案的示例输入和所需输出,则更容易为您提供帮助。
  • 我无法分享我自己的数据,但可以在satijalab.org/seurat/v3.1/immune_alignment.html 找到一个可重现的示例作为 SatijaLab 小插图。可以通过“执行综合分析”运行小插曲中列出的代码来重现分析,这样就形成了“免疫.combined”对象。然后运行:immuno.combined

标签: r hierarchical-clustering dendrogram seurat


【解决方案1】:

如果您遵循正常的 Seurat 工作流程,在某些时候您会将默认检测更改为“RNA”。查看 BuildClusterTree 的源代码,它使用了所选分析中变化最大的特征(您选择的分析下的大型 Seurat 对象中的 var.features)。对于集成工作流程,您只计算了“集成”测定的这些值,而不是 RNA 测定。因此,您需要对综合分析进行分析。这意味着这样的事情:

sampleIntegrated <- BuildClusterTree(sampleIntegrated,assay="integrated")

由于某种原因不起作用,并且产生了相同的错误。但是,如果您首先将默认检测明确设置为集成,则它可以工作:

DefaultAssay(sampleIntegrated) <- "integrated"
sampleIntegrated <- BuildClusterTree(sampleIntegrated,assay="integrated")

然后您可以使用您选择的可视化方法。例如,使用 Seurat 的 ggtree 包和工具:

library(ggtree)
myPhyTree <- Tool(object=sampleIntegrated, slot = "BuildClusterTree")
ggtree(myPhyTree)+geom_tiplab()+theme_tree()+xlim(NA,400)

【讨论】:

    猜你喜欢
    • 2016-01-31
    • 1970-01-01
    • 2014-12-14
    • 1970-01-01
    • 2014-12-23
    • 2018-11-26
    • 1970-01-01
    • 2012-08-03
    • 1970-01-01
    相关资源
    最近更新 更多